TestSOAPEnvelopepublic class TestSOAPEnvelope extends TestCase
Constructors Summary |
---|
public TestSOAPEnvelope(String name)
super(name);
|
Methods Summary |
---|
public static void | main(java.lang.String[] args)
TestSOAPEnvelope tester = new TestSOAPEnvelope("TestSOAPEnvelope");
tester.testNullpointer();
tester.testNullpointerInHeader();
| public void | testBody()
SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
SOAPBody b1 = env.getBody();
assertTrue("null initial body", b1 != null);
b1.detachNode();
assertTrue("body not freed", env.getBody() == null);
SOAPBody b2 = env.addBody();
assertTrue("null created body", b2 != null);
assertEquals("wrong body retrieved", b2, env.getBody());
assertEquals("body parent incorrect", env, b2.getParentElement());
try {
env.addBody();
assertTrue("second body added", false);
} catch (SOAPException e) {
}
| public void | testHeader()
SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
SOAPHeader h1 = env.getHeader();
assertTrue("null initial header", h1 != null);
h1.detachNode();
assertTrue("header not freed", env.getHeader() == null);
SOAPHeader h2 = env.addHeader();
assertTrue("null created header", h2 != null);
assertEquals("wrong header retrieved", h2, env.getHeader());
assertEquals("header parent incorrect", env, h2.getParentElement());
try {
env.addHeader();
assertTrue("second header added", false);
} catch (SOAPException e) {
}
| public void | testName()
SOAPEnvelope env = new org.apache.axis.message.SOAPEnvelope();
Name n = env.createName("local", "pref", "urn:blah");
assertEquals("local part of name did not match", "local",
n.getLocalName());
assertEquals("qname of name did not match", "pref:local",
n.getQualifiedName());
assertEquals("prefix of name did not match", "pref",
n.getPrefix());
assertEquals("uri of name did not match", "urn:blah",
n.getURI());
Name n2 = env.createName("loc");
assertEquals("local part of name2 did not match", "loc",
n2.getLocalName());
| public void | testNullpointer()
org.apache.axis.message.SOAPEnvelope env=new org.apache.axis.message.SOAPEnvelope();
SOAPBodyElement bdy=new SOAPBodyElement();
bdy.setName("testResponse");
env.addBodyElement(bdy);
Message msg=new Message(env);
SOAPBodyElement sbe = msg.getSOAPEnvelope().getBodyByName(null,"testResponse");
assertTrue(sbe != null);
| public void | testNullpointerInHeader()
org.apache.axis.message.SOAPEnvelope env=new org.apache.axis.message.SOAPEnvelope();
SOAPHeaderElement hdr=new SOAPHeaderElement("", "testHeader");
env.addHeader(hdr);
Message msg=new Message(env);
SOAPHeaderElement she = msg.getSOAPEnvelope().getHeaderByName(null,"testHeader");
assertTrue(she != null);
|
|