Search in sources :

Example 1 with Values

use of org.neo4j.driver.Values in project neo4j by neo4j.

the class SnapshotExecutionTest method testEntityVirtualTypes.

// Since most test work with primitives (storable values), this is a smoke test that
// entity types work as result of Snapshot EE
@Test
void testEntityVirtualTypes() {
    var query = joinAsLines("CREATE (n1:LABEL_1), (n2:LABEL_2)", "MERGE (n1) - [:TYPE_1] -> (n2)", "RETURN () - [] -> ()[0] AS p");
    Path p = driver.session().run(query).stream().map(r -> r.get("p")).findFirst().get().asPath();
    assertThat(p.start().labels()).containsExactly("LABEL_1");
    assertThat(p.end().labels()).containsExactly("LABEL_2");
}
Also used : Path(org.neo4j.driver.types.Path) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) BeforeEach(org.junit.jupiter.api.BeforeEach) Mode(org.neo4j.procedure.Mode) ConnectorPortRegister(org.neo4j.configuration.connectors.ConnectorPortRegister) Context(org.neo4j.procedure.Context) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Path(org.neo4j.driver.types.Path) Transaction(org.neo4j.driver.Transaction) GlobalProcedures(org.neo4j.kernel.api.procedure.GlobalProcedures) ExtensionCallback(org.neo4j.test.extension.ExtensionCallback) AfterAll(org.junit.jupiter.api.AfterAll) Value(org.neo4j.driver.Value) Values(org.neo4j.driver.Values) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) TestInstance(org.junit.jupiter.api.TestInstance) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) Inject(org.neo4j.test.extension.Inject) BeforeAll(org.junit.jupiter.api.BeforeAll) Map(java.util.Map) GraphDatabaseInternalSettings(org.neo4j.configuration.GraphDatabaseInternalSettings) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Strings.joinAsLines(org.neo4j.internal.helpers.Strings.joinAsLines) Procedure(org.neo4j.procedure.Procedure) TransientException(org.neo4j.driver.exceptions.TransientException) ClientException(org.neo4j.driver.exceptions.ClientException) Driver(org.neo4j.driver.Driver) SyntaxError(org.neo4j.kernel.api.exceptions.Status.Statement.SyntaxError) Executors(java.util.concurrent.Executors) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Test(org.junit.jupiter.api.Test) Flux(reactor.core.publisher.Flux) List(java.util.List) KernelException(org.neo4j.exceptions.KernelException) BoltDbmsExtension(org.neo4j.test.extension.BoltDbmsExtension) Name(org.neo4j.procedure.Name) ArithmeticError(org.neo4j.kernel.api.exceptions.Status.Statement.ArithmeticError) Test(org.junit.jupiter.api.Test)

Aggregations

List (java.util.List)1 Map (java.util.Map)1 Executors (java.util.concurrent.Executors)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 AfterAll (org.junit.jupiter.api.AfterAll)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 TestInstance (org.junit.jupiter.api.TestInstance)1 GraphDatabaseInternalSettings (org.neo4j.configuration.GraphDatabaseInternalSettings)1 ConnectorPortRegister (org.neo4j.configuration.connectors.ConnectorPortRegister)1 Driver (org.neo4j.driver.Driver)1 Transaction (org.neo4j.driver.Transaction)1 Value (org.neo4j.driver.Value)1 Values (org.neo4j.driver.Values)1 ClientException (org.neo4j.driver.exceptions.ClientException)1 TransientException (org.neo4j.driver.exceptions.TransientException)1 Path (org.neo4j.driver.types.Path)1