Search in sources :

Example 1 with BoltDriver

use of org.neo4j.ogm.drivers.bolt.driver.BoltDriver in project neo4j-ogm by neo4j.

the class GenericArrayConversionTest method startServer.

@BeforeClass
public static void startServer() {
    serverControls = Neo4jBuilders.newInProcessBuilder().build();
    Driver driver = GraphDatabase.driver(serverControls.boltURI(), Config.builder().withoutEncryption().build());
    supportsBytePacking = ServerVersion.version(driver).greaterThanOrEqual(ServerVersion.v3_4_0);
    sessionFactory = new SessionFactory(new BoltDriver(driver), DOMAIN_PACKAGE);
}
Also used : SessionFactory(org.neo4j.ogm.session.SessionFactory) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) Driver(org.neo4j.driver.Driver) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) BeforeClass(org.junit.BeforeClass)

Example 2 with BoltDriver

use of org.neo4j.ogm.drivers.bolt.driver.BoltDriver in project neo4j-ogm by neo4j.

the class BookmarkTest method setUp.

@Before
public void setUp() {
    BoltDriver driver = new BoltDriver(nativeDriver);
    session = new Neo4jSession(new MetaData("org.neo4j.ogm.empty"), true, driver);
}
Also used : BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) MetaData(org.neo4j.ogm.metadata.MetaData) Before(org.junit.Before)

Example 3 with BoltDriver

use of org.neo4j.ogm.drivers.bolt.driver.BoltDriver in project neo4j-ogm by neo4j.

the class ResponseMapperTest method shouldIgnoreResultsIfQueryMapsToVoid.

// GH-479
@Test
public void shouldIgnoreResultsIfQueryMapsToVoid() {
    SessionFactory sessionFactory = null;
    try (Driver driver = GraphDatabase.driver(boltURI, driverConfig)) {
        sessionFactory = new SessionFactory(new BoltDriver(driver), ResponseMapperTest.class.getName());
        Session session = sessionFactory.openSession();
        // The call would have been successfull if the procedure would have returned a stream of
        // things with at max 1 attribute, but in the end, that would be what was requested for.
        session.query("CALL apoc.periodic.iterate('MATCH (d:Document) RETURN d', " + " 'SET d.thisIsAProperty = 0'" + " ,{batchSize:200, parallel:false, iterateList:true}) ", new HashMap<>());
    } finally {
        if (sessionFactory != null) {
            sessionFactory.close();
        }
    }
}
Also used : SessionFactory(org.neo4j.ogm.session.SessionFactory) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) Driver(org.neo4j.driver.Driver) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) Session(org.neo4j.ogm.session.Session) Test(org.junit.Test)

Example 4 with BoltDriver

use of org.neo4j.ogm.drivers.bolt.driver.BoltDriver in project neo4j-ogm by neo4j.

the class SpatialBoltTest method init.

@BeforeClass
public static void init() {
    assumeTrue(isBoltDriver());
    Configuration ogmConfiguration = getBaseConfigurationBuilder().useNativeTypes().build();
    Driver driver = new BoltDriver();
    driver.configure(ogmConfiguration);
    sessionFactory = new SessionFactory(driver, SpatialBoltTest.class.getPackage().getName());
}
Also used : SessionFactory(org.neo4j.ogm.session.SessionFactory) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) Configuration(org.neo4j.ogm.config.Configuration) Driver(org.neo4j.ogm.driver.Driver) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) BeforeClass(org.junit.BeforeClass)

Example 5 with BoltDriver

use of org.neo4j.ogm.drivers.bolt.driver.BoltDriver 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());
}
Also used : SessionFactory(org.neo4j.ogm.session.SessionFactory) DatesBoltTest(org.neo4j.ogm.persistence.types.nativetypes.DatesBoltTest) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) Configuration(org.neo4j.ogm.config.Configuration) Driver(org.neo4j.ogm.driver.Driver) BoltDriver(org.neo4j.ogm.drivers.bolt.driver.BoltDriver) BeforeClass(org.junit.BeforeClass)

Aggregations

BoltDriver (org.neo4j.ogm.drivers.bolt.driver.BoltDriver)6 SessionFactory (org.neo4j.ogm.session.SessionFactory)5 BeforeClass (org.junit.BeforeClass)4 Configuration (org.neo4j.ogm.config.Configuration)3 Driver (org.neo4j.driver.Driver)2 Driver (org.neo4j.ogm.driver.Driver)2 Before (org.junit.Before)1 Test (org.junit.Test)1 MetaData (org.neo4j.ogm.metadata.MetaData)1 DatesBoltTest (org.neo4j.ogm.persistence.types.nativetypes.DatesBoltTest)1 Session (org.neo4j.ogm.session.Session)1