use of org.neo4j.ogm.driver.Driver in project neo4j-ogm by neo4j.
the class DistanceComparisonBoltTest method init.
@BeforeClass
public static void init() {
assumeTrue(isBoltDriver());
Configuration ogmConfiguration = getBaseConfigurationBuilder().useNativeTypes().build();
Driver boltOgmDriver = new BoltDriver();
boltOgmDriver.configure(ogmConfiguration);
sessionFactory = new SessionFactory(boltOgmDriver, DatesBoltTest.class.getPackage().getName());
}
use of org.neo4j.ogm.driver.Driver in project neo4j-ogm by neo4j.
the class DriverServiceTest method shouldLoadEmbeddedDriver.
@Test
public void shouldLoadEmbeddedDriver() {
Configuration driverConfiguration = new Configuration.Builder().uri(TMP_NEO4J_DB.toUri().toString()).build();
SessionFactory sf = new SessionFactory(driverConfiguration, "org.neo4j.ogm.domain.social.User");
Driver driver = sf.unwrap(Driver.class);
assertThat(driver).isNotNull();
driver.close();
sf.close();
}
use of org.neo4j.ogm.driver.Driver in project neo4j-ogm by neo4j.
the class DriverServiceTest method shouldLoadHttpDriver.
@Test
public void shouldLoadHttpDriver() {
Configuration driverConfiguration = new Configuration.Builder().uri("http://neo4j:password@localhost:7474").build();
SessionFactory sf = new SessionFactory(driverConfiguration, "org.neo4j.ogm.domain.social.User");
Driver driver = sf.unwrap(Driver.class);
assertThat(driver).isNotNull();
sf.close();
}
use of org.neo4j.ogm.driver.Driver in project neo4j-ogm by neo4j.
the class CypherModificationSPITest method driverShouldProvideNoopModificationWithoutAnyProvider.
@Test
public void driverShouldProvideNoopModificationWithoutAnyProvider() {
Driver driver = new TestDriver();
driver.configure(new Configuration.Builder().build());
Function<String, String> cypherModification = driver.getCypherModification();
String cypher = "MATCH (n) RETURN n";
assertThat(cypherModification.apply(cypher)).isEqualTo(cypher);
}
use of org.neo4j.ogm.driver.Driver in project neo4j-ogm by neo4j.
the class CypherModificationSPITest method abstractDriverShouldLoadCypherModificationsInCorrectOrder.
@Test
public void abstractDriverShouldLoadCypherModificationsInCorrectOrder() {
Thread currentThread = Thread.currentThread();
ClassLoader originalClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(new TestServiceLoaderClassLoader(originalClassLoader));
Configuration driverConfiguration = new Configuration.Builder().withCustomProperty("config1", 6).withCustomProperty("config2", 9).build();
Driver driver = new TestDriver();
driver.configure(driverConfiguration);
try {
Function<String, String> cypherModification = driver.getCypherModification();
assertThat(cypherModification.apply("What do you get if you multiply six by nine?")).isEqualTo("42");
} finally {
currentThread.setContextClassLoader(originalClassLoader);
}
}
Aggregations