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

Examples of org.hibernate.ogm.datastore.neo4j.impl.EmbeddedGraphDatabaseFactory.initialize()


  public void testLoadPropertiesFromUrl() throws Exception {
    EmbeddedGraphDatabaseFactory factory = new EmbeddedGraphDatabaseFactory();
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, dbLocation );
    properties.put( Neo4jProperties.CONFIGURATION_RESOURCE_NAME, neo4jPropertiesUrl().toExternalForm() );
    factory.initialize( properties );
    factory.create().shutdown();
  }

  @Test
  public void testLoadPropertiesFromFilePath() throws Exception {
View Full Code Here


  public void testLoadPropertiesFromFilePath() throws Exception {
    EmbeddedGraphDatabaseFactory factory = new EmbeddedGraphDatabaseFactory();
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, dbLocation );
    properties.put( Neo4jProperties.CONFIGURATION_RESOURCE_NAME, neo4jPropertiesUrl().getFile() );
    factory.initialize( properties );
    factory.create().shutdown();
  }

  @Test(expected = HibernateException.class)
  public void testLoadMalformedPropertiesLocation() throws Exception {
View Full Code Here

  public void testLoadMalformedPropertiesLocation() throws Exception {
    EmbeddedGraphDatabaseFactory factory = new EmbeddedGraphDatabaseFactory();
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, dbLocation );
    properties.put( Neo4jProperties.CONFIGURATION_RESOURCE_NAME, "aKDJSAGFKJAFLASFlaLfsfaf" );
    factory.initialize( properties );
    factory.create().shutdown();
  }

  private URL neo4jPropertiesUrl() {
    return Thread.currentThread().getContextClassLoader().getClass().getResource( "/neo4j-embedded-test.properties" );
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.