Package net.sf.latexdraw.parsers.svg

Examples of net.sf.latexdraw.parsers.svg.SVGText


  }


  @Test
  public void testGetData() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    assertEquals("test", txt.getData()); //$NON-NLS-1$
    txt = createSVGText("", doc); //$NON-NLS-1$
    assertEquals("", txt.getData()); //$NON-NLS-1$
  }
View Full Code Here


  }


  @Test
  public void testGetLength() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    assertEquals("text".length(), txt.getLength()); //$NON-NLS-1$
    txt = createSVGText("", doc); //$NON-NLS-1$
    assertEquals("".length(), txt.getLength()); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testGetNodeType() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    assertEquals(Node.TEXT_NODE, txt.getNodeType());
  }
View Full Code Here

  }


  @Test
  public void testSetData() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    txt.setData(""); //$NON-NLS-1$
    assertEquals(txt.getData(), ""); //$NON-NLS-1$
    txt.setData("coucou"); //$NON-NLS-1$
    assertEquals(txt.getData(), "coucou"); //$NON-NLS-1$
  }
View Full Code Here

    assertEquals(txt.getData(), "coucou"); //$NON-NLS-1$
  }


  protected SVGText createSVGText(String txt, SVGDocument document) throws IllegalArgumentException {
    return new SVGText(txt, document);
  }
View Full Code Here

  }


  @Test
  public void testConstructors() {
    SVGText txt;

    try {
      txt = createSVGText(null, null);
      fail();
    }
    catch(Exception e) { /* ok */ }

    try {
      txt = createSVGText(null, doc);
      fail();
    }
    catch(Exception e) { /* ok */ }

    txt = createSVGText("a", null); //$NON-NLS-1$
    assertEquals("a", txt.getData()); //$NON-NLS-1$
    assertNull(txt.getOwnerDocument());

    txt = createSVGText("test", doc); //$NON-NLS-1$
    assertEquals("test", txt.getData()); //$NON-NLS-1$
    assertEquals(txt.getOwnerDocument(), doc);
  }
View Full Code Here

  }


  @Test
  public void testGetNodeValue() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    assertEquals("test", txt.getNodeValue()); //$NON-NLS-1$
    txt = createSVGText("", doc); //$NON-NLS-1$
    assertEquals("", txt.getNodeValue()); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testAppendData() {
    SVGText txt = createSVGText("test", doc); //$NON-NLS-1$
    txt.appendData(null);
    assertEquals("test", txt.getData()); //$NON-NLS-1$
    txt.appendData("coucou"); //$NON-NLS-1$
    assertEquals("testcoucou", txt.getData()); //$NON-NLS-1$
    txt.appendData(""); //$NON-NLS-1$
    assertEquals("testcoucou", txt.getData()); //$NON-NLS-1$
  }
View Full Code Here

      doc1.createTextNode(null);
      fail();
    }
    catch(DOMException e) { /* ok */ }

    SVGText elt = (SVGText)doc1.createTextNode("test"); //$NON-NLS-1$
    assertEquals(elt.getData(), "test"); //$NON-NLS-1$
    assertEquals(doc1, elt.getOwnerDocument());
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.parsers.svg.SVGText

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.