use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestLogPruning method newDb.
private GraphDatabaseAPI newDb(String logPruning, int rotateEveryNTransactions) {
this.rotateEveryNTransactions = rotateEveryNTransactions;
fs = new EphemeralFileSystemAbstraction();
TestGraphDatabaseFactory gdf = new TestGraphDatabaseFactory();
gdf.setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs));
GraphDatabaseBuilder builder = gdf.newImpermanentDatabaseBuilder();
builder.setConfig(keep_logical_logs, logPruning);
this.db = (GraphDatabaseAPI) builder.newGraphDatabase();
files = new PhysicalLogFiles(new File(db.getStoreDir()), PhysicalLogFile.DEFAULT_NAME, fs);
return db;
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class CountsComputerTest method setup.
@Before
public void setup() {
fs = fsRule.get();
dir = testDir.directory("dir").getAbsoluteFile();
dbBuilder = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).newImpermanentDatabaseBuilder(dir);
pageCache = pcRule.getPageCache(fs);
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class CountsRotationTest method setup.
@Before
public void setup() {
fs = fsRule.get();
dir = testDir.directory("dir").getAbsoluteFile();
dbBuilder = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs)).newImpermanentDatabaseBuilder(dir);
pageCache = pcRule.getPageCache(fs);
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class TestReadOnlyNeo4j method testSimple.
@Test
public void testSimple() {
DbRepresentation someData = createSomeData();
GraphDatabaseService readGraphDb = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fs.get())).newImpermanentDatabaseBuilder(PATH).setConfig(GraphDatabaseSettings.read_only, Settings.TRUE).newGraphDatabase();
assertEquals(someData, DbRepresentation.of(readGraphDb));
try (Transaction tx = readGraphDb.beginTx()) {
readGraphDb.createNode();
tx.success();
} catch (WriteOperationsNotAllowedException e) {
// good
}
readGraphDb.shutdown();
}
use of org.neo4j.graphdb.mockfs.UncloseableDelegatingFileSystemAbstraction in project neo4j by neo4j.
the class BatchingNeoStoresTest method someDataInTheDatabase.
private void someDataInTheDatabase() {
GraphDatabaseService db = new TestGraphDatabaseFactory().setFileSystem(new UncloseableDelegatingFileSystemAbstraction(fsr.get())).newImpermanentDatabase(storeDir);
try (Transaction tx = db.beginTx()) {
db.createNode().createRelationshipTo(db.createNode(), MyRelTypes.TEST);
tx.success();
} finally {
db.shutdown();
}
}
Aggregations