}
public void testAddTextNode2() {
try {
SOAPMessage msg = MessageFactory.newInstance().createMessage();
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
SOAPBody body = envelope.getBody();
Iterator iStart = envelope.getChildElements();
int countStart = getIteratorCount(iStart);
SOAPElement se = envelope.addTextNode("<txt>This is text</txt>");
if (se == null) {
fail("addTextNode() did not return SOAPElement");
} else if (!envelope.getValue().equals("<txt>This is text</txt>")) {
String s = body.getValue();
fail("addTextNode() did not return expected text, Returned " + s +
", Expected <txt>This is text</txt>");
}
Iterator i = envelope.getChildElements();
int count = getIteratorCount(i);
i = envelope.getChildElements();
if (count != ++countStart) {
fail("Wrong iterator count returned of " +
count + ", expected " + countStart);
} else {
Object obj = null;