forked from neo4j/neo4j
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes neo4j#355 - Collections in collections are still Scala collecti…
…ons instead of Java collections
- Loading branch information
Showing
4 changed files
with
44 additions
and
8 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
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
42 changes: 42 additions & 0 deletions
42
community/cypher/src/test/java/org/neo4j/cypher/javacompat/JavaCompatibilityTest.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,42 @@ | ||
package org.neo4j.cypher.javacompat; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.neo4j.graphdb.GraphDatabaseService; | ||
import org.neo4j.graphdb.Transaction; | ||
import org.neo4j.test.TestGraphDatabaseFactory; | ||
|
||
public class JavaCompatibilityTest | ||
{ | ||
private GraphDatabaseService db; | ||
private ExecutionEngine engine; | ||
|
||
@Before | ||
public void setUp() throws IOException | ||
{ | ||
db = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase(); | ||
engine = new ExecutionEngine( db ); | ||
Transaction tx = db.beginTx(); | ||
|
||
tx.success(); | ||
tx.finish(); | ||
} | ||
|
||
@Test | ||
public void collections_in_collections_look_aiight() throws Exception | ||
{ | ||
ExecutionResult execute = engine.execute( "START n=node(0) RETURN [[ [1,2],[3,4] ],[[5,6]]] as x" ); | ||
Map<String, Object> next = execute.iterator().next(); | ||
List<List<Object>> x = (List<List<Object>>)next.get( "x" ); | ||
Object objects = x.get( 0 ); | ||
|
||
assertThat(objects, is(Iterable.class)); | ||
} | ||
} |
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