Search in sources :

Example 1 with LeaseManager

use of org.neo4j.server.rest.paging.LeaseManager in project neo4j by neo4j.

the class RestfulGraphDatabaseTest method doBefore.

@BeforeClass
public static void doBefore() throws IOException {
    graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
    database = new WrappedDatabase(graph);
    helper = new GraphDbHelper(database);
    output = new EntityOutputFormat(new JsonFormat(), URI.create(BASE_URI), null);
    service = new TransactionWrappingRestfulGraphDatabase(graph, new RestfulGraphDatabase(new JsonFormat(), output, new DatabaseActions(new LeaseManager(Clocks.fakeClock()), true, database.getGraph()), new ConfigAdapter(Config.embeddedDefaults())));
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) JsonFormat(org.neo4j.server.rest.repr.formats.JsonFormat) LeaseManager(org.neo4j.server.rest.paging.LeaseManager) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) WrappedDatabase(org.neo4j.server.database.WrappedDatabase) EntityOutputFormat(org.neo4j.test.server.EntityOutputFormat) BeforeClass(org.junit.BeforeClass)

Example 2 with LeaseManager

use of org.neo4j.server.rest.paging.LeaseManager in project neo4j by neo4j.

the class PagingTraversalTest method startDatabase.

@Before
public void startDatabase() throws IOException {
    graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
    database = new WrappedDatabase(graph);
    helper = new GraphDbHelper(database);
    EntityOutputFormat output = new EntityOutputFormat(new JsonFormat(), URI.create(BASE_URI), null);
    leaseManager = new LeaseManager(Clocks.fakeClock());
    service = new RestfulGraphDatabase(new JsonFormat(), output, new DatabaseActions(leaseManager, true, database.getGraph()), null);
    service = new TransactionWrappingRestfulGraphDatabase(graph, service);
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) JsonFormat(org.neo4j.server.rest.repr.formats.JsonFormat) LeaseManager(org.neo4j.server.rest.paging.LeaseManager) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) WrappedDatabase(org.neo4j.server.database.WrappedDatabase) EntityOutputFormat(org.neo4j.test.server.EntityOutputFormat) Before(org.junit.Before)

Example 3 with LeaseManager

use of org.neo4j.server.rest.paging.LeaseManager in project neo4j by neo4j.

the class DatabaseActionsTest method createDb.

@BeforeClass
public static void createDb() throws IOException {
    graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
    database = new WrappedDatabase(graph);
    graphdbHelper = new GraphDbHelper(database);
    actions = new TransactionWrappedDatabaseActions(new LeaseManager(Clocks.fakeClock()), database.getGraph());
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) LeaseManager(org.neo4j.server.rest.paging.LeaseManager) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) WrappedDatabase(org.neo4j.server.database.WrappedDatabase) BeforeClass(org.junit.BeforeClass)

Example 4 with LeaseManager

use of org.neo4j.server.rest.paging.LeaseManager in project neo4j by neo4j.

the class RestfulGraphDatabasePagedTraversalTest method startDatabase.

@Before
public void startDatabase() throws IOException {
    graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
    database = new WrappedDatabase(graph);
    helper = new GraphDbHelper(database);
    output = new EntityOutputFormat(new JsonFormat(), URI.create(BASE_URI), null);
    leaseManager = new LeaseManager(Clocks.fakeClock());
    service = new RestfulGraphDatabase(new JsonFormat(), output, new DatabaseActions(leaseManager, true, database.getGraph()), null);
    service = new TransactionWrappingRestfulGraphDatabase(graph, service);
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) JsonFormat(org.neo4j.server.rest.repr.formats.JsonFormat) LeaseManager(org.neo4j.server.rest.paging.LeaseManager) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) WrappedDatabase(org.neo4j.server.database.WrappedDatabase) EntityOutputFormat(org.neo4j.test.server.EntityOutputFormat) Before(org.junit.Before)

Aggregations

WrappedDatabase (org.neo4j.server.database.WrappedDatabase)4 GraphDbHelper (org.neo4j.server.rest.domain.GraphDbHelper)4 LeaseManager (org.neo4j.server.rest.paging.LeaseManager)4 TestGraphDatabaseFactory (org.neo4j.test.TestGraphDatabaseFactory)4 JsonFormat (org.neo4j.server.rest.repr.formats.JsonFormat)3 EntityOutputFormat (org.neo4j.test.server.EntityOutputFormat)3 Before (org.junit.Before)2 BeforeClass (org.junit.BeforeClass)2 ConfigAdapter (org.neo4j.server.plugins.ConfigAdapter)1