@Override public void tearDown() { try { try { umount(); } finally { archive = null; final File temp = this.temp; this.temp = null; if (null != temp && temp.exists() && !temp.delete()) throw new IOException(temp + " (could not delete)"); } } catch (final IOException ex) { logger.log(Level.FINEST, "Failed to clean up test file (this may be just an aftermath):", ex); } finally { super.tearDown(); } }
protected final String getSuffix() { return "." + getScheme(); }
@Override public void setUp() throws IOException { super.setUp(); temp = createTempFile(); delete(temp); archive = new TPath(temp); }
@Override public void setUp() throws IOException { super.setUp(); detector = new TArchiveDetector(getSuffixList(), getArchiveDriver()); environment = Collections.singletonMap(ARCHIVE_DETECTOR, detector); final TConfig config = TConfig.push(); // Using a private file system manager would normally violate the third // party access constraints, but in this context it's safe because no // two test methods should ever access the same archive file(s) except // when performing a sync of all mounted file systems. // Mind that a sync should always succeed (unless there's an issue in // the parent file system) und must not confuse other threads about the // state of the synced archive file(s). // So the default value 'false' helps to identify potential isolation // issues in case this invariant is not met. // See http://truezip.java.net/truezip-file/usage.html#Third_Party_Access if (ISOLATE_FS_MANAGER) config.setFsManager(new FsDefaultManager()); config.setLenient(true); config.setArchiveDetector(detector); }
protected final FsScheme getScheme() { return FsScheme.create(new SuffixSet(getSuffixList()).iterator().next()); }
@Override public void setUp() throws IOException { super.setUp(); temp = createTempFile(); TFile.rm(temp); archive = new TFile(temp); }
@Override public void tearDown() { try { try { umount(); } finally { archive = null; final Path temp = this.temp; this.temp = null; if (null != temp && exists(temp)) delete(temp); } } catch (final IOException ex) { logger.log(Level.FINEST, "Failed to clean up test file (this may be just an aftermath):", ex); } finally { super.tearDown(); } }