use of com.igormaznitsa.mindmap.model.MindMap in project netbeans-mmd-plugin by raydac.
the class Text2MindMapImporterTest method testDoImport_Multilevel.
@Test
public void testDoImport_Multilevel() throws Exception {
final MindMap result = INSTANCE.makeFromLines(asList("Solar system", "\tMercury", "\tVenus", "\tEarth", "\t\tMoon", "\tMars", "\t\tFobos", "\t\tDemos", "Jupiter"), null);
assertEquals("Solar system", result.getRoot().getText());
assertEquals(5, result.getRoot().getChildren().size());
final Topic mars = result.getRoot().getChildren().get(3);
final Topic jupiter = result.getRoot().getChildren().get(4);
assertEquals("Mars", mars.getText());
assertEquals(2, mars.getChildren().size());
assertEquals("Jupiter", jupiter.getText());
}
use of com.igormaznitsa.mindmap.model.MindMap in project netbeans-mmd-plugin by raydac.
the class Text2MindMapImporterTest method testDoImport_OnlyRoot.
@Test
public void testDoImport_OnlyRoot() throws Exception {
final MindMap result = INSTANCE.makeFromLines(asList("\tSolar system "), null);
assertEquals("Solar system", result.getRoot().getText());
}
use of com.igormaznitsa.mindmap.model.MindMap in project netbeans-mmd-plugin by raydac.
the class Text2MindMapImporterTest method testDoImport_Multilevel2.
@Test
public void testDoImport_Multilevel2() throws Exception {
final MindMap result = INSTANCE.makeFromLines(asList("solar system", "\tjupiter", "\tmars", " \t\tfobos", "\t\tdeimos", "\tpluto", "\tsaturn"), null);
assertEquals("solar system", result.getRoot().getText());
assertEquals(4, result.getRoot().getChildren().size());
final Topic root = result.getRoot();
assertEquals("jupiter", root.getChildren().get(0).getText());
assertEquals("mars", root.getChildren().get(1).getText());
assertEquals("pluto", root.getChildren().get(2).getText());
assertEquals("saturn", root.getChildren().get(3).getText());
final Topic mars = result.getRoot().getChildren().get(1);
assertEquals(2, mars.getChildren().size());
assertEquals("fobos", mars.getChildren().get(0).getText());
assertEquals("deimos", mars.getChildren().get(1).getText());
}
use of com.igormaznitsa.mindmap.model.MindMap in project netbeans-mmd-plugin by raydac.
the class Text2MindMapImporterTest method testImportFromFile.
@Test
public void testImportFromFile() throws Exception {
final File file = new File(Text2MindMapImporter.class.getResource("tabbedtext.txt").getFile());
assertTrue(file.isFile());
final List<String> lines = FileUtils.readLines(file, "UTF-8");
final MindMap result = INSTANCE.makeFromLines(lines, null);
assertEquals(5, result.getRoot().getChildren().size());
}
use of com.igormaznitsa.mindmap.model.MindMap in project netbeans-mmd-plugin by raydac.
the class Text2MindMapImporterTest method testDoImport_Empty.
@Test
public void testDoImport_Empty() throws Exception {
final MindMap result = INSTANCE.makeFromLines(asList(" "), null);
assertNull(result.getRoot());
}
Aggregations