Package net.sf.latexdraw.parsers.svg

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


  @Test
  public void testGetLength() {
    map.getAttributes().clear();
    assertEquals(0, map.getLength());
    map.getAttributes().add(new SVGAttr("", "", doc.createElement("elt"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(1, map.getLength());
    map.getAttributes().clear();
  }
View Full Code Here


  public void testGetNamedItem() {
    map.getAttributes().clear();
    assertNull(map.getNamedItem(null));
    assertNull(map.getNamedItem("")); //$NON-NLS-1$
    assertNull(map.getNamedItem("test")); //$NON-NLS-1$
    map.getAttributes().add(new SVGAttr("test", "", doc.createElement("elt"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertNull(map.getNamedItem(null));
    assertNull(map.getNamedItem("")); //$NON-NLS-1$
    assertNotNull(map.getNamedItem("test")); //$NON-NLS-1$
    map.getAttributes().clear();
  }
View Full Code Here

  }


  @Test
  public void testItem() {
    SVGAttr attr = new SVGAttr("test", "", doc.createElement("elt")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    map.getAttributes().clear();
    assertNull(map.item(0));
    assertNull(map.item(-1));
    assertNull(map.item(1));
View Full Code Here

  }


  @Test
  public void testRemoveNamedItem() {
    SVGAttr attr = new SVGAttr("test", "", doc.createElement("elt")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    map.getAttributes().clear();

    try {
      map.removeNamedItem(null);
View Full Code Here

  }


  @Test
  public void testSetNamedItem() {
    SVGAttr attr1 = new SVGAttr("test1", "v1", doc.createElement("elt1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    SVGAttr attr2 = new SVGAttr("test2", "v2", doc.createElement("elt2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    SVGAttr attr3 = new SVGAttr("test1", "v1b", doc.createElement("elt1b")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    map.getAttributes().clear();
    assertNull(map.setNamedItem(null));
    assertNull(map.setNamedItem(attr1));
    assertEquals(attr1, map.getNamedItem("test1")); //$NON-NLS-1$
View Full Code Here

      fail();
    }
    catch(DOMException e) { /* ok */ }

    try {
      node.appendChild(new SVGAttr("", "", node)); //$NON-NLS-1$ //$NON-NLS-2$
      fail();
    }
    catch(DOMException e) { /* ok */ }


View Full Code Here

  @SuppressWarnings("unused")
  @Test
  public void testConstructor() {
    try {
      new SVGAttr(null, null, null);
      fail();
    }
    catch(Exception e) { /* ok */ }

    try {
      new SVGAttr("", "", null); //$NON-NLS-1$ //$NON-NLS-2$
      fail();
    }
    catch(Exception e) { /* ok */ }

    try {
      new SVGAttr(null, "", node); //$NON-NLS-1$
      fail();
    }
    catch(Exception e) { /* ok */ }

    try {
      new SVGAttr("", null, node); //$NON-NLS-1$
      fail();
    }
    catch(Exception e) { /* ok */ }

    new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

  }


  @Test
  public void testGetName() {
    SVGAttr attr = new SVGAttr("attrName", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals("attrName", attr.getName()); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testGetElementOwner() {
    SVGAttr attr = new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(node, attr.getOwnerElement());
  }
View Full Code Here



  @Test
  public void testGetValue() {
    SVGAttr attr = new SVGAttr("", "attrValue", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals("attrValue", attr.getValue()); //$NON-NLS-1$
  }
View Full Code Here

TOP

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

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.