private File defaultWorkingDirectory() { try { return testDirectory.prepareDirectoryForTest( "default" ); } catch ( IOException e ) { throw new UncheckedIOException( e ); } } }
public void prepareDirectory( Class<?> testClass, String test ) throws IOException { if ( owningTest == null ) { owningTest = testClass; } if ( test == null ) { test = "static"; } testDirectory = prepareDirectoryForTest( test ); storeLayout = StoreLayout.of( testDirectory ); defaultDatabaseLayout = storeLayout.databaseLayout( DEFAULT_DATABASE_DIRECTORY ); }
private File[] buildFileNames() throws IOException { String s = "abcdefghijklmnopqrstuvwxyz"; File[] files = new File[s.length()]; TestDirectory testDirectory = TestDirectory.testDirectory( RandomPageCacheTestHarness.class, fs ); File base = testDirectory.prepareDirectoryForTest( "random-pagecache-test-harness" ); for ( int i = 0; i < s.length(); i++ ) { files[i] = new File( base, s.substring( i, i + 1 ) ).getCanonicalFile(); fs.mkdirs( files[i].getParentFile() ); StoreChannel channel = fs.open( files[i], OpenMode.READ_WRITE ); channel.truncate( 0 ); channel.close(); } return files; }
static Fixture prepareDirectoryAndPageCache( Class<?> testClass ) throws IOException { DefaultFileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction(); TestDirectory testDirectory = TestDirectory.testDirectory( testClass, fileSystem ); File dir = testDirectory.prepareDirectoryForTest( "test" ); ThreadPoolJobScheduler scheduler = new ThreadPoolJobScheduler(); PageCache pageCache = StandalonePageCacheFactory.createPageCache( fileSystem, scheduler ); return new Fixture( pageCache, fileSystem, dir, scheduler ); }
private File defaultWorkingDirectory() { try { return testDirectory.prepareDirectoryForTest( "default" ); } catch ( IOException e ) { throw new UncheckedIOException( e ); } } }