Package org.freeplane.plugin.script.proxy.Proxy

Examples of org.freeplane.plugin.script.proxy.Proxy.Node


  //  public void test_NodeRO_getExternalObject() {
  //   
  //  }
  public void test_NodeRO_getIcons() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertTrue("by default a node has no icons", root.getIcons().getIcons().isEmpty());
    root.getIcons().add("bee");
    assertEquals("one icon added", 1, root.getIcons().getIcons().size());
  }
View Full Code Here


    assertEquals("one icon added", 1, root.getIcons().getIcons().size());
  }

  public void test_NodeRO_getLink() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertEquals("by default a node has no links", null, root.getLink().getText());
    final String url = "file://blabla.txt";
    root.getLink().setText(url);
    assertEquals("a link should have been added", url, root.getLink().getText());
  }
View Full Code Here

    assertEquals("a link should have been added", url, root.getLink().getText());
  }

  public void test_NodeRO_getMap() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertEquals("???", map, root.getMap());
  }
View Full Code Here

    assertEquals("???", map, root.getMap());
  }

  public void test_NodeRO_getId() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertTrue("unknown node id pattern in '" + root.getId() + "'", root.getId().matches("ID_[1-9]\\d+"));
  }
View Full Code Here

  }
 
  @SuppressWarnings("deprecation")
    public void test_NodeRO_getNodeID() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertTrue("unknown node id pattern in '" + root.getNodeID() + "'", root.getNodeID().matches("ID_[1-9]\\d+"));
  }
View Full Code Here

  }

    public void test_NodeRO_getNodeLevel_boolean_countHidden() {
    createTestMap();
    assertEquals("root is level 0", 0, map.getRoot().getNodeLevel(true));
    final Node child = firstChild();
    assertEquals("children are at level 1", 1, child.getNodeLevel(false));
    final Node grandchild = child.createChild();
    assertEquals("grandchildren are at level 2", 2, grandchild.getNodeLevel(false));
    assertEquals("grandchildren are at level 2 - countHidden only matters if there are hidden nodes" //
        , 2, grandchild.getNodeLevel(true));
    // seems that the countHidden flag isn't testable here since it's not possible to filter nodes (and it
    // doesn't make sense to extent the API for that), right?
  }
View Full Code Here

    // doesn't make sense to extent the API for that), right?
  }

  public void test_NodeRO_getNote_getPlain(){
    map = c.newMap();
    final Node rootNode = map.getRoot();
    final String plainText = " xx\nx ";
    rootNode.setNote(plainText);
    assertEquals("", HtmlUtils.plainToHTML(plainText), rootNode.getNoteText());
    assertEquals("", HtmlUtils.plainToHTML(plainText), rootNode.getNote().getText());
    assertEquals("", plainText, rootNode.getNote().getPlain());
    final String xml = "<x> yyy </x>";
    rootNode.setNote(xml);
    assertEquals("", HtmlUtils.plainToHTML(xml), rootNode.getNoteText());
    // in Groovy also assert HtmlUtils.plainToHTML(" xxx ") == root.note would be OK
    assertEquals("", HtmlUtils.plainToHTML(xml), rootNode.getNote().getText());
    assertEquals("", xml, rootNode.getNote().getPlain());
    rootNode.setNote("<html> <em>zzzzz</em> </hmtl>");
    assertEquals("", "zzzzz", rootNode.getNote().getPlain());
  }
View Full Code Here

    assertEquals("", "zzzzz", rootNode.getNote().getPlain());
  }

  public void test_NodeRO_getNote() {
    map = c.newMap();
    final Node root = map.getRoot();
    root.setNote(" xxx ");
    // in Groovy also assert HtmlUtils.plainToHTML(" xxx ") == root.note would be OK
    assertEquals("", HtmlUtils.plainToHTML(" xxx "), root.getNote().getText());
    assertEquals("", HtmlUtils.plainToHTML(" xxx "), root.getNoteText());
    root.setNote(" x\nxx ");
    // in Groovy also assert HtmlUtils.plainToHTML(" xxx ") == root.note would be OK
    assertEquals("", HtmlUtils.plainToHTML(" x\nxx "), root.getNote().getText());
    assertEquals("", HtmlUtils.plainToHTML(" x\nxx "), root.getNoteText());
  }
View Full Code Here

    assertEquals("", HtmlUtils.plainToHTML(" x\nxx "), root.getNoteText());
  }

  public void test_NodeRO_getParent() {
    createTestMap();
    final Node root = map.getRoot();
    assertEquals("root has no parent", null, root.getParent());
    final Node child = firstChild(root);
    assertEquals("", root, child.getParent());
  }
View Full Code Here

  //   
  //  }
  //
  public void test_NodeRO_getPlainText() {
    map = c.newMap();
    final Node root = map.getRoot();
    final String plainText = " xxx ";
    root.setText(plainText);
    assertEquals("", plainText, root.getText());
    assertEquals("plain text should be kept untouched", plainText, root.getPlainText());
    final String xml = "<x> yyy </x>";
    root.setText(xml);
    assertEquals("xml tags are not stripped", xml, root.getPlainText());
    root.setText("<html> <em>zzzzz</em> </hmtl>");
    assertEquals("html tags should be stripped", "zzzzz", root.getPlainText());
  }
View Full Code Here

TOP

Related Classes of org.freeplane.plugin.script.proxy.Proxy.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.