You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/01/16 10:11:06 UTC
svn commit: r1059519 - in /webservices/commons/trunk/modules/axiom/modules:
axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/
axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/
axiom-testsuite/src/main/java/org/apache/axiom/ts/ axiom-testsui...
Author: veithen
Date: Sun Jan 16 09:11:06 2011
New Revision: 1059519
URL: http://svn.apache.org/viewvc?rev=1059519&view=rev
Log:
Recycled some existing unit test code to get a test for SOAPFactory#getDefaultFaultEnvelope().
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java?rev=1059519&r1=1059518&r2=1059519&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/SOAPImplementationTest.java Sun Jan 16 09:11:06 2011
@@ -23,12 +23,14 @@ import junit.framework.TestSuite;
import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
import org.apache.axiom.ts.SOAPTestSuiteBuilder;
+import org.apache.axiom.ts.soap.factory.TestGetDefaultFaultEnvelope;
import org.apache.axiom.ts.soap.faultdetail.TestWSCommons202;
public class SOAPImplementationTest extends TestCase {
public static TestSuite suite() {
SOAPTestSuiteBuilder builder = new SOAPTestSuiteBuilder(new OMDOMMetaFactory());
builder.exclude(TestWSCommons202.class);
+ builder.exclude(TestGetDefaultFaultEnvelope.class);
return builder.build();
}
}
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java?rev=1059519&r1=1059518&r2=1059519&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAP12FaultTest.java Sun Jan 16 09:11:06 2011
@@ -35,21 +35,6 @@ public class SOAP12FaultTest extends SOA
SOAPFactory soapFactory = omMetaFactory.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(
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java?rev=1059519&r1=1059518&r2=1059519&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/SOAPTestSuiteBuilder.java Sun Jan 16 09:11:06 2011
@@ -44,6 +44,7 @@ public class SOAPTestSuiteBuilder extend
addTest(new org.apache.axiom.ts.soap.envelope.TestGetHeader(metaFactory, envelopeNamespaceURI));
addTest(new org.apache.axiom.ts.soap.envelope.TestGetHeaderWithParser(metaFactory, envelopeNamespaceURI));
addTest(new org.apache.axiom.ts.soap.envelope.TestGetSOAPBodyFirstElementLocalNameAndNS(metaFactory, envelopeNamespaceURI));
+ addTest(new org.apache.axiom.ts.soap.factory.TestGetDefaultFaultEnvelope(metaFactory, envelopeNamespaceURI));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestAddDetailEntry(metaFactory, envelopeNamespaceURI));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntries(metaFactory, envelopeNamespaceURI));
addTest(new org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntriesWithParser(metaFactory, envelopeNamespaceURI));
Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java?rev=1059519&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java Sun Jan 16 09:11:06 2011
@@ -0,0 +1,55 @@
+/*
+ * 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.ts.soap.factory;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Tests the behavior of {@link org.apache.axiom.soap.SOAPFactory#getDefaultFaultEnvelope()}.
+ */
+public class TestGetDefaultFaultEnvelope extends SOAPTestCase {
+ public TestGetDefaultFaultEnvelope(OMMetaFactory metaFactory, String envelopeNamespaceURI) {
+ super(metaFactory, envelopeNamespaceURI);
+ }
+
+ protected void runTest() throws Throwable {
+ 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());
+ if (!isSOAP11()) {
+ 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());
+ if (!isSOAP11()) {
+ assertNotNull(
+ "Default FaultEnvelope must have a SOAPFaultText in it",
+ envelope.getBody().getFault().getReason().getFirstSOAPText());
+ }
+ }
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestGetDefaultFaultEnvelope.java
------------------------------------------------------------------------------
svn:eol-style = native