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 2014/05/31 20:19:42 UTC
svn commit: r1598892 - in
/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap:
./ factory/
Author: veithen
Date: Sat May 31 18:19:42 2014
New Revision: 1598892
URL: http://svn.apache.org/r1598892
Log:
Unify the TestCreateSOAPFaultChild and TestCreateSOAPEnvelope test cases.
Added:
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java (with props)
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java (contents, props changed)
- copied, changed from r1598869, webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPFaultChild.java
Removed:
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPEnvelope.java
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPFaultChild.java
Modified:
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPFaultChild.java
Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java?rev=1598892&r1=1598891&r2=1598892&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPSpec.java Sat May 31 18:19:42 2014
@@ -30,6 +30,7 @@ import org.apache.axiom.soap.SOAP11Const
import org.apache.axiom.soap.SOAP11Version;
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.SOAP12Version;
+import org.apache.axiom.soap.SOAPConstants;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPVersion;
@@ -87,11 +88,13 @@ public abstract class SOAPSpec {
private final SOAPVersion version;
private final BooleanLiteral[] booleanLiterals;
+ private final QName envelopeQName;
private final QName faultTextQName;
public SOAPSpec(SOAPVersion version, BooleanLiteral[] booleanLiterals, QName faultTextQName) {
this.version = version;
this.booleanLiterals = booleanLiterals;
+ envelopeQName = new QName(getEnvelopeNamespaceURI(), SOAPConstants.SOAPENVELOPE_LOCAL_NAME);
this.faultTextQName = faultTextQName;
}
@@ -113,6 +116,10 @@ public abstract class SOAPSpec {
public abstract String getEnvelopeNamespaceURI();
+ public final QName getEnvelopeQName() {
+ return envelopeQName;
+ }
+
public final QName getFaultCodeQName() {
return version.getFaultCodeQName();
}
Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1598892&r1=1598891&r2=1598892&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Sat May 31 18:19:42 2014
@@ -30,6 +30,7 @@ import org.apache.axiom.testutils.suite.
import org.apache.axiom.ts.dimension.ExpansionStrategy;
import org.apache.axiom.ts.dimension.Strategies;
import org.apache.axiom.ts.dimension.serialization.SerializationStrategy;
+import org.apache.axiom.ts.soap.factory.SOAPElementType;
import org.apache.axiom.ts.soap.factory.SOAPFaultChild;
public class SOAPTestSuiteBuilder extends MatrixTestSuiteBuilder {
@@ -61,7 +62,8 @@ public class SOAPTestSuiteBuilder extend
new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "NoFault", SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX),
new QName(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "NoFault", SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX) };
- private static final SOAPFaultChild[] soapFaultChildren = {
+ private static final SOAPElementType[] soapElementTypes = {
+ SOAPElementType.ENVELOPE,
SOAPFaultChild.CODE,
SOAPFaultChild.REASON,
SOAPFaultChild.ROLE,
@@ -161,10 +163,9 @@ public class SOAPTestSuiteBuilder extend
if (supportsOMSourcedElement) {
addTest(new org.apache.axiom.ts.soap.envelope.TestSerializeAndConsumeWithOMSEInBody(metaFactory, spec));
}
- addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPEnvelope(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPEnvelopeWithCustomPrefix(metaFactory, spec));
- for (int i=0; i<soapFaultChildren.length; i++) {
- addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPFaultChild(metaFactory, spec, soapFaultChildren[i]));
+ for (int i=0; i<soapElementTypes.length; i++) {
+ addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPElement(metaFactory, spec, soapElementTypes[i]));
}
addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPFaultWithParent(metaFactory, spec));
addTest(new org.apache.axiom.ts.soap.factory.TestFactoryIsSingleton(metaFactory, spec));
Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java?rev=1598892&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java Sat May 31 18:19:42 2014
@@ -0,0 +1,52 @@
+/*
+ * 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 javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.testutils.suite.Dimension;
+import org.apache.axiom.testutils.suite.MatrixTestCase;
+import org.apache.axiom.ts.soap.SOAPSpec;
+
+public interface SOAPElementType extends Dimension {
+ SOAPElementType ENVELOPE = new SOAPElementType() {
+ public void addTestParameters(MatrixTestCase testCase) {
+ testCase.addTestParameter("type", "SOAPEnvelope");
+ }
+
+ public Class getType() {
+ return SOAPEnvelope.class;
+ }
+
+ public QName getQName(SOAPSpec spec) {
+ return spec.getEnvelopeQName();
+ }
+
+ public OMElement create(SOAPFactory factory) {
+ return factory.createSOAPEnvelope();
+ }
+ };
+
+ Class getType();
+ QName getQName(SOAPSpec spec);
+ OMElement create(SOAPFactory factory);
+}
Propchange: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPElementType.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPFaultChild.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPFaultChild.java?rev=1598892&r1=1598891&r2=1598892&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPFaultChild.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/SOAPFaultChild.java Sat May 31 18:19:42 2014
@@ -27,11 +27,10 @@ import org.apache.axiom.soap.SOAPFaultCo
import org.apache.axiom.soap.SOAPFaultDetail;
import org.apache.axiom.soap.SOAPFaultReason;
import org.apache.axiom.soap.SOAPFaultRole;
-import org.apache.axiom.testutils.suite.Dimension;
import org.apache.axiom.testutils.suite.MatrixTestCase;
import org.apache.axiom.ts.soap.SOAPSpec;
-public interface SOAPFaultChild extends Dimension {
+public interface SOAPFaultChild extends SOAPElementType {
SOAPFaultChild CODE = new SOAPFaultChild() {
public Class getType() {
return SOAPFaultCode.class;
@@ -152,10 +151,7 @@ public interface SOAPFaultChild extends
}
};
- Class getType();
- QName getQName(SOAPSpec spec);
int getOrder();
- OMElement create(SOAPFactory factory);
OMElement create(SOAPFactory factory, SOAPFault parent);
void set(SOAPFault fault, OMElement element);
}
Copied: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java (from r1598869, webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPFaultChild.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java?p2=webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java&p1=webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPFaultChild.java&r1=1598869&r2=1598892&rev=1598892&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPFaultChild.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java Sat May 31 18:19:42 2014
@@ -31,13 +31,14 @@ import org.apache.axiom.ts.soap.SOAPSpec
import org.apache.axiom.ts.soap.SOAPTestCase;
/**
- * Tests {@link SOAPFactory#createSOAPFaultCode()}, {@link SOAPFactory#createSOAPFaultReason()},
- * {@link SOAPFactory#createSOAPFaultRole()} and {@link SOAPFactory#createSOAPFaultDetail()}.
+ * Tests {@link SOAPFactory#createSOAPEnvelope()}, {@link SOAPFactory#createSOAPFaultCode()},
+ * {@link SOAPFactory#createSOAPFaultReason()}, {@link SOAPFactory#createSOAPFaultRole()} and
+ * {@link SOAPFactory#createSOAPFaultDetail()}.
*/
-public class TestCreateSOAPFaultChild extends SOAPTestCase {
- private final SOAPFaultChild type;
+public class TestCreateSOAPElement extends SOAPTestCase {
+ private final SOAPElementType type;
- public TestCreateSOAPFaultChild(OMMetaFactory metaFactory, SOAPSpec spec, SOAPFaultChild type) {
+ public TestCreateSOAPElement(OMMetaFactory metaFactory, SOAPSpec spec, SOAPElementType type) {
super(metaFactory, spec);
this.type = type;
type.addTestParameters(this);
Propchange: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateSOAPElement.java
------------------------------------------------------------------------------
svn:eol-style = native