Author: veithen
Date: Wed Apr 6 11:47:35 2011
New Revision: 1089412
URL: http://svn.apache.org/viewvc?rev=1089412&view=rev
Log:
AXIOM-311: Refactored the unit tests for SOAPFaultText#setLang.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestSetLang.java
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-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.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=1089412&r1=1089411&r2=1089412&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
Wed Apr 6 11:47:35 2011
@@ -25,6 +25,7 @@ import org.apache.axiom.om.impl.dom.fact
import org.apache.axiom.ts.SOAPTestSuiteBuilder;
import org.apache.axiom.ts.soap.factory.TestGetDefaultFaultEnvelope;
import org.apache.axiom.ts.soap.faultdetail.TestWSCommons202;
+import org.apache.axiom.ts.soap.faulttext.TestSetLang;
import org.apache.axiom.ts.soap11.header.TestSOAP11Roles;
import org.apache.axiom.ts.soap12.fault.TestMoreChildrenAddition;
import org.apache.axiom.ts.soap12.header.TestSOAP12Roles;
@@ -41,6 +42,9 @@ public class SOAPImplementationTest exte
builder.exclude(TestSOAP11Roles.class);
builder.exclude(TestSOAP12Roles.class);
+ // SOAPFaultText is currently unsupported in DOOM
+ builder.exclude(TestSetLang.class);
+
return builder.build();
}
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java?rev=1089412&r1=1089411&r2=1089412&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
Wed Apr 6 11:47:35 2011
@@ -40,28 +40,6 @@ public class SOAPFaultTextTestBase exten
soap12FaultTextWithParser =
soap12FaultReasonWithParser.getFirstSOAPText();
}
- //SOAP 1.1 Fault Text Test (Programaticaly Created)
- public void testSOAP11SetLang() {
- soap11FaultText.setLang("en");
- assertTrue(
- "SOAP 1.1 Fault Text Test : - After calling setLang method,
Lang attribute value mismatch",
- soap11FaultText.getLang().equals("en"));
- OMAttribute langAttribute = (OMAttribute)
soap11FaultText.getAllAttributes()
- .next();
- assertTrue(
- "SOAP 1.1 Fault Text Test : - After calling setLang method,
Lang attribute local name mismaatch",
- langAttribute.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME));
- assertTrue(
- "SOAP 1.1 Fault Text Test : - After calling setLang method,
Lang attribute namespace prefix mismatch",
- langAttribute.getNamespace().getPrefix().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
- assertTrue(
- "SOAP 1.1 Fault Text Test : - After calling setLang method,
Lang attribute namespace uri mismatch",
- langAttribute.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
- }
-
public void testSOAP11GetLang() {
@@ -92,28 +70,6 @@ public class SOAPFaultTextTestBase exten
soap11FaultText.getText().equals("This is only a test"));
}
- //SOAP 1.2 Fault Text Test (Programaticaly Created)
- public void testSOAP12SetLang() {
- soap12FaultText.setLang("en");
- assertTrue(
- "SOAP 1.2 Fault Text Test : - After calling setLang method,
Lang attribute value mismatch",
- soap12FaultText.getLang().equals("en"));
- OMAttribute langAttribute = (OMAttribute)
soap12FaultText.getAllAttributes()
- .next();
- assertTrue(
- "SOAP 1.2 Fault Text Test : - After calling setLang method,
Lang attribute local name mismaatch",
- langAttribute.getLocalName().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME));
- assertTrue(
- "SOAP 1.2 Fault Text Test : - After calling setLang method,
Lang attribute namespace prefix mismatch",
- langAttribute.getNamespace().getPrefix().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
- assertTrue(
- "SOAP 1.2 Fault Text Test : - After calling setLang method,
Lang attribute namespace uri mismatch",
- langAttribute.getNamespace().getNamespaceURI().equals(
- SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI));
- }
-
public void testSOAP12GetLang() {
assertNull(
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=1089412&r1=1089411&r2=1089412&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
Wed Apr 6 11:47:35 2011
@@ -69,6 +69,7 @@ public class SOAPTestSuiteBuilder extend
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntriesWithParser(metaFactory,
spec));
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestSerialization(metaFactory, spec));
addTest(new
org.apache.axiom.ts.soap.faultdetail.TestWSCommons202(metaFactory, spec));
+ addTest(new
org.apache.axiom.ts.soap.faulttext.TestSetLang(metaFactory, spec));
addTest(new
org.apache.axiom.ts.soap.header.TestAddHeaderBlock(metaFactory, spec));
addTest(new
org.apache.axiom.ts.soap.header.TestExamineAllHeaderBlocks(metaFactory, spec));
addTest(new
org.apache.axiom.ts.soap.header.TestExamineHeaderBlocks(metaFactory, spec));
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestSetLang.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestSetLang.java?rev=1089412&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestSetLang.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestSetLang.java
Wed Apr 6 11:47:35 2011
@@ -0,0 +1,51 @@
+/*
+ * 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.faulttext;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestSetLang extends SOAPTestCase {
+ public TestSetLang(OMMetaFactory metaFactory, SOAPSpec spec) {
+ super(metaFactory, spec);
+ }
+
+ protected void runTest() throws Throwable {
+ SOAPFaultText faultText = soapFactory.createSOAPFaultText();
+ faultText.setLang("en");
+ assertEquals(
+ "SOAP Fault Text Test : - After calling setLang method, Lang
attribute value mismatch",
+ "en", faultText.getLang());
+ OMAttribute langAttribute = (OMAttribute) faultText.getAllAttributes()
+ .next();
+ assertEquals(
+ "SOAP Fault Text Test : - After calling setLang method, Lang
attribute local name mismaatch",
+ SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
langAttribute.getLocalName());
+ assertEquals(
+ "SOAP Fault Text Test : - After calling setLang method, Lang
attribute namespace prefix mismatch",
+ SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX,
langAttribute.getNamespace().getPrefix());
+ assertEquals(
+ "SOAP Fault Text Test : - After calling setLang method, Lang
attribute namespace uri mismatch",
+ SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
langAttribute.getNamespace().getNamespaceURI());
+ }
+}