Package com.alexgilleran.icesoap.xml

Examples of com.alexgilleran.icesoap.xml.XMLAttribute


    getXMLObject().setType(type);

    // Now get the attributes
    Collection<XMLAttribute> attributes = getXMLObject().getAttributes();
    assertEquals(1, attributes.size());
    XMLAttribute typeAtt = attributes.iterator().next();

    // Ensure the attribute is correct
    assertEquals(type, typeAtt.getValue());
    assertEquals(XMLNode.NS_URI_XSI, typeAtt.getNamespace());
    assertEquals(typeName, typeAtt.getName());

    // Test the type is toStringing properly
    String asString = getXMLObject().toString();
    assertTrue(asString, asString.contains(XMLNode.NS_PREFIX_XSI + ":" + typeName + "=\"" + type + "\""));

    // Set the type again
    getXMLObject().setType(anotherType);

    // Get the type attribute again
    attributes = getXMLObject().getAttributes();
    assertEquals(1, attributes.size());
    typeAtt = attributes.iterator().next();

    // Ensure the attribute is still correct and has the new value
    assertEquals(anotherType, typeAtt.getValue());
    assertEquals(XMLNode.NS_URI_XSI, typeAtt.getNamespace());
    assertEquals(typeName, typeAtt.getName());

    asString = getXMLObject().toString();
    assertTrue(asString.contains(XMLNode.NS_PREFIX_XSI + ":" + typeName + "=\"" + anotherType + "\""));
  }
View Full Code Here

TOP

Related Classes of com.alexgilleran.icesoap.xml.XMLAttribute

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.