You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2010/03/13 19:50:48 UTC
svn commit: r922648 [1/2] - in
/webservices/commons/trunk/modules/axiom/modules:
axiom-api/src/test/java/org/apache/axiom/om/
axiom-api/src/test/java/org/apache/axiom/soap/
axiom-api/src/test/resources/soap/
axiom-api/src/test/resources/soap/soap11/ ax...
Author: veithen
Date: Sat Mar 13 18:50:47 2010
New Revision: 922648
URL: http://svn.apache.org/viewvc?rev=922648&view=rev
Log:
Reworked some of the SOAP unit tests so that test cases that apply to all SOAP versions are coded only once.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap11/message.xml
- copied unchanged from r922538, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap11/soap11message.xml
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12/
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12/message.xml
- copied unchanged from r922538, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12message.xml
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java (with props)
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap11/soap11message.xml
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12message.xml
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPBodyTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPBodyTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAPFaultTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAPFaultTest.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPEnvelopeTestBase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFactoryTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestBase.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java Sat Mar 13 18:50:47 2010
@@ -53,7 +53,7 @@ public abstract class AbstractTestCase
"reallyReallyBigMessage.xml",
"sample1.xml",
"security2-soap.xml",
- "soap12message.xml",
+ "soap12/message.xml",
"soap12RoleMessage.xml",
"soapmessage.xml",
"soapmessage1.xml",
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestBase.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestBase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestBase.java Sat Mar 13 18:50:47 2010
@@ -21,117 +21,71 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.OMMetaFactory;
-public class SOAPBodyTestBase extends SOAPBodyTestCase {
-
- public SOAPBodyTestBase(OMMetaFactory omMetaFactory) {
- super(omMetaFactory);
- }
-
- //SOAP 1.1 Body Test (Programaticaly created)----------------------------------------------------------------------------------
- public void testSOAP11AddFault1() {
- soap11Body.addFault(new Exception("This an exception for testing"));
- assertTrue(
- "SOAP 1.1 Body Test:- After calling addFault method, SOAP body has no fault",
- soap11Body.hasFault());
-
- }
-
- public void testSOAP11addFault2() {
- soap11Body.addFault(soap11Factory.createSOAPFault(soap11Body));
- assertTrue(
- "SOAP 1.1 Body Test:- After calling addFault method, SOAP body has no fault",
- soap11Body.hasFault());
-
-
- }
-
- public void testSOAP11HasFault() {
- assertFalse(
- "SOAP 1.1 Body Test:- After creating a soap body it has a fault",
- soap11Body.hasFault());
- soap11Body.addFault(new Exception("This an exception for testing"));
- assertTrue(
- "SOAP 1.1 Body Test:- After calling addFault method, hasFault method returns false",
- soap11Body.hasFault());
+public class SOAPBodyTestBase extends UnifiedSOAPTestCase {
+ public SOAPBodyTestBase(OMMetaFactory omMetaFactory, String envelopeNamespaceURI) {
+ super(omMetaFactory, envelopeNamespaceURI);
}
- public void testSOAP11GetFault() {
+ // Body Test (Programaticaly created)----------------------------------------------------------------------------------
+ public void testAddFault1() {
+ SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+ SOAPBody body = soapFactory.createSOAPBody(envelope);
+ body.addFault(new Exception("This an exception for testing"));
assertTrue(
- "SOAP 1.1 Body Test:- After creating a soap body it has a fault",
- soap11Body.getFault() == null);
- soap11Body.addFault(new Exception("This an exception for testing"));
- assertFalse(
- "SOAP 1.1 Body Test:- After calling addFault method, getFault method returns null",
- soap11Body.getFault() == null);
- }
-
- //SOAP 1.2 Body Test (Programaticaly Created)----------------------------------------------------------------------------------
- public void testSOAP12AddFault1() {
- soap12Body.addFault(new Exception("This an exception for testing"));
- assertTrue(
- "SOAP 1.2 Body Test:- After calling addFault method, SOAP body has no fault",
- soap12Body.hasFault());
+ "Body Test:- After calling addFault method, SOAP body has no fault",
+ body.hasFault());
}
- public void testSOAP12AddFault2() {
- soap12Body.addFault(soap12Factory.createSOAPFault(soap12Body));
+ public void testAddFault2() {
+ SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+ SOAPBody body = soapFactory.createSOAPBody(envelope);
+ body.addFault(soapFactory.createSOAPFault(body));
assertTrue(
- "SOAP 1.2 Body Test:- After calling addFault method, SOAP body has no fault",
- soap12Body.hasFault());
+ "Body Test:- After calling addFault method, SOAP body has no fault",
+ body.hasFault());
}
- public void testSOAP12HasFault() {
+ public void testHasFault() {
+ SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+ SOAPBody body = soapFactory.createSOAPBody(envelope);
assertFalse(
- "SOAP 1.2 Body Test:- After creating a soap body it has a fault",
- soap12Body.hasFault());
- soap12Body.addFault(new Exception("This an exception for testing"));
+ "Body Test:- After creating a soap body it has a fault",
+ body.hasFault());
+ body.addFault(new Exception("This an exception for testing"));
assertTrue(
- "SOAP 1.2 Body Test:- After calling addFault method, hasFault method returns false",
- soap12Body.hasFault());
+ "Body Test:- After calling addFault method, hasFault method returns false",
+ body.hasFault());
}
- public void testSOAP12GetFault() {
+ public void testGetFault() {
+ SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+ SOAPBody body = soapFactory.createSOAPBody(envelope);
assertTrue(
- "SOAP 1.2 Body Test:- After creating a soap body it has a fault",
- soap12Body.getFault() == null);
- soap12Body.addFault(new Exception("This an exception for testing"));
+ "Body Test:- After creating a soap body it has a fault",
+ body.getFault() == null);
+ body.addFault(new Exception("This an exception for testing"));
assertFalse(
- "SOAP 1.2 Body Test:- After calling addFault method, getFault method returns null",
- soap12Body.getFault() == null);
- }
-
- //SOAP 1.1 Body Test (With Parser)-------------------------------------------------------------------------------------------
- public void testSOAP11HasFaultWithParser() {
- assertTrue(
- "SOAP 1.1 Body Test With parser :- hasFault method returns false",
- soap11BodyWithParser.hasFault());
- }
-
- public void testSOAP11GetFaultWithParser() {
- assertFalse(
- "SOAP 1.1 Body Test With parser :- getFault method returns null",
- soap11BodyWithParser.getFault() == null);
- assertTrue(
- "SOAP 1.1 Body Test With parser : - SOAP fault name mismatch",
- soap11BodyWithParser.getFault().getLocalName().equals(
- SOAPConstants.SOAPFAULT_LOCAL_NAME));
+ "Body Test:- After calling addFault method, getFault method returns null",
+ body.getFault() == null);
}
- //SOAP 1.2 Body Test (With Parser)-------------------------------------------------------------------------------------------------
- public void testSOAP12HasFaultWithParser() {
+ // Body Test (With Parser)-------------------------------------------------------------------------------------------
+ public void testHasFaultWithParser() {
+ SOAPBody body = getTestMessage(MESSAGE).getBody();
assertTrue(
- "SOAP 1.2 Body Test With parser :- hasFault method returns false",
- soap12BodyWithParser.hasFault());
+ "Body Test With parser :- hasFault method returns false",
+ body.hasFault());
}
- public void testSOAP12GetFaultWithParser() {
+ public void testGetFaultWithParser() {
+ SOAPBody body = getTestMessage(MESSAGE).getBody();
assertFalse(
- "SOAP 1.2 Body Test With parser :- getFault method returns null",
- soap12BodyWithParser.getFault() == null);
+ "Body Test With parser :- getFault method returns null",
+ body.getFault() == null);
assertTrue(
- "SOAP 1.2 Body Test With parser : - SOAP fault name mismatch",
- soap12BodyWithParser.getFault().getLocalName().equals(
+ "Body Test With parser : - SOAP fault name mismatch",
+ body.getFault().getLocalName().equals(
SOAPConstants.SOAPFAULT_LOCAL_NAME));
}
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPEnvelopeTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPEnvelopeTestBase.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPEnvelopeTestBase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPEnvelopeTestBase.java Sat Mar 13 18:50:47 2010
@@ -21,108 +21,58 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.OMMetaFactory;
-public class SOAPEnvelopeTestBase extends SOAPTestCase {
- protected SOAPEnvelope soap11Envelope;
- protected SOAPEnvelope soap12Envelope;
-
- public SOAPEnvelopeTestBase(OMMetaFactory omMetaFactory) {
- super(omMetaFactory);
- soap11Envelope = omMetaFactory.getSOAP11Factory().getDefaultEnvelope();
- soap12Envelope = omMetaFactory.getSOAP12Factory().getDefaultEnvelope();
+public class SOAPEnvelopeTestBase extends UnifiedSOAPTestCase {
+ public SOAPEnvelopeTestBase(OMMetaFactory omMetaFactory, String envelopeNamespaceURI) {
+ super(omMetaFactory, envelopeNamespaceURI);
}
- //SOAP 1.1 Envelope Test (Programaticaly Created)-----------------------------------------------
- public void testSOAP11GetHeader() {
- SOAPHeader header = soap11Envelope.getHeader();
- assertTrue("SOAP 1.1 Header Test : - Header local name mismatch",
+ // Envelope Test (Programaticaly Created)-----------------------------------------------
+ public void testGetHeader() {
+ SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
+ SOAPHeader header = envelope.getHeader();
+ assertTrue("Header Test : - Header local name mismatch",
header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
- assertTrue("SOAP 1.1 Header Test : - Header namespace mismatch",
+ assertTrue("Header Test : - Header namespace mismatch",
header.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ envelopeNamespaceURI));
}
- public void testSOAP11GetBody() {
- SOAPBody body = soap11Envelope.getBody();
- assertTrue("SOAP 1.1 Body Test : - Body local name mismatch",
+ public void testGetBody() {
+ SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
+ SOAPBody body = envelope.getBody();
+ assertTrue("Body Test : - Body local name mismatch",
body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
- assertTrue("SOAP 1.1 Body Test : - Body namespace mismatch",
+ assertTrue("Body Test : - Body namespace mismatch",
body.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ envelopeNamespaceURI));
}
- //SOAP 1.2 Envelope Test (Programaticaly Created)-------------------------------------------------
- public void testSOAP12GetHeader() {
- SOAPHeader header = soap12Envelope.getHeader();
- assertTrue("SOAP 1.2 Header Test : - Header local name mismatch",
+ // Envelope Test (With Parser)-----------------------------------------------------------------
+ public void testGetHeaderWithParser() {
+ SOAPEnvelope envelope = getTestMessage(MESSAGE);
+ SOAPHeader header = envelope.getHeader();
+ assertTrue("Header Test : - Header local name mismatch",
header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
- assertTrue("SOAP 1.2 Header Test : - Header namespace mismatch",
+ assertTrue("Header Test : - Header namespace mismatch",
header.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ envelopeNamespaceURI));
}
- public void testSOAP12GetBody() {
- SOAPBody body = soap12Envelope.getBody();
- assertTrue("SOAP 1.2 Body Test : - Body local name mismatch",
+ public void testGetBodyWithParser() {
+ SOAPEnvelope envelope = getTestMessage(MESSAGE);
+ SOAPBody body = envelope.getBody();
+ assertTrue("Body Test : - Body local name mismatch",
body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
- assertTrue("SOAP 1.2 Body Test : - Body namespace mismatch",
+ assertTrue("Body Test : - Body namespace mismatch",
body.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
- }
-
- //SOAP 1.1 Envelope Test (With Parser)-----------------------------------------------------------------
- public void testSOAP11GetHeaderWithParser() {
- SOAPHeader header = soap11EnvelopeWithParser.getHeader();
- assertTrue("SOAP 1.1 Header Test : - Header local name mismatch",
- header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
- assertTrue("SOAP 1.1 Header Test : - Header namespace mismatch",
- header.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
- }
-
- public void testSOAP11GetBodyWithParser() {
- SOAPBody body = soap11EnvelopeWithParser.getBody();
- assertTrue("SOAP 1.1 Body Test : - Body local name mismatch",
- body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
- assertTrue("SOAP 1.1 Body Test : - Body namespace mismatch",
- body.getNamespace().getNamespaceURI().equals(
- SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
- }
-
- //SOAP 1.2 Envelope Test (With Parser)--------------------------------------------------------------------
- public void testSOAP12GetHeaderWithParser() {
- SOAPHeader header = soap12EnvelopeWithParser.getHeader();
- assertTrue("SOAP 1.2 Header Test : - Header local name mismatch",
- header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
- assertTrue("SOAP 1.2 Header Test : - Header namespace mismatch",
- header.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
- }
-
- public void testSOAP12GetBodyWithParser() {
- SOAPBody body = soap12EnvelopeWithParser.getBody();
- assertTrue("SOAP 1.2 Body Test : - Body local name mismatch",
- body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
- assertTrue("SOAP 1.2 Body Test : - Body namespace mismatch",
- body.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
- }
-
- public void testRandomSOAPHeader() {
- SOAPFactory soapFac = omMetaFactory.getSOAP12Factory();
- SOAPEnvelope defaultEnvelope = soapFac.getDefaultEnvelope();
- defaultEnvelope.build();
- defaultEnvelope.getHeader().detach();
-
- soapFac.createSOAPHeader(defaultEnvelope);
-
+ envelopeNamespaceURI));
}
// Make sure order of header/body creation doesn't matter
public void testBodyHeaderOrder() throws Exception {
- SOAPFactory soapFac = omMetaFactory.getSOAP11Factory();
- SOAPEnvelope env = soapFac.createSOAPEnvelope();
- SOAPBody body = soapFac.createSOAPBody(env);
- SOAPHeader header = soapFac.createSOAPHeader(env);
+ SOAPEnvelope env = soapFactory.createSOAPEnvelope();
+ soapFactory.createSOAPBody(env);
+ soapFactory.createSOAPHeader(env);
assertTrue("Header isn't the first child!", env.getFirstElement() instanceof SOAPHeader);
}
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java Sat Mar 13 18:50:47 2010
@@ -39,8 +39,8 @@ public abstract class SOAPTestCase exten
protected SOAPEnvelope soap11EnvelopeWithParser;
protected SOAPEnvelope soap12EnvelopeWithParser;
- protected static final String SOAP11_FILE_NAME = "soap/soap11/soap11message.xml";
- protected static final String SOAP12_FILE_NAME = "soap/soap12message.xml";
+ protected static final String SOAP11_FILE_NAME = "soap/soap11/message.xml";
+ protected static final String SOAP12_FILE_NAME = "soap/soap12/message.xml";
public SOAPTestCase(OMMetaFactory omMetaFactory) {
this.omMetaFactory = omMetaFactory;
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axiom.om.AbstractTestCase;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+
+public class UnifiedSOAPTestCase extends AbstractTestCase {
+ protected static final String MESSAGE = "message.xml";
+
+ protected final OMMetaFactory omMetaFactory;
+ protected final String envelopeNamespaceURI;
+ protected SOAPFactory soapFactory;
+
+ public UnifiedSOAPTestCase(OMMetaFactory omMetaFactory, String envelopeNamespaceURI) {
+ this.omMetaFactory = omMetaFactory;
+ this.envelopeNamespaceURI = envelopeNamespaceURI;
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soapFactory = isSOAP11() ? omMetaFactory.getSOAP11Factory() : omMetaFactory.getSOAP12Factory();
+ }
+
+ protected boolean isSOAP11() {
+ return envelopeNamespaceURI.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ protected SOAPEnvelope getTestMessage(String name) {
+ String folder = isSOAP11() ? "soap11" : "soap12";
+ XMLStreamReader parser;
+ try {
+ parser = StAXUtils.createXMLStreamReader(getTestResource("soap/" + folder + "/" + name));
+ } catch (XMLStreamException ex) {
+ fail("Failed to get test message " + name + ": " + ex.getMessage());
+ return null;
+ }
+ return new StAXSOAPModelBuilder(parser, soapFactory, envelopeNamespaceURI).getSOAPEnvelope();
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/soap/UnifiedSOAPTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPBodyTestBase;
+
+public class SOAP11BodyTest extends SOAPBodyTestBase {
+ public SOAP11BodyTest() {
+ super(new OMDOMMetaFactory(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11BodyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPEnvelopeTestBase;
+
+public class SOAP11EnvelopeTest extends SOAPEnvelopeTestBase {
+ public SOAP11EnvelopeTest() {
+ super(new OMDOMMetaFactory(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11EnvelopeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBodyTestBase;
+
+public class SOAP12BodyTest extends SOAPBodyTestBase {
+ public SOAP12BodyTest() {
+ super(new OMDOMMetaFactory(), SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12BodyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelopeTestBase;
+
+public class SOAP12EnvelopeTest extends SOAPEnvelopeTestBase {
+ public SOAP12EnvelopeTest() {
+ super(new OMDOMMetaFactory(), SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12EnvelopeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPBodyTestBase;
+
+public class SOAP11BodyTest extends SOAPBodyTestBase {
+ public SOAP11BodyTest() {
+ super(new OMLinkedListMetaFactory(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11BodyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPEnvelopeTestBase;
+
+public class SOAP11EnvelopeTest extends SOAPEnvelopeTestBase {
+ public SOAP11EnvelopeTest() {
+ super(new OMLinkedListMetaFactory(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11EnvelopeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBodyTestBase;
+
+public class SOAP12BodyTest extends SOAPBodyTestBase {
+ public SOAP12BodyTest() {
+ super(new OMLinkedListMetaFactory(), SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12BodyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelopeTestBase;
+
+public class SOAP12EnvelopeTest extends SOAPEnvelopeTestBase {
+ public SOAP12EnvelopeTest() {
+ super(new OMLinkedListMetaFactory(), SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12EnvelopeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap;
+
+import org.apache.axiom.om.OMMetaFactory;
+
+public class SOAP11FaultTestBase extends SOAPFaultTestBase {
+ public SOAP11FaultTestBase(OMMetaFactory omMetaFactory) {
+ super(omMetaFactory, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME,
+ SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME,
+ SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME,
+ SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+ }
+
+ public void testSetNode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ try {
+ soapFault.setNode(soapFactory.createSOAPFaultNode(soapFault));
+ } catch (UnsupportedOperationException e) {
+ // Exactly!
+ return;
+ }
+ fail("Didn't get UnsupportedOperationException");
+ }
+
+ public void testGetNode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ // TODO: LLOM returns null while DOM throws UnsupportedOperationException
+ try {
+ assertTrue(
+ "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a node",
+ soapFault.getNode() == null);
+ } catch (UnsupportedOperationException ex) {
+ // This is also fine.
+ }
+ }
+
+}
\ No newline at end of file
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP11FaultTestBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMMetaFactory;
+
+public class SOAP12FaultTestBase extends SOAPFaultTestBase {
+ public SOAP12FaultTestBase(OMMetaFactory omMetaFactory) {
+ super(omMetaFactory, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME,
+ SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME,
+ SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME,
+ SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+ }
+
+ public void testSetNode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ soapFault.setNode(soapFactory.createSOAPFaultNode(soapFault));
+ assertFalse(
+ "SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node",
+ soapFault.getNode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch",
+ soapFault.getNode().getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ try {
+ soapFault.setNode(altSoapFactory.createSOAPFaultNode());
+ fail("SOAP11FaultNode should nott be set in to a SOAP12Fault");
+
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+ }
+
+ public void testGetNode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ assertTrue(
+ "SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a node",
+ soapFault.getNode() == null);
+ soapFault.setNode(soapFactory.createSOAPFaultNode(soapFault));
+ assertFalse(
+ "SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node",
+ soapFault.getNode() == null);
+ assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch",
+ soapFault.getNode().getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ }
+
+ public void testGetNodeWithParser() {
+ SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
+ assertFalse(
+ "SOAP 1.2 Fault Test with parser: - getNode method returns null",
+ soapFaultWithParser.getNode() == null);
+ assertTrue(
+ "SOAP 1.2 Fault Test with parser: - Fault node local name mismatch",
+ soapFaultWithParser.getNode().getLocalName().equals(
+ SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ }
+
+
+ public void testMoreChildrenAddition() {
+ try {
+ SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
+ SOAPEnvelope envelope = soapFactory.getDefaultFaultEnvelope();
+
+ assertNotNull("Default FaultEnvelope must have a SOAPFault in it",
+ envelope.getBody().getFault());
+ assertNotNull(
+ "Default FaultEnvelope must have a SOAPFaultCode in it",
+ envelope.getBody().getFault().getCode());
+ assertNotNull(
+ "Default FaultEnvelope must have a SOAPFaultCodeValue in it",
+ envelope.getBody().getFault().getCode().getValue());
+ assertNotNull(
+ "Default FaultEnvelope must have a SOAPFaultReason in it",
+ envelope.getBody().getFault().getReason());
+ assertNotNull(
+ "Default FaultEnvelope must have a SOAPFaultText in it",
+ envelope.getBody().getFault().getReason().getFirstSOAPText());
+
+ SOAPEnvelope soapEnvelope = soapFactory.getDefaultFaultEnvelope();
+ String errorCodeString = "Some Error occurred !!";
+ soapEnvelope.getBody().getFault().getCode().getValue().setText(
+ errorCodeString);
+
+ SOAPFaultCode code = soapEnvelope.getBody().getFault().getCode();
+ envelope.getBody().getFault().setCode(code);
+
+ assertTrue("Parent Value of Code has not been set to new fault",
+ code.getParent() == envelope.getBody().getFault());
+ assertTrue("Parent Value of Code is still pointing to old fault",
+ code.getParent() != soapEnvelope.getBody().getFault());
+ assertNull("Old fault must not have a fault code",
+ soapEnvelope.getBody().getFault().getCode());
+ assertEquals("The SOAP Code value must be " + errorCodeString,
+ errorCodeString,
+ envelope.getBody().getFault().getCode().getValue().getText());
+
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+}
\ No newline at end of file
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAP12FaultTestBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFactoryTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFactoryTest.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFactoryTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFactoryTest.java Sat Mar 13 18:50:47 2010
@@ -27,8 +27,8 @@ import org.apache.commons.logging.LogFac
public class SOAPFactoryTest extends AbstractTestCase {
- protected static final String SOAP11_FILE_NAME = "soap/soap11/soap11message.xml";
- protected static final String SOAP12_FILE_NAME = "soap/soap12message.xml";
+ protected static final String SOAP11_FILE_NAME = "soap/soap11/message.xml";
+ protected static final String SOAP12_FILE_NAME = "soap/soap12/message.xml";
private static Log log = LogFactory.getLog(SOAPFactoryTest.class);
public void testSOAPFactory() throws Exception {
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestBase.java?rev=922648&r1=922647&r2=922648&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestBase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTestBase.java Sat Mar 13 18:50:47 2010
@@ -19,394 +19,198 @@
package org.apache.axiom.soap;
-import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMMetaFactory;
-public class SOAPFaultTestBase extends SOAPFaultTestCase {
-
- public SOAPFaultTestBase(OMMetaFactory omMetaFactory) {
- super(omMetaFactory);
- }
-
- //SOAP 1.1 Fault Test (Programaticaly created)-----------------------------------------------------------------------------------
- public void testSOAP11SetCode() {
- soap11Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
+public class SOAPFaultTestBase extends UnifiedSOAPTestCase {
+ protected final String faultCodeLocalName;
+ protected final String faultReasonLocalName;
+ protected final String faultRoleLocalName;
+ protected final String faultDetailLocalName;
+ protected SOAPFactory altSoapFactory;
+
+ public SOAPFaultTestBase(OMMetaFactory omMetaFactory, String envelopeNamespaceURI,
+ String faultCodeLocalName, String faultReasonLocalName, String faultRoleLocalName,
+ String faultDetailLocalName) {
+ super(omMetaFactory, envelopeNamespaceURI);
+ this.faultCodeLocalName = faultCodeLocalName;
+ this.faultReasonLocalName = faultReasonLocalName;
+ this.faultRoleLocalName = faultRoleLocalName;
+ this.faultDetailLocalName = faultDetailLocalName;
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ altSoapFactory = isSOAP11() ? omMetaFactory.getSOAP12Factory() : omMetaFactory.getSOAP11Factory();
+ }
+
+ // Fault Test (Programaticaly created)-----------------------------------------------------------------------------------
+ public void testSetCode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ soapFault.setCode(soapFactory.createSOAPFaultCode(soapFault));
assertNotNull(
- "SOAP 1.1 Fault Test:- After calling setCode method, Fault has no code",
- soap11Fault.getCode());
+ "Fault Test:- After calling setCode method, Fault has no code",
+ soapFault.getCode());
+ assertTrue("Fault Test:- Code local name mismatch",
+ soapFault.getCode().getLocalName().equals(
+ faultCodeLocalName));
try {
- soap11Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
- fail("SOAP12FaultCode should not not be set in to a SOAP11Fault");
+ soapFault.setCode(altSoapFactory.createSOAPFaultCode());
+ fail("SOAPFaultCode should not be set in to a SOAPFault for a different SOAP version");
} catch (Exception e) {
+ // Expected
}
}
- public void testSOAP11GetCode() {
+ public void testGetCode() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
assertTrue(
- "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a code",
- soap11Fault.getCode() == null);
- soap11Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
- assertFalse(
- "SOAP 1.1 Fault Test:- After calling setCode method, Fault has no code",
- soap11Fault.getCode() == null);
- }
-
- public void testSOAP11SetReason() {
- soap11Fault.setReason(soap11Factory.createSOAPFaultReason(soap11Fault));
+ "Fault Test:- After creating a SOAPFault, it has a code",
+ soapFault.getCode() == null);
+ soapFault.setCode(soapFactory.createSOAPFaultCode(soapFault));
assertFalse(
- "SOAP 1.1 Fault Test:- After calling setReason method, Fault has no reason",
- soap11Fault.getReason() == null);
- try {
- soap11Fault.setReason(
- soap12Factory.createSOAPFaultReason(soap12Fault));
- fail("SOAP12FaultReason should not be set in to a SOAP11Fault");
-
- } catch (Exception e) {
- assertTrue(true);
- }
+ "Fault Test:- After calling setCode method, Fault has no code",
+ soapFault.getCode() == null);
+ assertTrue("Fault Test:- Fault code local name mismatch",
+ soapFault.getCode().getLocalName().equals(
+ faultCodeLocalName));
}
- public void testSOAP11GetReason() {
- assertTrue(
- "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a reason",
- soap11Fault.getReason() == null);
- soap11Fault.setReason(soap11Factory.createSOAPFaultReason(soap11Fault));
+ public void testSetReason() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ soapFault.setReason(soapFactory.createSOAPFaultReason(soapFault));
assertFalse(
- "SOAP 1.1 Fault Test:- After calling setReason method, Fault has no reason",
- soap11Fault.getReason() == null);
- }
-
- public void testSOAP11SetNode() {
- try {
- soap11Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
- } catch (UnsupportedOperationException e) {
- // Exactly!
- return;
- }
- fail("Didn't get UnsupportedOperationException");
- }
-
- public void testSOAP11GetNode() {
- // TODO: LLOM returns null while DOM throws UnsupportedOperationException
+ "Fault Test:- After calling setReason method, Fault has no reason",
+ soapFault.getReason() == null);
+ assertTrue("Fault Test:- Fault reason local name mismatch",
+ soapFault.getReason().getLocalName().equals(
+ faultReasonLocalName));
try {
- assertTrue(
- "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a node",
- soap11Fault.getNode() == null);
- } catch (UnsupportedOperationException ex) {
- // This is also fine.
- }
- }
+ soapFault.setReason(altSoapFactory.createSOAPFaultReason());
+ fail("SOAPFaultReason should not be set in to a SOAPFault for a different SOAP version");
- public void testSOAP11SetRole() {
- soap11Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
- assertFalse(
- "SOAP 1.1 Fault Test:- After calling setRole method, Fault has no role",
- soap11Fault.getRole() == null);
- try {
- soap11Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
- fail("SOAP12FaultRole should not be set in to a SOAP11Fault");
} catch (Exception e) {
assertTrue(true);
}
}
- public void testSOAP11GetRole() {
+ public void testGetReason() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
assertTrue(
- "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a role",
- soap11Fault.getRole() == null);
- soap11Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
+ "Fault Test:- After creating a SOAPFault, it has a reason",
+ soapFault.getReason() == null);
+ soapFault.setReason(soapFactory.createSOAPFaultReason(soapFault));
assertFalse(
- "SOAP 1.1 Fault Test:- After calling setRole method, Fault has no role",
- soap11Fault.getRole() == null);
+ "Fault Test:- After calling setReason method, Fault has no reason",
+ soapFault.getReason() == null);
+ assertTrue("Fault Test:- Fault reason local name mismatch",
+ soapFault.getReason().getLocalName().equals(
+ faultReasonLocalName));
}
- public void testSOAP11SetDetail() {
- soap11Fault.setDetail(soap11Factory.createSOAPFaultDetail(soap11Fault));
+ public void testSetRole() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ soapFault.setRole(soapFactory.createSOAPFaultRole(soapFault));
assertFalse(
- "SOAP 1.1 Fault Test:- After calling setDetail method, Fault has no detail",
- soap11Fault.getDetail() == null);
+ "Fault Test:- After calling setRole method, Fault has no role",
+ soapFault.getRole() == null);
+ assertTrue("Fault Test:- Fault role local name mismatch",
+ soapFault.getRole().getLocalName().equals(
+ faultRoleLocalName));
try {
- soap11Fault.setDetail(
- soap12Factory.createSOAPFaultDetail(soap12Fault));
- fail("SOAP12FaultDetail should not be set in to a SOAP11Fault");
+ soapFault.setRole(altSoapFactory.createSOAPFaultRole());
+ fail("SOAPFaultRole should not be set in to a SOAPFault for a different SOAP version");
} catch (Exception e) {
assertTrue(true);
}
}
- public void testSOAP11GetDetail() {
+ public void testGetRole() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
assertTrue(
- "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a detail",
- soap11Fault.getDetail() == null);
- soap11Fault.setDetail(soap11Factory.createSOAPFaultDetail(soap11Fault));
+ "Fault Test:- After creating a SOAPFault, it has a role",
+ soapFault.getRole() == null);
+ soapFault.setRole(soapFactory.createSOAPFaultRole(soapFault));
assertFalse(
- "SOAP 1.1 Fault Test:- After calling setDetail method, Fault has no detail",
- soap11Fault.getDetail() == null);
+ "Fault Test:- After calling setRole method, Fault has no role",
+ soapFault.getRole() == null);
+ assertTrue("Fault Test:- Fault role local name mismatch",
+ soapFault.getRole().getLocalName().equals(
+ faultRoleLocalName));
}
- //SOAP 1.2 Fault Test ((Programaticaly created)--------------------------------------------------------------------------------
- public void testSOAP12SetCode() {
- soap12Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
+ public void testSetDetail() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
+ soapFault.setDetail(soapFactory.createSOAPFaultDetail(soapFault));
assertFalse(
- "SOAP 1.2 Fault Test:- After calling setCode method, Fault has no code",
- soap12Fault.getCode() == null);
- assertTrue("SOAP 1.2 Fault Test:- Code local name mismatch",
- soap12Fault.getCode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ "Fault Test:- After calling setDetail method, Fault has no detail",
+ soapFault.getDetail() == null);
+ assertTrue("Fault Test:- Fault detail local name mismatch",
+ soapFault.getDetail().getLocalName().equals(
+ faultDetailLocalName));
try {
- soap12Fault.setCode(soap11Factory.createSOAPFaultCode(soap11Fault));
- fail("SOAP11FaultCode should not be set in to a SOAP12Fault");
+ soapFault.setDetail(altSoapFactory.createSOAPFaultDetail());
+ fail("SOAPFaultDetail should not be set in to a SOAPFault for a different SOAP version");
} catch (Exception e) {
assertTrue(true);
}
}
- public void testSOAP12GetCode() {
+ public void testGetDetail() {
+ SOAPFault soapFault = soapFactory.createSOAPFault();
assertTrue(
- "SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a code",
- soap12Fault.getCode() == null);
- soap12Fault.setCode(soap12Factory.createSOAPFaultCode(soap12Fault));
+ "Fault Test:- After creating a SOAPFault, it has a detail",
+ soapFault.getDetail() == null);
+ soapFault.setDetail(soapFactory.createSOAPFaultDetail(soapFault));
assertFalse(
- "SOAP 1.2 Fault Test:- After calling setCode method, Fault has no code",
- soap12Fault.getCode() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault code local name mismatch",
- soap12Fault.getCode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
+ "Fault Test:- After calling setDetail method, Fault has no detail",
+ soapFault.getDetail() == null);
+ assertTrue("Fault Test:- Fault detail local name mismatch",
+ soapFault.getDetail().getLocalName().equals(
+ faultDetailLocalName));
}
- public void testSOAP12SetReason() {
- soap12Fault.setReason(soap12Factory.createSOAPFaultReason(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setReason method, Fault has no reason",
- soap12Fault.getReason() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault reason local name mismatch",
- soap12Fault.getReason().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
- try {
- soap12Fault.setReason(
- soap11Factory.createSOAPFaultReason(soap11Fault));
- fail("SOAP11FaultReason should not be set in to a SOAP12Fault");
-
- } catch (Exception e) {
- assertTrue(true);
- }
- }
-
- public void testSOAP12GetReason() {
- assertTrue(
- "SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a reason",
- soap12Fault.getReason() == null);
- soap12Fault.setReason(soap12Factory.createSOAPFaultReason(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setReason method, Fault has no reason",
- soap12Fault.getReason() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault reason local name mismatch",
- soap12Fault.getReason().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
- }
-
- public void testSOAP12SetNode() {
- soap12Fault.setNode(soap12Factory.createSOAPFaultNode(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node",
- soap12Fault.getNode() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch",
- soap12Fault.getNode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
- try {
- soap12Fault.setNode(soap11Factory.createSOAPFaultNode(soap11Fault));
- fail("SOAP11FaultNode should nott be set in to a SOAP12Fault");
-
- } catch (Exception e) {
- assertTrue(true);
- }
- }
-
- public void testSOAP12GetNode() {
- assertTrue(
- "SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a node",
- soap12Fault.getNode() == null);
- soap12Fault.setNode(soap12Factory.createSOAPFaultNode(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setNode method, Fault has no node",
- soap12Fault.getNode() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault node local name mismatch",
- soap12Fault.getNode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
- }
-
- public void testSOAP12SetRole() {
- soap12Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
- assertFalse(
- "SOAP 1.2 :- After calling setRole method, Fault has no role",
- soap12Fault.getRole() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault role local name mismatch",
- soap12Fault.getRole().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
- try {
- soap12Fault.setRole(soap11Factory.createSOAPFaultRole(soap11Fault));
- fail("SOAP11FaultRole should not be set in to a SOAP12Fault");
- } catch (Exception e) {
- assertTrue(true);
- }
- }
-
- public void testSOAP12GetRole() {
- assertTrue(
- "SOAP 1.2 Fault Test:- After creating a SOAP11Fault, it has a role",
- soap12Fault.getRole() == null);
- soap12Fault.setRole(soap12Factory.createSOAPFaultRole(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setRole method, Fault has no role",
- soap12Fault.getRole() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault role local name mismatch",
- soap12Fault.getRole().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
- }
-
- public void testSOAP12SetDetail() {
- soap12Fault.setDetail(soap12Factory.createSOAPFaultDetail(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setDetaile method, Fault has no detail",
- soap12Fault.getDetail() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault detail local name mismatch",
- soap12Fault.getDetail().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
- try {
- soap12Fault.setDetail(
- soap11Factory.createSOAPFaultDetail(soap11Fault));
- fail("SOAP11FaultDetail should not be set in to a SOAP12Fault");
-
- } catch (Exception e) {
- assertTrue(true);
- }
- }
-
- public void testSOAP12GetDetail() {
- assertTrue(
- "SOAP 1.2 Fault Test:- After creating a SOAP12Fault, it has a detail",
- soap12Fault.getDetail() == null);
- soap12Fault.setDetail(soap12Factory.createSOAPFaultDetail(soap12Fault));
- assertFalse(
- "SOAP 1.2 Fault Test:- After calling setDetail method, Fault has no detail",
- soap12Fault.getDetail() == null);
- assertTrue("SOAP 1.2 Fault Test:- Fault detail local name mismatch",
- soap12Fault.getDetail().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
- }
-
- //SOAP 1.1 Fault Test (With parser)
- public void testSOAP11GetCodeWithParser() {
- assertFalse(
- "SOAP 1.1 Fault Test with parser: - getCode method returns null",
- soap11FaultWithParser.getCode() == null);
- }
-
- public void testSOAP11GetRoleWithParser() {
- assertFalse(
- "SOAP 1.1 Fault Test with parser: - getRole method returns null",
- soap11FaultWithParser.getRole() == null);
- }
-
- public void testSOAP11GetDetailWithParser() {
- assertNotNull(
- "SOAP 1.1 Fault Test with parser: - getDetail method returns null",
- soap11FaultWithParser.getDetail());
- }
-
- //SOAP 1.2 Fault Test (With parser)
- public void testSOAP12GetCodeWithParser() {
+ // Fault Test (With parser)
+ public void testGetCodeWithParser() {
+ SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
assertNotNull(
- "SOAP 1.2 Fault Test with parser: - getCode method returns null",
- soap12FaultWithParser.getCode());
- assertTrue(
- "SOAP 1.2 Fault Test with parser: - Fault code local name mismatch",
- soap12FaultWithParser.getCode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME));
- }
-
- public void testSOAP12GetReasonWithParser() {
- assertFalse(
- "SOAP 1.2 Fault Test with parser: - getReason method returns null",
- soap12FaultWithParser.getReason() == null);
+ "Fault Test with parser: - getCode method returns null",
+ soapFaultWithParser.getCode());
assertTrue(
- "SOAP 1.2 Fault Test with parser: - Fault reason local name mismatch",
- soap12FaultWithParser.getReason().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME));
+ "Fault Test with parser: - Fault code local name mismatch",
+ soapFaultWithParser.getCode().getLocalName().equals(
+ faultCodeLocalName));
}
- public void testSOAP12GetNodeWithParser() {
+ public void testGetReasonWithParser() {
+ SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
assertFalse(
- "SOAP 1.2 Fault Test with parser: - getNode method returns null",
- soap12FaultWithParser.getNode() == null);
+ "Fault Test with parser: - getReason method returns null",
+ soapFaultWithParser.getReason() == null);
assertTrue(
- "SOAP 1.2 Fault Test with parser: - Fault node local name mismatch",
- soap12FaultWithParser.getNode().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME));
+ "Fault Test with parser: - Fault reason local name mismatch",
+ soapFaultWithParser.getReason().getLocalName().equals(
+ faultReasonLocalName));
}
- public void testSOAP12GetRoleWithParser() {
+ public void testGetRoleWithParser() {
+ SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
assertFalse(
- "SOAP 1.2 Fault Test with parser: - getRole method returns null",
- soap12FaultWithParser.getRole() == null);
+ "Fault Test with parser: - getRole method returns null",
+ soapFaultWithParser.getRole() == null);
assertTrue(
- "SOAP 1.2 Fault Test with parser: - Fault role local name mismatch",
- soap12FaultWithParser.getRole().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME));
+ "Fault Test with parser: - Fault role local name mismatch",
+ soapFaultWithParser.getRole().getLocalName().equals(
+ faultRoleLocalName));
}
- public void testSOAP12GetDetailWithParser() {
- assertFalse(
- "SOAP 1.2 Fault Test with parser: - getDetail method returns null",
- soap12FaultWithParser.getDetail() == null);
+ public void testGetDetailWithParser() {
+ SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
+ assertNotNull(
+ "Fault Test with parser: - getDetail method returns null",
+ soapFaultWithParser.getDetail());
assertTrue(
- "SOAP 1.2 Fault Test with parser: - Fault detail local name mismatch",
- soap12FaultWithParser.getDetail().getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
- }
-
- public void testMoreChildrenAddition() {
- try {
- SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
- SOAPEnvelope envelope = soapFactory.getDefaultFaultEnvelope();
-
- assertNotNull("Default FaultEnvelope must have a SOAPFault in it",
- envelope.getBody().getFault());
- assertNotNull(
- "Default FaultEnvelope must have a SOAPFaultCode in it",
- envelope.getBody().getFault().getCode());
- assertNotNull(
- "Default FaultEnvelope must have a SOAPFaultCodeValue in it",
- envelope.getBody().getFault().getCode().getValue());
- assertNotNull(
- "Default FaultEnvelope must have a SOAPFaultReason in it",
- envelope.getBody().getFault().getReason());
- assertNotNull(
- "Default FaultEnvelope must have a SOAPFaultText in it",
- envelope.getBody().getFault().getReason().getFirstSOAPText());
-
- SOAPEnvelope soapEnvelope = soapFactory.getDefaultFaultEnvelope();
- String errorCodeString = "Some Error occurred !!";
- soapEnvelope.getBody().getFault().getCode().getValue().setText(
- errorCodeString);
-
- SOAPFaultCode code = soapEnvelope.getBody().getFault().getCode();
- envelope.getBody().getFault().setCode(code);
-
- assertTrue("Parent Value of Code has not been set to new fault",
- code.getParent() == envelope.getBody().getFault());
- assertTrue("Parent Value of Code is still pointing to old fault",
- code.getParent() != soapEnvelope.getBody().getFault());
- assertNull("Old fault must not have a fault code",
- soapEnvelope.getBody().getFault().getCode());
- assertEquals("The SOAP Code value must be " + errorCodeString,
- errorCodeString,
- envelope.getBody().getFault().getCode().getValue().getText());
-
- } catch (Exception e) {
- fail(e.getMessage());
- }
-
-
+ "Fault Test with parser: - Fault detail local name mismatch",
+ soapFaultWithParser.getDetail().getLocalName().equals(
+ faultDetailLocalName));
}
}
\ No newline at end of file
Added: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP11FaultTestBase;
+
+public class SOAP11FaultTest extends SOAP11FaultTestBase {
+ public SOAP11FaultTest() {
+ super(new OMDOMMetaFactory());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP11FaultTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.soap.SOAP12FaultTestBase;
+
+public class SOAP12FaultTest extends SOAP12FaultTestBase {
+ public SOAP12FaultTest() {
+ super(new OMDOMMetaFactory());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAP12FaultTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java?rev=922648&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java Sat Mar 13 18:50:47 2010
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.soap.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.soap.SOAP11FaultTestBase;
+
+public class SOAP11FaultTest extends SOAP11FaultTestBase {
+ public SOAP11FaultTest() {
+ super(new OMLinkedListMetaFactory());
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAP11FaultTest.java
------------------------------------------------------------------------------
svn:eol-style = native