Search in sources :

Example 1 with GraphDbHelper

use of org.neo4j.server.rest.domain.GraphDbHelper 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 GraphDbHelper

use of org.neo4j.server.rest.domain.GraphDbHelper 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 GraphDbHelper

use of org.neo4j.server.rest.domain.GraphDbHelper 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 GraphDbHelper

use of org.neo4j.server.rest.domain.GraphDbHelper in project neo4j by neo4j.

the class DatabaseActionsTest method nodeInDatabaseShouldBeRetrievable.

@Test
public void nodeInDatabaseShouldBeRetrievable() throws NodeNotFoundException {
    long nodeId = new GraphDbHelper(database).createNode();
    assertNotNull(actions.getNode(nodeId));
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) NodeRepresentationTest(org.neo4j.server.rest.repr.NodeRepresentationTest) RelationshipRepresentationTest(org.neo4j.server.rest.repr.RelationshipRepresentationTest) Test(org.junit.Test)

Example 5 with GraphDbHelper

use of org.neo4j.server.rest.domain.GraphDbHelper in project neo4j by neo4j.

the class SetRelationshipPropertiesIT method setupTheDatabase.

@Before
public void setupTheDatabase() throws Exception {
    long relationshipId = new GraphDbHelper(server().getDatabase()).createRelationship("KNOWS");
    propertiesUri = new URI(functionalTestHelper.relationshipPropertiesUri(relationshipId));
    badUri = new URI(functionalTestHelper.relationshipPropertiesUri(relationshipId + 1 * 99999));
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) URI(java.net.URI) Before(org.junit.Before)

Aggregations

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