Search in sources :

Example 1 with TestDirectory

use of org.neo4j.test.rule.TestDirectory in project neo4j by neo4j.

the class GraphStoreFixture method apply.

@Override
public Statement apply(final Statement base, Description description) {
    final TestDirectory directory = TestDirectory.testDirectory(description.getTestClass());
    return super.apply(directory.apply(new Statement() {

        @Override
        public void evaluate() throws Throwable {
            GraphStoreFixture.this.directory = directory.graphDbDir();
            try {
                generateInitialData();
                start(GraphStoreFixture.this.directory);
                try {
                    base.evaluate();
                } finally {
                    stop();
                }
            } finally {
                GraphStoreFixture.this.directory = null;
            }
        }
    }, description), description);
}
Also used : TestDirectory(org.neo4j.test.rule.TestDirectory) Statement(org.junit.runners.model.Statement)

Aggregations

Statement (org.junit.runners.model.Statement)1 TestDirectory (org.neo4j.test.rule.TestDirectory)1