Package net.sf.latexdraw.parsers.svg

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


  }


  @Test
  public void testIsSameNode() {
    SVGAttr attr = new SVGAttr("n", "v", node); //$NON-NLS-1$ //$NON-NLS-2$
    SVGAttr attr2 = (SVGAttr)attr.cloneNode(false);

    assertTrue(attr.isSameNode(attr));
    assertFalse(attr.isSameNode(null));
    assertFalse(attr.isSameNode(attr2));
  }
View Full Code Here


  }


  @Test
  public void testSetNodeValue() {
    SVGAttr attr = new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$

    try {
      attr.setNodeValue(null);
      fail();
    }
    catch(DOMException e) { /* Ok */ }

    attr.setNodeValue("val"); //$NON-NLS-1$
    assertEquals("val", attr.getValue()); //$NON-NLS-1$
    assertEquals("val", attr.getNodeValue()); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testGetPrefix() {
    SVGAttr attr = new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$

    assertNull(attr.getPrefix());
    attr = new SVGAttr("pref:", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals("pref", attr.getPrefix()); //$NON-NLS-1$
    attr = new SVGAttr(":", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals("", attr.getPrefix()); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testGetNamespaceURI() {
    SVGAttr attr   = new SVGAttr("pref:n", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    SVGElement elt = (SVGElement)node.getOwnerDocument().createElement("tag2"); //$NON-NLS-1$

    assertNull(attr.getNamespaceURI());
    elt.setAttribute("xmlns:pref", "namespace"); //$NON-NLS-1$ //$NON-NLS-2$
    elt.appendChild(node);
    assertEquals(attr.getNamespaceURI(), "namespace"); //$NON-NLS-1$
  }
View Full Code Here

  }


  @Test
  public void testLookupNamespaceURI() {
    SVGAttr attr   = new SVGAttr("pref:n", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    SVGElement elt = (SVGElement)node.getOwnerDocument().createElement("tag2"); //$NON-NLS-1$

    assertNull(attr.getNamespaceURI());
    elt.setAttribute("xmlns:pref", "namespace"); //$NON-NLS-1$ //$NON-NLS-2$
    elt.appendChild(node);
    assertEquals(attr.getNamespaceURI(), "namespace"); //$NON-NLS-1$
  }
View Full Code Here

  }


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

  }


  @Test
  public void testUselessMethods() {
    SVGAttr attr = new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertNull(attr.removeChild(null));
    assertNull(attr.insertBefore(null, null));
    assertNull(attr.getAttributes());
    assertNull(attr.getFirstChild());
    assertNull(attr.getLastChild());
    assertNull(attr.appendChild(null));
  }
View Full Code Here

  }


  @Test
  public void testClone() {
    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$
    SVGNamedNodeMap map2;

    map.getAttributes().clear();
    assertNull(map.setNamedItem(attr1));
    assertNull(map.setNamedItem(attr2));
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.