-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement desc tag in GraphML import #2030
- Loading branch information
Showing
4 changed files
with
80 additions
and
4 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
22 changes: 22 additions & 0 deletions
22
modules/ImportPlugin/src/test/java/org/gephi/io/importer/plugin/file/GraphMLTest.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,22 @@ | ||
package org.gephi.io.importer.plugin.file; | ||
|
||
import org.gephi.io.importer.api.Container; | ||
import org.gephi.io.importer.impl.ImportContainerImpl; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class GraphMLTest { | ||
|
||
@Test | ||
public void testWithDescTag() { | ||
ImporterGraphML importer = new ImporterGraphML(); | ||
importer.setReader(Utils.getReader("withdesc.graphml")); | ||
|
||
Container container = new ImportContainerImpl(); | ||
importer.execute(container.getLoader()); | ||
Assert.assertTrue(container.verify()); | ||
|
||
Utils.assertSameLabels(Utils.toNodesArray(container), "Node Zero", "Node One"); | ||
Utils.assertSameLabels(Utils.toEdgesArray(container), "Edge Zero"); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
modules/ImportPlugin/src/test/resources/org/gephi/io/importer/plugin/file/withdesc.graphml
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns | ||
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> | ||
<graph edgedefault="directed"> | ||
<node id="n0"> | ||
<desc>Node Zero</desc> | ||
</node> | ||
<node id="n1"> | ||
<desc>Node One</desc> | ||
</node> | ||
<edge id="e0" source="n0" target="n1"> | ||
<desc>Edge Zero</desc> | ||
</edge> | ||
</graph> | ||
</graphml> |