public EmbeddedDatabaseRule() { this.testDirectory = TestDirectory.testDirectory(); }
public Neo4jWithSocket( Class<?> testClass, TestGraphDatabaseFactory graphDatabaseFactory, Supplier<FileSystemAbstraction> fileSystemProvider, Consumer<Map<String,String>> configure ) { this.testDirectory = TestDirectory.testDirectory( testClass, fileSystemProvider.get() ); this.graphDatabaseFactory = graphDatabaseFactory; this.fileSystemProvider = fileSystemProvider; this.configure = configure; this.workingDirectory = defaultWorkingDirectory(); }
@Override protected TestDirectory createField( ExtensionContext extensionContext ) { ExtensionContext.Store fileSystemStore = getStore( extensionContext, FileSystemExtension.FILE_SYSTEM_NAMESPACE ); FileSystemAbstraction fileSystemAbstraction = fileSystemStore.get( FileSystemExtension.FILE_SYSTEM, FileSystemAbstraction.class ); return fileSystemAbstraction != null ? testDirectory(fileSystemAbstraction) : testDirectory(); }
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; }
@Override public void beforeAll( ExtensionContext context ) throws Exception { testDirectory = TestDirectory.testDirectory(); Class testClass = context.getRequiredTestClass(); String testName = context.getRequiredTestClass().getName(); testDirectory.prepareDirectory( testClass, testName ); }
@Override public Statement apply( final Statement base, Description description ) final TestDirectory directory = TestDirectory.testDirectory( description.getTestClass() ); return super.apply( directory.apply( new Statement()
private NeoStores open( FileSystemAbstraction fs, PageCache pageCache, RecordFormats format, Function<FileSystemAbstraction,IdGeneratorFactory> idGeneratorFactory, String... config ) throws IOException { assert neoStores == null : "Already opened"; TestDirectory testDirectory = TestDirectory.testDirectory( fs ); testDirectory.prepareDirectory( testClass, null ); Config configuration = configOf( config ); StoreFactory storeFactory = new StoreFactory( testDirectory.databaseLayout(), configuration, idGeneratorFactory.apply( fs ), pageCache, fs, format, NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ); return neoStores = stores.length == 0 ? storeFactory.openAllNeoStores( true ) : storeFactory.openNeoStores( true, stores ); }
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 ); }
@Override public Statement apply( Statement base, Description description ) { if ( chain == null ) { if ( fs == null ) { fs = new EphemeralFileSystemRule(); } this.pageCacheRule = new PageCacheRule( pageCacheConfig ); this.directory = TestDirectory.testDirectory( clazz, fs ); this.chain = RuleChain.outerRule( fs ).around( directory ).around( pageCacheRule ); } return chain.apply( base, description ); }
public EmbeddedDatabaseRule() { this.testDirectory = TestDirectory.testDirectory(); }
public Neo4jWithSocket( Class<?> testClass, TestGraphDatabaseFactory graphDatabaseFactory, Supplier<FileSystemAbstraction> fileSystemProvider, Consumer<Map<String,String>> configure ) { this.testDirectory = TestDirectory.testDirectory( testClass, fileSystemProvider.get() ); this.graphDatabaseFactory = graphDatabaseFactory; this.fileSystemProvider = fileSystemProvider; this.configure = configure; this.workingDirectory = defaultWorkingDirectory(); }