/** * Tests that root directory properties persist afetr the #format() operation. * * @throws Exception If failed. */ @Test public void testRootPropertiesPersistAfterFormat() throws Exception { if(!propertiesSupported()) return; if (mode != PRIMARY && !(igfsSecondaryFileSystem instanceof IgfsSecondaryFileSystemImpl)) { // In case of Hadoop dual mode only user name, group name, and permission properties are updated, // an arbitrary named property is just ignored: checkRootPropertyUpdate("foo", "moo", null); checkRootPropertyUpdate(IgfsUtils.PROP_PERMISSION, "0777", "0777"); } else { checkRootPropertyUpdate("foo", "moo", "moo"); checkRootPropertyUpdate(IgfsUtils.PROP_PERMISSION, "0777", "0777"); } }
/** * Test update on the file when it was opened for write(create) and is not closed yet. * * @throws Exception If failed. */ @Test public void testCreateUpdateNoClose() throws Exception { if (dual) return; if(!propertiesSupported()) return; Map<String, String> props = properties("owner", "group", "0555"); create(igfs, paths(DIR, SUBDIR), null); IgfsOutputStream os = null; try { os = igfs.create(FILE, true); igfs.update(FILE, props); os.close(); } finally { U.closeQuiet(os); } }
/** * Test update when parent is the root. * * @throws Exception If failed. */ @SuppressWarnings("ConstantConditions") @Test public void testUpdateParentRoot() throws Exception { if(!propertiesSupported()) return; Map<String, String> props = properties("owner", "group", "0555"); create(igfs, paths(DIR), null); igfs.update(DIR, props); if (dual) assertEquals(props, igfsSecondary.properties(DIR.toString())); assertEquals(props, igfs.info(DIR).properties()); }
/** * Test update in case both local and remote file systems have the same folder structure. * * @throws Exception If failed. */ @SuppressWarnings("ConstantConditions") @Test public void testUpdate() throws Exception { if(!propertiesSupported()) return; Map<String, String> props = properties("owner", "group", "0555"); create(igfs, paths(DIR, SUBDIR), paths(FILE)); igfs.update(FILE, props); if (dual) assertEquals(props, igfsSecondary.properties(FILE.toString())); assertEquals(props, igfs.info(FILE).properties()); }
@Test public void testMkdirs() throws Exception { if (!propertiesSupported()) return;