KickJava   Java API By Example, From Geeks To Geeks.

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


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 SOAPFaultValueTest extends SOAPFaultSubCodeTestCase {
20
21     public SOAPFaultValueTest(String JavaDoc testName) {
22         super(testName);
23     }
24
25     protected void setUp() throws Exception JavaDoc {
26         super.setUp();
27         soap12FaultValueInFaultSubCode = soap12Factory.createSOAPFaultValue(soap12FaultSubCodeInCode);
28     }
29
30     //SOAP 1.1 Fault Value Test (Programaticaly Created)
31
public void testSOAP11setText() {
32         soap11FaultValue.setText("This is only Test");
33         assertTrue("SOAP 1.1 Fault Value Test : - value text mismatch",soap11FaultValue.getText().equals("This is only Test"));
34     }
35
36     public void testSOAP11GetText() {
37         assertTrue("SOAP 1.1 Fault Value Test : - After creating Fault Value, it has a text",soap11FaultValue.getText().equals(""));
38         soap11FaultValue.setText("This is only Test");
39         assertFalse("SOAP 1.1 Fault Value Test : - After calling setText method, getText method returns null",soap11FaultValue.getText().equals(""));
40         assertTrue("SOAP 1.1 Fault Value Test : - value text mismatch",soap11FaultValue.getText().equals("This is only Test"));
41     }
42
43     //SOAP 1.2 Fault Value(In Fault Code) Test (Programaticaly Created)
44
public void testSOAP12setTextInFaultCode() {
45         soap12FaultValueInFaultCode.setText("This is only Test");
46         assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - value text mismatch",soap12FaultValueInFaultCode.getText().equals("This is only Test"));
47     }
48
49     public void testSOAP12GetTextInFaultCode() {
50         assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - After creating Fault Value, it has a text",soap12FaultValueInFaultCode.getText().equals(""));
51         soap12FaultValueInFaultCode.setText("This is only Test");
52         assertFalse("SOAP 1.2 Fault Value Test in Fault Code : - After calling setText method, getText method returns null",soap12FaultValueInFaultCode.getText().equals(""));
53         assertTrue("SOAP 1.2 Fault Value Test in Fault Code : - value text mismatch",soap12FaultValueInFaultCode.getText().equals("This is only Test"));
54     }
55
56     //SOAP 1.2 Fault Value(In Fault SubCode) Test (Programaticaly Created)
57
public void testSOAP12setTextInFaultSubCode() {
58         soap12FaultValueInFaultSubCode.setText("This is only Test");
59         assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCode.getText().equals("This is only Test"));
60     }
61
62     public void testSOAP12GetTextInFaultSubCode() {
63         assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - After creating Fault Value, it has a text",soap12FaultValueInFaultSubCode.getText().equals(""));
64         soap12FaultValueInFaultSubCode.setText("This is only Test");
65         assertFalse("SOAP 1.2 Fault Value Test in Fault SubCode : - After calling setText method, getText method returns null",soap12FaultValueInFaultSubCode.getText().equals(""));
66         assertTrue("SOAP 1.2 Fault Value Test in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCode.getText().equals("This is only Test"));
67     }
68
69     //SOAP 1.1 Fault Value Test (With Parser)
70
public void testSOAP11GetTextWithParser() {
71         assertTrue("SOAP 1.1 Fault Value Test with parser : - value text mismatch",soap11FaultValueWithParser.getText().equals("env:Sender"));
72     }
73
74     //SOAP 1.2 Fault Value(In Fault Code) Test (With Parser)
75
public void testSOAP12setTextWithParserInFaultCode() {
76         assertTrue("SOAP 1.2 Fault Value Test with parser in Fault Code : - value text mismatch",soap12FaultValueInFaultCodeWithParser.getText().equals("env:Sender"));
77     }
78
79     //SOAP 1.2 Fault Value(In Fault SubCode) Test (With Parser)
80
public void testSOAP12setTextWithParserInFaultSubCode() {
81         assertTrue("SOAP 1.2 Fault Value Test with parser in Fault SubCode : - value text mismatch",soap12FaultValueInFaultSubCodeWithParser.getText().equals("m:MessageTimeout In First SubCode"));
82     }
83 }
84
Popular Tags