-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#148 added support for untyped relations
- Loading branch information
1 parent
bc93805
commit 22f8985
Showing
4 changed files
with
61 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
neo4j/src/test/java/com/buschmais/xo/neo4j/test/mapping/UnmappedTypesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.buschmais.xo.neo4j.test.mapping; | ||
|
||
import com.buschmais.xo.api.CompositeObject; | ||
import com.buschmais.xo.api.XOManager; | ||
import com.buschmais.xo.api.bootstrap.XOUnit; | ||
import com.buschmais.xo.neo4j.test.AbstractNeo4jXOManagerTest; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.neo4j.graphdb.Node; | ||
|
||
import java.net.URISyntaxException; | ||
import java.util.Collection; | ||
|
||
import static com.buschmais.xo.api.Query.Result; | ||
import static com.buschmais.xo.api.Query.Result.CompositeRowObject; | ||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.junit.Assert.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class UnmappedTypesTest extends AbstractNeo4jXOManagerTest { | ||
|
||
public UnmappedTypesTest(XOUnit xoUnit) { | ||
super(xoUnit); | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> getXOUnits() throws URISyntaxException { | ||
return xoUnits(); | ||
} | ||
|
||
@Test | ||
public void query() { | ||
XOManager xoManager = getXoManager(); | ||
xoManager.currentTransaction().begin(); | ||
Result<CompositeRowObject> result = xoManager.createQuery("CREATE (x:X)-[y:Y]->(z:Z) RETURN x, y, z").execute(); | ||
CompositeRowObject compositeRowObject = result.getSingleResult(); | ||
CompositeObject x = compositeRowObject.get("x", CompositeObject.class); | ||
assertThat(x.getDelegate(), instanceOf(Node.class)); | ||
CompositeObject y = compositeRowObject.get("y", CompositeObject.class); | ||
assertThat(y.getDelegate(), instanceOf(Node.class)); | ||
CompositeObject z = compositeRowObject.get("z", CompositeObject.class); | ||
assertThat(z.getDelegate(), instanceOf(Node.class)); | ||
xoManager.currentTransaction().commit(); | ||
} | ||
|
||
} |
24 changes: 0 additions & 24 deletions
24
neo4j/src/test/java/com/buschmais/xo/neo4j/test/relation/unqualified/composite/A.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
neo4j/src/test/java/com/buschmais/xo/neo4j/test/relation/unqualified/composite/B.java
This file was deleted.
Oops, something went wrong.