if (!config.isReadOnly()) {
setUp();
String filename = "a file to test.text";
FSDirectory rootDir = getFs().getRootEntry().getDirectory();
FSEntry entry = rootDir.addFile(filename);
FSEntry gotEntry = rootDir.getEntry(filename);
assertNotNull("must contain the added file", gotEntry);
assertEquals("returned bad entry", filename, gotEntry.getName());
log.debug("entry before remount=" + FSUtils.toString(entry, true));
remountFS(config, config.isReadOnly());
FSDirectory rootDir2 = getFs().getRootEntry().getDirectory();
TestUtils.listEntries(rootDir2.iterator());
assertFalse("same ref (rootDir) after remount", rootDir == rootDir2);
FSEntry gotEntry2 = rootDir2.getEntry(filename);
assertFalse("same ref (gotEntry2) after remount", gotEntry == gotEntry2);
assertNotNull("must contain the added file", gotEntry2);
assertEquals("returned bad entry", filename, gotEntry2.getName());
log.debug("entry after remount=" + FSUtils.toString(gotEntry2, true));
}
}