@Override protected void before() { begin(); }
@Override protected void after() { success(); }
private GBPTree<RawBytes,RawBytes> createIndex( Layout<RawBytes,RawBytes> layout ) throws IOException { // some random padding PageCache pageCache = storage.pageCacheRule().getPageCache( storage.fileSystem(), config().withAccessChecks( true ) ); return new GBPTreeBuilder<>( pageCache, storage.directory().file( "index" ), layout ).build(); } }
private RecordStorageEngineRule.Builder recordStorageEngineBuilder() { return storageEngineRule .getWith( fsRule.get(), pageCacheRule.getPageCache( fsRule.get() ), testDirectory.databaseLayout() ) .databaseHealth( databaseHealth ); }
private File baseDir() { return rules.directory().absolutePath(); } }
public PageCache pageCache() { return pageCacheRule.getPageCache( fileSystem() ); }
@Override public Statement apply( Statement base, Description description ) { return fs.apply( testDirectory.apply( pageCacheRule.apply( lifeStatement( base, description ), description ), description ), description ); }
private long[] modificationData( int min, int max ) { int count = random.intBetween( min, max ); long[] data = new long[count * 2]; for ( int i = 0, c = 0; i < count; i++ ) { data[c++] = random.intBetween( 0, keyRange ); // key data[c++] = random.intBetween( 0, keyRange ); // value } return data; }
private Neo4jMatchers.Deferred<Label> labels( final Node myNode ) { return new Neo4jMatchers.Deferred<Label>( dbRule.getGraphDatabaseAPI() ) { @Override protected Iterable<Label> manifest() { return myNode.getLabels(); } }; } }
@Override protected void before() { create(); if ( startEagerly ) { ensureStarted(); } }
protected DatabaseRule createDatabaseRule() { return new EmbeddedDatabaseRule() .withSetting( GraphDatabaseSettings.transaction_monitor_check_interval, "100ms" ); }
/** * {@link DatabaseRule} now implements {@link GraphDatabaseAPI} directly, so no need. Also for ensuring * a lazily started database is created, use {@link #ensureStarted()} instead. */ public GraphDatabaseAPI getGraphDatabaseAPI() { ensureStarted(); return database; }
@Override protected RepeatRule createRepeatRule() { return new RepeatRule( false, 1 ); }
@Override protected void after( boolean success ) { closePageCache( "Failed to stop PageCache after test." ); closeJobScheduler( "Failed to stop job scheduler after test." ); }
@Override protected SuppressOutput createField( ExtensionContext extensionContext ) { return SuppressOutput.suppressAll(); }
@Override public EmbeddedDatabaseRule startLazily() { return (EmbeddedDatabaseRule) super.startLazily(); }
/** * @return new {@link PageCacheConfig} instance. */ public static PageCacheConfig config() { return new PageCacheConfig(); }