KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > soap > SOAPFaultNodeTest


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.axis2.soap;
18
19 public class SOAPFaultNodeTest extends SOAPFaultTestCase {
20     protected SOAPFaultNode soap11FaultNode;
21     protected SOAPFaultNode soap12FaultNode;
22     protected SOAPFaultNode soap12FaultNodeWithParser;
23
24     public SOAPFaultNodeTest(String JavaDoc testName) {
25         super(testName);
26     }
27
28     protected void setUp() throws Exception JavaDoc {
29         super.setUp();
30         soap11FaultNode = soap11Factory.createSOAPFaultNode(soap11Fault);
31         soap12FaultNode = soap12Factory.createSOAPFaultNode(soap12Fault);
32         soap12FaultNodeWithParser = soap12FaultWithParser.getNode();
33     }
34
35     //SOAP 1.1 Fault Node Test (Programaticaly Created)
36
public void testSOAP11SetNodeValue() {
37         soap11FaultNode.setNodeValue("This is only a test");
38         assertTrue("SOAP 1.1 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap11FaultNode.getNodeValue().equals("This is only a test"));
39     }
40
41     public void testSOAP11GetNodeValue() {
42         assertTrue("SOAP 1.1 Fault Node Test : - After creating SOAPFaultNode, it has a value",soap11FaultNode.getNodeValue().equals(""));
43         soap11FaultNode.setNodeValue("This is only a test");
44         assertTrue("SOAP 1.1 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap11FaultNode.getNodeValue().equals("This is only a test"));
45     }
46
47     //SOAP 1.2 Fault Node Test (Programaticaly Created)
48
public void testSOAP12SetNodeValue() {
49         soap12FaultNode.setNodeValue("This is only a test");
50         assertTrue("SOAP 1.2 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap12FaultNode.getNodeValue().equals("This is only a test"));
51     }
52
53     public void testSOAP12GetNodeValue() {
54         assertTrue("SOAP 1.2 Fault Node Test : - After creating SOAPFaultNode, it has a value",soap12FaultNode.getNodeValue().equals(""));
55         soap12FaultNode.setNodeValue("This is only a test");
56         assertTrue("SOAP 1.2 Fault Node Test : - After calling setNodeValue method, getNodeValue method returns incorrect value",soap12FaultNode.getNodeValue().equals("This is only a test"));
57     }
58
59     //SOAP 1.2 Fault Node Test (With Parser)
60
public void testSOAP12GetNodeValueWithParser() {
61         assertTrue("SOAP 1.2 Fault Node Test With Parser : - getNodeValue method returns incorrect value",soap12FaultNodeWithParser.getNodeValue().equals("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"));
62     }
63 }
64
Popular Tags