01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.saaj;
20:
21: import junit.framework.TestCase;
22:
23: import javax.xml.soap.MessageFactory;
24: import javax.xml.soap.Node;
25: import javax.xml.soap.SAAJResult;
26: import javax.xml.soap.SOAPBody;
27: import javax.xml.soap.SOAPEnvelope;
28: import javax.xml.soap.SOAPHeader;
29: import javax.xml.soap.SOAPHeaderElement;
30: import javax.xml.soap.SOAPMessage;
31: import javax.xml.soap.SOAPPart;
32:
33: /**
34: *
35: */
36: public class SAAJResultTest extends TestCase {
37: private SOAPMessage msg = null;
38: private SOAPPart sp = null;
39: private SOAPBody body = null;
40: private SOAPEnvelope envelope = null;
41: private SOAPHeader header = null;
42: private SOAPHeaderElement headerEle = null;
43:
44: protected void setUp() throws Exception {
45: msg = MessageFactory.newInstance().createMessage();
46: sp = msg.getSOAPPart();
47: envelope = sp.getEnvelope();
48: body = envelope.getBody();
49: header = envelope.getHeader();
50: headerEle = header.addHeaderElement(envelope.createName("foo",
51: "f", "foo-URI"));
52: headerEle.setActor("actor-URI");
53: }
54:
55: public void testGetResult() {
56: try {
57: SAAJResult sr = new SAAJResult();
58: Node node = sr.getResult();
59: assertNull(node);
60: } catch (Exception e) {
61: fail("Exception: " + e);
62: }
63: }
64: }
|