Package org.hibernate.ogm.datastore.neo4j.impl

Examples of org.hibernate.ogm.datastore.neo4j.impl.Neo4jGraphDatabaseServiceFactoryProvider.load()


  @Test
  public void testEmbeddedIsTheDefaultGraphDatabaseService() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( EmbeddedGraphDatabase.class );
  }

  @Test
View Full Code Here


  public void testSelectedGraphDatabaseServiceIsLoaded() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    properties.put( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, MockGraphServiceFactory.class.getName() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( MockGraphDatabaseService.class );
  }

  @Test
View Full Code Here

  public void testPropertiesArePassed() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    properties.put( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, MockGraphServiceFactory.class.getName() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    MockGraphDatabaseService db = (MockGraphDatabaseService) graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertTrue( "GraphDatabaseService factory cannot read the configuration properties", db.isConfigurationReadable() );
  }

  public static class MockGraphServiceFactory implements GraphDatabaseServiceFactory {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.