Search in sources :

Example 11 with SVGAttr

use of net.sf.latexdraw.parsers.svg.SVGAttr in project latexdraw by arnobl.

the class TestSVGAttr method testLookupNamespaceURIOK.

@Test
public void testLookupNamespaceURIOK() {
    SVGAttr attr = new SVGAttr("pref:n", "", node);
    SVGElement elt = (SVGElement) node.getOwnerDocument().createElement("tag2");
    elt.setAttribute("xmlns:pref", "namespace");
    elt.appendChild(node);
    assertEquals("namespace", attr.lookupNamespaceURI("pref"));
}
Also used : SVGElement(net.sf.latexdraw.parsers.svg.SVGElement) SVGAttr(net.sf.latexdraw.parsers.svg.SVGAttr) Test(org.junit.Test)

Example 12 with SVGAttr

use of net.sf.latexdraw.parsers.svg.SVGAttr in project latexdraw by arnobl.

the class TestSVGAttr method testHasAttribute.

@Test
public void testHasAttribute() {
    SVGAttr attr = new SVGAttr("", "", node);
    assertFalse(attr.hasAttributes());
}
Also used : SVGAttr(net.sf.latexdraw.parsers.svg.SVGAttr) Test(org.junit.Test)

Example 13 with SVGAttr

use of net.sf.latexdraw.parsers.svg.SVGAttr in project latexdraw by arnobl.

the class TestSVGAttr method testGetElementOwner.

@Test
public void testGetElementOwner() {
    SVGAttr attr = new SVGAttr("", "", node);
    assertEquals(node, attr.getOwnerElement());
}
Also used : SVGAttr(net.sf.latexdraw.parsers.svg.SVGAttr) Test(org.junit.Test)

Example 14 with SVGAttr

use of net.sf.latexdraw.parsers.svg.SVGAttr in project latexdraw by arnobl.

the class TestSVGAttr method testGetNamespaceURIOK.

@Test
public void testGetNamespaceURIOK() {
    SVGAttr attr = new SVGAttr("pref:n", "", node);
    SVGElement elt = (SVGElement) node.getOwnerDocument().createElement("tag2");
    elt.setAttribute("xmlns:pref", "namespace");
    elt.appendChild(node);
    assertEquals("namespace", attr.getNamespaceURI());
}
Also used : SVGElement(net.sf.latexdraw.parsers.svg.SVGElement) SVGAttr(net.sf.latexdraw.parsers.svg.SVGAttr) Test(org.junit.Test)

Example 15 with SVGAttr

use of net.sf.latexdraw.parsers.svg.SVGAttr in project latexdraw by arnobl.

the class TestSVGAttr method testIsEqualNodeOK.

@Test
public void testIsEqualNodeOK() {
    SVGAttr attr = new SVGAttr("n", "v", node);
    SVGAttr attr2 = (SVGAttr) attr.cloneNode(false);
    assertTrue(attr.isEqualNode(attr2));
}
Also used : SVGAttr(net.sf.latexdraw.parsers.svg.SVGAttr) Test(org.junit.Test)

Aggregations

SVGAttr (net.sf.latexdraw.parsers.svg.SVGAttr)42 Test (org.junit.Test)42 SVGElement (net.sf.latexdraw.parsers.svg.SVGElement)2 SVGNamedNodeMap (net.sf.latexdraw.parsers.svg.SVGNamedNodeMap)1