KickJava   Java API By Example, From Geeks To Geeks.

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


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 SOAPFaultReasonTest extends SOAPFaultReasonTestCase {
20
21     public SOAPFaultReasonTest(String JavaDoc testName) {
22         super(testName);
23     }
24
25     protected void setUp() throws Exception JavaDoc {
26         super.setUp();
27     }
28
29     //SOAP 1.1 Fault Reason Test (Programaticaly Created)
30
public void testSOAP11SetSOAPText() {
31         soap11FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
32         assertFalse("SOAP 1.1 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap11FaultReason.getSOAPText() == null);
33         try {
34             soap11FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
35             fail("SOAP12FaultText should not be added to SOAP11FaultReason");
36
37         } catch (Exception JavaDoc e) {
38             assertTrue(true);
39         }
40     }
41
42     public void testSOAP11GetSOAPText() {
43         assertTrue("SOAP 1.1 FaultReason Test : - After creating SOAP11FaultReason, it has a SOAPFaultText",soap11FaultReason.getSOAPText()==null);
44         soap11FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
45         assertFalse("SOAP 1.1 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap11FaultReason.getSOAPText()==null);
46     }
47
48     //SOAP 1.2 Fault Reason Test (Programaticaly Created)
49
public void testSOAP12SetSOAPText() {
50         soap12FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
51         assertFalse("SOAP 1.2 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap12FaultReason.getSOAPText() == null);
52         try {
53             soap12FaultReason.setSOAPText(soap11Factory.createSOAPFaultText(soap11FaultReason));
54             fail("SOAP11FaultText should not be added to SOAP12FaultReason");
55         } catch (Exception JavaDoc e) {
56             assertTrue(true);
57         }
58     }
59
60     public void testSOAP12GetSOAPText() {
61         assertTrue("SOAP 1.2 FaultReason Test : - After creating SOAP12FaultReason, it has a SOAPFaultText",soap12FaultReason.getSOAPText()==null);
62         soap12FaultReason.setSOAPText(soap12Factory.createSOAPFaultText(soap12FaultReason));
63         assertFalse("SOAP 1.2 FaultReason Test : - After calling setSOAPText, getSOAPText returns null",soap12FaultReason.getSOAPText()==null);
64     }
65
66     //SOAP 1.1 Fault Reason Test (With Parser)
67
public void testSOAP11GetSOAPTextWithParser() {
68         assertFalse("SOAP 1.1 FaultReason Test With Parser : - getSOAPText method returns null",soap11FaultReasonWithParser.getSOAPText()==null);
69     }
70
71     //SOAP 1.2 Fault Reason Test (With Parser)
72
public void testSOAP12GetSOAPTextWithParser() {
73         assertFalse("SOAP 1.2 FaultReason Test With Parser : - getSOAPText method returns null",soap12FaultReasonWithParser.getSOAPText()==null);
74     }
75 }
76
Popular Tags