Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ subprojects {
archiveClassifier = 'javadoc'
}
test {
//exclude '**/CypherProceduresClusterTest.class'//, '**/AtomicTest.class'
include '**/GexfTest.class'//, '**/AtomicTest.class'

// neo4jDockerImage system property is used in TestContainerUtil
systemProperties 'user.language' : 'en' ,
Expand Down
40 changes: 38 additions & 2 deletions extended/src/test/java/apoc/load/GexfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static apoc.ApocConfig.APOC_IMPORT_FILE_ENABLED;
import static apoc.ApocConfig.APOC_IMPORT_FILE_USE_NEO4J_CONFIG;
import static apoc.ApocConfig.apocConfig;
import static apoc.util.ExtendedTestUtil.assertMapEquals;
import static apoc.util.ExtendedTestUtil.assertRelationship;
import static apoc.util.GexfTestUtil.testImportGexfCommon;
import static apoc.util.MapUtil.map;
Expand All @@ -41,15 +42,50 @@ public void tearDown() {

@Test
public void testLoadGexf() {
Map<String, Object> expected = map(
"_type", "gexf",
"version", "1.2",
"_children", List.of(
map(
"_type", "graph",
"defaultedgetype", "directed",
"_children", List.of(
map(
"_type", "nodes",
"_children", List.of(
map(
"_type", "node",
"id", "0", // Nota: potrebbe essere Integer 0 a seconda del parser
"label", "bar",
"_children", List.of(
map(
"_type", "attvalues",
"_children", List.of(
map(
"_type", "attvalue",
"for", "0",
"value", "http://gephi.org"
)
)
)
)
)
)
)
)
)
)
);


final String file = ClassLoader.getSystemResource("gexf/single-node.gexf").toString();
testCall(
db,
"CALL apoc.load.gexf($file)",
Map.of("file", file),
(row) -> {
Map<String, Object> value = (Map) row.get("value");
String expected = "{_type=gexf, _children=[{_type=graph, defaultedgetype=directed, _children=[{_type=nodes, _children=[{_type=node, _children=[{_type=attvalues, _children=[{_type=attvalue, for=0, value=http://gephi.org}]}], id=0, label=bar}]}]}], version=1.2}";
assertEquals(expected, value.toString());
assertMapEquals(expected, value);
});
}

Expand Down
Loading