KickJava   Java API By Example, From Geeks To Geeks.

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


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 SOAPFaultRoleTest extends SOAPFaultTestCase {
20
21     protected SOAPFaultRole soap11FaultRole;
22     protected SOAPFaultRole soap12FaultRole;
23     protected SOAPFaultRole soap11FaultRoleWithParser;
24     protected SOAPFaultRole soap12FaultRoleWithParser;
25
26     public SOAPFaultRoleTest(String JavaDoc testName) {
27         super(testName);
28     }
29
30     protected void setUp() throws Exception JavaDoc {
31         super.setUp();
32         soap11FaultRole = soap11Factory.createSOAPFaultRole(soap11Fault);
33         soap12FaultRole = soap12Factory.createSOAPFaultRole(soap12Fault);
34         soap11FaultRoleWithParser = soap11FaultWithParser.getRole();
35         soap12FaultRoleWithParser = soap12FaultWithParser.getRole();
36     }
37
38     //SOAP 1.1 Fault Role Test (Programaticaly Created)
39
public void testSOAP11SetRoleValue() {
40         soap11FaultRole.setRoleValue("This is only a test");
41         assertTrue("SOAP 1.1 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap11FaultRole.getRoleValue().equals("This is only a test"));
42     }
43
44     public void testSOAP11GetRoleValue() {
45         assertTrue("SOAP 1.1 Fault Role Test : - After creating SOAPFaultRole, it has a value",soap11FaultRole.getRoleValue().equals(""));
46         soap11FaultRole.setRoleValue("This is only a test");
47         assertTrue("SOAP 1.1 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap11FaultRole.getRoleValue().equals("This is only a test"));
48     }
49
50     //SOAP 1.2 Fault Role Test (Programaticaly Created)
51
public void testSOAP12SetRoleValue() {
52         soap12FaultRole.setRoleValue("This is only a test");
53         assertTrue("SOAP 1.2 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap12FaultRole.getRoleValue().equals("This is only a test"));
54     }
55
56     public void testSOAP12GetRoleValue() {
57         assertTrue("SOAP 1.2 Fault Role Test : - After creating SOAPFaultRole, it has a value",soap12FaultRole.getRoleValue().equals(""));
58         soap12FaultRole.setRoleValue("This is only a test");
59         assertTrue("SOAP 1.2 Fault Role Test : - After calling setRoleValue method, getRoleValue method returns incorrect value",soap12FaultRole.getRoleValue().equals("This is only a test"));
60     }
61
62     //SOAP 1.1 Fault Role Test (With Parser)
63
public void testSOAP11GetRoleValueWithParser() {
64         assertTrue("SOAP 1.1 Fault Role Test With Parser : - getRoleValue method returns incorrect value",soap11FaultRoleWithParser.getRoleValue().equals("http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver"));
65     }
66
67     //SOAP 1.2 Fault Role Test (With Parser)
68
public void testSOAP12GetRoleValueWithParser() {
69          assertTrue("SOAP 1.2 Fault Role Test With Parser : - getRoleValue method returns incorrect value",soap12FaultRoleWithParser.getRoleValue().equals("ultimateReceiver"));
70     }
71 }
72
Popular Tags