@Override public Statement apply( Statement base, Description description ) { return testDirectory.apply( super.apply( base, description ), description ); }
@Override public Statement apply( final Statement statement, final Description description ) { Statement testMethod = new Statement() { @Override public void evaluate() throws Throwable { // If this is used as class rule then getMethodName() returns null, so use // getClassName() instead. String name = description.getMethodName() != null ? description.getMethodName() : description.getClassName(); workingDirectory = testDirectory.directory( name ); ensureDatabase( settings -> {} ); try { statement.evaluate(); } finally { shutdownDatabase(); } } }; Statement testMethodWithBeforeAndAfter = super.apply( testMethod, description ); return testDirectory.apply( testMethodWithBeforeAndAfter, description ); }
@Override public Statement apply( Statement base, Description description ) { return fs.apply( testDirectory.apply( pageCacheRule.apply( lifeStatement( base, description ), description ), description ), description ); }
return super.apply( directory.apply( new Statement()
@Override public Statement apply( Statement base, Description description ) { return testDirectory.apply( super.apply( base, description ), description ); }
@Override public Statement apply( final Statement statement, final Description description ) { Statement testMethod = new Statement() { @Override public void evaluate() throws Throwable { // If this is used as class rule then getMethodName() returns null, so use // getClassName() instead. String name = description.getMethodName() != null ? description.getMethodName() : description.getClassName(); workingDirectory = testDirectory.directory( name ); ensureDatabase( settings -> {} ); try { statement.evaluate(); } finally { shutdownDatabase(); } } }; Statement testMethodWithBeforeAndAfter = super.apply( testMethod, description ); return testDirectory.apply( testMethodWithBeforeAndAfter, description ); }