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 2015/05/31 12:08:33 UTC
svn commit: r1682707 - in
/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts:
soap/ soap/body/ soap/builder/ soap/envelope/ soap/fault/ soap/faultcode/
soap/faultdetail/ soap/faultnode/ soap/faultrole/ soap/faulttext/ so...
Author: veithen
Date: Sun May 31 10:08:32 2015
New Revision: 1682707
URL: http://svn.apache.org/r1682707
Log:
Some code simplifications.
Added:
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java (with props)
Modified:
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestCloneOMElement.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFaultWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestAddHeaderToIncompleteEnvelope.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestDetach.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetBodyWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParserNoHeader.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetOrCreateHeaderWithParserNoHeader.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestHasFaultWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetCodeWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetDetailWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetReasonWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetRoleWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultcode/TestGetValueAsQNameWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestDetailEntriesUsingDefaultNamespaceWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValueWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardIncomplete.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardPartiallyBuilt.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocksWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultcode/TestGetValueWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultcode/TestGetValueWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java
Added: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java?rev=1682707&view=auto
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java (added)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java Sun May 31 10:08:32 2015
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import static org.apache.axiom.truth.AxiomTestVerb.ASSERT;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+
+public abstract class SampleBasedSOAPTestCase extends SOAPTestCase {
+ private final SOAPSample sample;
+
+ public SampleBasedSOAPTestCase(OMMetaFactory metaFactory, SOAPSpec spec,
+ SOAPSampleSet sampleSet) {
+ super(metaFactory, spec);
+ sample = sampleSet.getMessage(spec);
+ }
+
+ public SampleBasedSOAPTestCase(OMMetaFactory metaFactory, SOAPSpec spec, SOAPSample sample) {
+ super(metaFactory, spec);
+ ASSERT.that(sample.getSOAPSpec()).isSameAs(spec);
+ this.sample = sample;
+ }
+
+ @Override
+ protected final void runTest() throws Throwable {
+ runTest(sample.getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory));
+ }
+
+ protected abstract void runTest(SOAPEnvelope envelope) throws Throwable;
+}
Propchange: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SampleBasedSOAPTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestCloneOMElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestCloneOMElement.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestCloneOMElement.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestCloneOMElement.java Sun May 31 10:08:32 2015
@@ -22,20 +22,18 @@ import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
import org.custommonkey.xmlunit.XMLAssert;
-public class TestCloneOMElement extends SOAPTestCase {
+public class TestCloneOMElement extends SampleBasedSOAPTestCase {
public TestCloneOMElement(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope soapEnvelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
- SOAPBody body = soapEnvelope.getBody();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPBody body = envelope.getBody();
OMElement firstClonedBodyElement = body.cloneOMElement();
OMElement secondClonedBodyElement = body.cloneOMElement();
@@ -56,6 +54,6 @@ public class TestCloneOMElement extends
assertNull(firstClonedBodyElement.getParent());
assertNull(secondClonedBodyElement.getParent());
- soapEnvelope.close(false);
+ envelope.close(false);
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFaultWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFaultWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFaultWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFaultWithParser.java Sun May 31 10:08:32 2015
@@ -21,18 +21,18 @@ package org.apache.axiom.ts.soap.body;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPConstants;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetFaultWithParser extends SOAPTestCase {
+public class TestGetFaultWithParser extends SampleBasedSOAPTestCase {
public TestGetFaultWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPBody body = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPBody body = envelope.getBody();
assertNotNull(
"Body Test With parser :- getFault method returns null",
body.getFault());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParser.java Sun May 31 10:08:32 2015
@@ -20,18 +20,18 @@ package org.apache.axiom.ts.soap.body;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestHasFaultWithParser extends SOAPTestCase {
+public class TestHasFaultWithParser extends SampleBasedSOAPTestCase {
public TestHasFaultWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPBody body = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPBody body = envelope.getBody();
assertTrue(
"Body Test With parser :- hasFault method returns false",
body.hasFault());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java Sun May 31 10:08:32 2015
@@ -26,10 +26,9 @@ import org.apache.axiom.om.impl.builder.
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests that a custom builder registered with
@@ -38,13 +37,12 @@ import org.apache.axiom.ts.soap.SOAPSamp
* supports the optimization described by <a
* href="https://issues.apache.org/jira/browse/AXIOM-282">AXIOM-282</a>.
*/
-public class TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck extends SOAPTestCase {
+public class TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck extends SampleBasedSOAPTestCase {
public TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(SOAPSpec.SOAP11).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
StAXSOAPModelBuilder builder = (StAXSOAPModelBuilder)envelope.getBuilder();
// Do a fault check. This is normally done in the engine (Axiom) and should
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestAddHeaderToIncompleteEnvelope.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestAddHeaderToIncompleteEnvelope.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestAddHeaderToIncompleteEnvelope.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestAddHeaderToIncompleteEnvelope.java Sun May 31 10:08:32 2015
@@ -21,22 +21,20 @@ package org.apache.axiom.ts.soap.envelop
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Test the behavior when adding a header to an envelope that has not yet been built completely.
* This is a regression test for AXIOM-127.
*/
-public class TestAddHeaderToIncompleteEnvelope extends SOAPTestCase {
+public class TestAddHeaderToIncompleteEnvelope extends SampleBasedSOAPTestCase {
public TestAddHeaderToIncompleteEnvelope(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.NO_HEADER.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
assertNull(envelope.getHeader());
SOAPHeader header = soapFactory.createSOAPHeader(envelope);
assertSame(header, envelope.getHeader());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestDetach.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestDetach.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestDetach.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestDetach.java Sun May 31 10:08:32 2015
@@ -22,23 +22,21 @@ import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests {@link OMNode#detach()} when used on a {@link SOAPEnvelope}. Older Axiom versions threw an
* exception in that case. This is not correct because obviously one may want to detach a SOAP
* envelope from its containing document.
*/
-public class TestDetach extends SOAPTestCase {
+public class TestDetach extends SampleBasedSOAPTestCase {
public TestDetach(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.NO_HEADER.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
OMDocument document = (OMDocument)envelope.getParent();
envelope.detach();
assertNull(envelope.getParent());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetBodyWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetBodyWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetBodyWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetBodyWithParser.java Sun May 31 10:08:32 2015
@@ -22,18 +22,16 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPConstants;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetBodyWithParser extends SOAPTestCase {
+public class TestGetBodyWithParser extends SampleBasedSOAPTestCase {
public TestGetBodyWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.NO_HEADER.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPBody body = envelope.getBody();
assertEquals("Body Test : - Body local name mismatch",
SOAPConstants.BODY_LOCAL_NAME, body.getLocalName());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParser.java Sun May 31 10:08:32 2015
@@ -22,18 +22,16 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.soap.SOAPConstants;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetHeaderWithParser extends SOAPTestCase {
+public class TestGetHeaderWithParser extends SampleBasedSOAPTestCase {
public TestGetHeaderWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPHeader header = envelope.getHeader();
assertEquals("Header Test : - Header local name mismatch",
SOAPConstants.HEADER_LOCAL_NAME, header.getLocalName());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParserNoHeader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParserNoHeader.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParserNoHeader.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetHeaderWithParserNoHeader.java Sun May 31 10:08:32 2015
@@ -21,22 +21,20 @@ package org.apache.axiom.ts.soap.envelop
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests the behavior of {@link SOAPEnvelope#getHeader()} on a message that has no header. In
* particular it tests that the call doesn't build the {@link SOAPBody}.
*/
-public class TestGetHeaderWithParserNoHeader extends SOAPTestCase {
+public class TestGetHeaderWithParserNoHeader extends SampleBasedSOAPTestCase {
public TestGetHeaderWithParserNoHeader(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.NO_HEADER.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
assertNull(envelope.getHeader());
assertFalse(envelope.getBody().isComplete());
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetOrCreateHeaderWithParserNoHeader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetOrCreateHeaderWithParserNoHeader.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetOrCreateHeaderWithParserNoHeader.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetOrCreateHeaderWithParserNoHeader.java Sun May 31 10:08:32 2015
@@ -22,23 +22,21 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests the behavior of {@link SOAPEnvelope#getOrCreateHeader()} on a message that has no header.
* It checks that the call creates a new {@link SOAPHeader} and that it doesn't build the
* {@link SOAPBody}.
*/
-public class TestGetOrCreateHeaderWithParserNoHeader extends SOAPTestCase {
+public class TestGetOrCreateHeaderWithParserNoHeader extends SampleBasedSOAPTestCase {
public TestGetOrCreateHeaderWithParserNoHeader(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.NO_HEADER);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.NO_HEADER.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPHeader header = envelope.getOrCreateHeader();
assertNotNull(header);
assertSame(envelope.getFirstElement(), header);
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock.java Sun May 31 10:08:32 2015
@@ -28,10 +28,9 @@ import org.apache.axiom.om.OMMetaFactory
import org.apache.axiom.om.OMSourcedElement;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests the behavior of {@link OMContainer#getXMLStreamReaderWithoutCaching()} on a
@@ -40,13 +39,12 @@ import org.apache.axiom.ts.soap.SOAPSamp
* behave like a plain {@link OMElement}. For {@link OMContainer#getXMLStreamReaderWithoutCaching()}
* this means that consuming the reader should not build the {@link SOAPHeaderBlock}.
*/
-public class TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock extends SOAPTestCase {
+public class TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock extends SampleBasedSOAPTestCase {
public TestGetXMLStreamReaderWithoutCachingWithPartiallyBuiltHeaderBlock(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPHeaderBlock headerBlock = (SOAPHeaderBlock)envelope.getHeader().getFirstChildWithName(
new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"));
headerBlock.getFirstElement().getFirstOMChild();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestHasFaultWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestHasFaultWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestHasFaultWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestHasFaultWithParser.java Sun May 31 10:08:32 2015
@@ -20,18 +20,16 @@ package org.apache.axiom.ts.soap.envelop
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestHasFaultWithParser extends SOAPTestCase {
+public class TestHasFaultWithParser extends SampleBasedSOAPTestCase {
public TestHasFaultWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope env = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
- assertTrue(env.hasFault());
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ assertTrue(envelope.hasFault());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetCodeWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetCodeWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetCodeWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetCodeWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap.fault;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFault;
import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetCodeWithParser extends SOAPTestCase {
+public class TestGetCodeWithParser extends SampleBasedSOAPTestCase {
public TestGetCodeWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFault soapFaultWithParser = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFault soapFaultWithParser = envelope.getBody().getFault();
assertNotNull(
"Fault Test with parser: - getCode method returns null",
soapFaultWithParser.getCode());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetDetailWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetDetailWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetDetailWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetDetailWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap.fault;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFault;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetDetailWithParser extends SOAPTestCase {
+public class TestGetDetailWithParser extends SampleBasedSOAPTestCase {
public TestGetDetailWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFault soapFaultWithParser = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFault soapFaultWithParser = envelope.getBody().getFault();
assertNotNull(
"Fault Test with parser: - getDetail method returns null",
soapFaultWithParser.getDetail());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetReasonWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetReasonWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetReasonWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetReasonWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap.fault;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFault;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetReasonWithParser extends SOAPTestCase {
+public class TestGetReasonWithParser extends SampleBasedSOAPTestCase {
public TestGetReasonWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFault soapFaultWithParser = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFault soapFaultWithParser = envelope.getBody().getFault();
assertNotNull(
"Fault Test with parser: - getReason method returns null",
soapFaultWithParser.getReason());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetRoleWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetRoleWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetRoleWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestGetRoleWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap.fault;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFault;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetRoleWithParser extends SOAPTestCase {
+public class TestGetRoleWithParser extends SampleBasedSOAPTestCase {
public TestGetRoleWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.CUSTOM_ROLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFault soapFaultWithParser = SOAPSampleSet.CUSTOM_ROLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFault soapFaultWithParser = envelope.getBody().getFault();
assertNotNull(
"Fault Test with parser: - getRole method returns null",
soapFaultWithParser.getRole());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultcode/TestGetValueAsQNameWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultcode/TestGetValueAsQNameWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultcode/TestGetValueAsQNameWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultcode/TestGetValueAsQNameWithParser.java Sun May 31 10:08:32 2015
@@ -19,23 +19,23 @@
package org.apache.axiom.ts.soap.faultcode;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultClassifier;
import org.apache.axiom.soap.SOAPFaultCode;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests the behavior of {@link SOAPFaultClassifier#getValueAsQName()} on a {@link SOAPFaultCode}.
*/
-public class TestGetValueAsQNameWithParser extends SOAPTestCase {
+public class TestGetValueAsQNameWithParser extends SampleBasedSOAPTestCase {
public TestGetValueAsQNameWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultCode faultCode = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getCode();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultCode faultCode = envelope.getBody().getFault().getCode();
assertEquals(spec.getReceiverFaultCode(), faultCode.getValueAsQName());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestDetailEntriesUsingDefaultNamespaceWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestDetailEntriesUsingDefaultNamespaceWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestDetailEntriesUsingDefaultNamespaceWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestDetailEntriesUsingDefaultNamespaceWithParser.java Sun May 31 10:08:32 2015
@@ -21,22 +21,22 @@ package org.apache.axiom.ts.soap.faultde
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultDetail;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests parsing of a SOAP fault that has detail entries that use a default namespace.
*/
-public class TestDetailEntriesUsingDefaultNamespaceWithParser extends SOAPTestCase {
+public class TestDetailEntriesUsingDefaultNamespaceWithParser extends SampleBasedSOAPTestCase {
public TestDetailEntriesUsingDefaultNamespaceWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.FAULT_DETAIL_DEFAULT_NAMESPACE);
}
- protected void runTest() throws Throwable {
- SOAPFaultDetail soapFaultDetail = SOAPSampleSet.FAULT_DETAIL_DEFAULT_NAMESPACE.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getDetail();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultDetail soapFaultDetail = envelope.getBody().getFault().getDetail();
OMElement detailElement = soapFaultDetail.getFirstElement();
assertEquals("AddNumbersHandlerFault", detailElement.getLocalName());
OMNamespace ns = detailElement.getNamespace();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java Sun May 31 10:08:32 2015
@@ -22,20 +22,20 @@ import java.util.Iterator;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultDetail;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
//SOAP Fault Detail Test (With Parser)
-public class TestGetAllDetailEntriesWithParser extends SOAPTestCase {
+public class TestGetAllDetailEntriesWithParser extends SampleBasedSOAPTestCase {
public TestGetAllDetailEntriesWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultDetail soapFaultDetail = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getDetail();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultDetail soapFaultDetail = envelope.getBody().getFault().getDetail();
Iterator iterator = soapFaultDetail.getAllDetailEntries();
OMElement detailEntry1 = (OMElement) iterator.next();
assertNotNull(
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java Sun May 31 10:08:32 2015
@@ -20,19 +20,18 @@ package org.apache.axiom.ts.soap.faultno
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetFaultNodeValueWithParser extends SOAPTestCase {
+public class TestGetFaultNodeValueWithParser extends SampleBasedSOAPTestCase {
public TestGetFaultNodeValueWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.CUSTOM_ROLE_FAULT);
}
@Override
- protected void runTest() throws Throwable {
- SOAPEnvelope env = SOAPSampleSet.CUSTOM_ROLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
- assertEquals("http://gateway.corp.example.org/", env.getBody().getFault().getNode().getFaultNodeValue());
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ assertEquals("http://gateway.corp.example.org/",
+ envelope.getBody().getFault().getNode().getFaultNodeValue());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValueWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValueWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValueWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValueWithParser.java Sun May 31 10:08:32 2015
@@ -20,19 +20,18 @@ package org.apache.axiom.ts.soap.faultro
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetRoleValueWithParser extends SOAPTestCase {
+public class TestGetRoleValueWithParser extends SampleBasedSOAPTestCase {
public TestGetRoleValueWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.CUSTOM_ROLE_FAULT);
}
@Override
- protected void runTest() throws Throwable {
- SOAPEnvelope env = SOAPSampleSet.CUSTOM_ROLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
- assertEquals("http://www.example.org/gateway/cache", env.getBody().getFault().getRole().getRoleValue());
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ assertEquals("http://www.example.org/gateway/cache",
+ envelope.getBody().getFault().getRole().getRoleValue());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java Sun May 31 10:08:32 2015
@@ -20,19 +20,17 @@ package org.apache.axiom.ts.soap.faultte
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetLangFromParser extends SOAPTestCase {
+public class TestGetLangFromParser extends SampleBasedSOAPTestCase {
public TestGetLangFromParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.SIMPLE_FAULT);
}
@Override
- protected void runTest() throws Throwable {
- SOAPEnvelope env = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
- assertEquals("en", env.getBody().getFault().getReason().getFirstSOAPText().getLang());
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ assertEquals("en", envelope.getBody().getFault().getReason().getFirstSOAPText().getLang());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardIncomplete.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardIncomplete.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardIncomplete.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardIncomplete.java Sun May 31 10:08:32 2015
@@ -20,19 +20,17 @@ package org.apache.axiom.ts.soap.header;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
// Regression test for AXIOM-223 (see r567512)
-public class TestDiscardIncomplete extends SOAPTestCase {
+public class TestDiscardIncomplete extends SampleBasedSOAPTestCase {
public TestDiscardIncomplete(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
envelope.getHeader().discard();
envelope.getBody().toStringWithConsume();
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardPartiallyBuilt.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardPartiallyBuilt.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardPartiallyBuilt.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestDiscardPartiallyBuilt.java Sun May 31 10:08:32 2015
@@ -26,23 +26,21 @@ import org.apache.axiom.om.OMNode;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
/**
* Tests the behavior of {@link OMNode#discard()} on a {@link SOAPHeader} that is partially built,
* more precisely in a situation where the builder is building a descendant that is not an immediate
* child of the header.
*/
-public class TestDiscardPartiallyBuilt extends SOAPTestCase {
+public class TestDiscardPartiallyBuilt extends SampleBasedSOAPTestCase {
public TestDiscardPartiallyBuilt(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPHeader header = envelope.getHeader();
OMElement from = header.getFirstChildWithName(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"));
from.getFirstElement().getFirstOMChild();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocksWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocksWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocksWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/header/TestExamineAllHeaderBlocksWithParser.java Sun May 31 10:08:32 2015
@@ -23,18 +23,16 @@ import java.util.Iterator;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestExamineAllHeaderBlocksWithParser extends SOAPTestCase {
+public class TestExamineAllHeaderBlocksWithParser extends SampleBasedSOAPTestCase {
public TestExamineAllHeaderBlocksWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
- super(metaFactory, spec);
+ super(metaFactory, spec, SOAPSampleSet.WSA);
}
- protected void runTest() throws Throwable {
- SOAPEnvelope envelope = SOAPSampleSet.WSA.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory);
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
Iterator iterator = envelope.getHeader().examineAllHeaderBlocks();
iterator.hasNext();
SOAPHeaderBlock headerBlock = (SOAPHeaderBlock)iterator.next();
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultcode/TestGetValueWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultcode/TestGetValueWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultcode/TestGetValueWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultcode/TestGetValueWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap11.faultcode;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultCode;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetValueWithParser extends SOAPTestCase {
+public class TestGetValueWithParser extends SampleBasedSOAPTestCase {
public TestGetValueWithParser(OMMetaFactory metaFactory) {
- super(metaFactory, SOAPSpec.SOAP11);
+ super(metaFactory, SOAPSpec.SOAP11, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultCode code = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getCode();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultCode code = envelope.getBody().getFault().getCode();
assertNull(code.getValue());
}
}
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultcode/TestGetValueWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultcode/TestGetValueWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultcode/TestGetValueWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultcode/TestGetValueWithParser.java Sun May 31 10:08:32 2015
@@ -20,19 +20,19 @@ package org.apache.axiom.ts.soap12.fault
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultCode;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetValueWithParser extends SOAPTestCase {
+public class TestGetValueWithParser extends SampleBasedSOAPTestCase {
public TestGetValueWithParser(OMMetaFactory metaFactory) {
- super(metaFactory, SOAPSpec.SOAP12);
+ super(metaFactory, SOAPSpec.SOAP12, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultCode faultCode = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getCode();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultCode faultCode = envelope.getBody().getFault().getCode();
assertNotNull(
"SOAP 1.2 Fault Code Test with parser : - getValue method returns null",
faultCode.getValue());
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faultreason/TestGetFirstSOAPTextWithParser.java Sun May 31 10:08:32 2015
@@ -19,19 +19,19 @@
package org.apache.axiom.ts.soap12.faultreason;
import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultReason;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetFirstSOAPTextWithParser extends SOAPTestCase {
+public class TestGetFirstSOAPTextWithParser extends SampleBasedSOAPTestCase {
public TestGetFirstSOAPTextWithParser(OMMetaFactory metaFactory) {
- super(metaFactory, SOAPSpec.SOAP12);
+ super(metaFactory, SOAPSpec.SOAP12, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultReason faultReason = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getReason();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultReason faultReason = envelope.getBody().getFault().getReason();
assertFalse(
"SOAP 1.2 FaultReason Test With Parser : - getFirstSOAPText method returns null",
faultReason.getFirstSOAPText() == null);
Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java?rev=1682707&r1=1682706&r2=1682707&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap12/faulttext/TestGetLangWithParser.java Sun May 31 10:08:32 2015
@@ -21,19 +21,19 @@ package org.apache.axiom.ts.soap12.fault
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFaultText;
-import org.apache.axiom.ts.soap.SOAPSpec;
-import org.apache.axiom.ts.soap.SOAPTestCase;
-import org.apache.axiom.ts.soap.SOAPSampleAdapter;
import org.apache.axiom.ts.soap.SOAPSampleSet;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SampleBasedSOAPTestCase;
-public class TestGetLangWithParser extends SOAPTestCase {
+public class TestGetLangWithParser extends SampleBasedSOAPTestCase {
public TestGetLangWithParser(OMMetaFactory metaFactory) {
- super(metaFactory, SOAPSpec.SOAP12);
+ super(metaFactory, SOAPSpec.SOAP12, SOAPSampleSet.SIMPLE_FAULT);
}
- protected void runTest() throws Throwable {
- SOAPFaultText faultText = SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getReason().getFirstSOAPText();
+ protected void runTest(SOAPEnvelope envelope) throws Throwable {
+ SOAPFaultText faultText = envelope.getBody().getFault().getReason().getFirstSOAPText();
assertTrue(
"SOAP 1.2 Fault Text Test With Parser : - getLang method returns incorrect string",
faultText.getLang().equals("en"));