ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1607207 - in /webservices/axiom/trunk/modules: axiom-api/src/test/java/org/apache/axiom/soap/ axiom-tests/src/test/java/org/apache/axiom/soap/ axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/ axiom-tests/src/test/java/org/apache/a...
Date Tue, 01 Jul 2014 22:36:48 GMT
Author: veithen
Date: Tue Jul  1 22:36:47 2014
New Revision: 1607207

URL: http://svn.apache.org/r1607207
Log:
AXIOM-311: Refactor the test cases for SOAPFaultText#getLang() and remove test classes that
are no longer necessary.

Added:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java
  (contents, props changed)
      - copied, changed from r1607160, webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
  (contents, props changed)
      - copied, changed from r1607160, webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestCase.java
Removed:
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestCase.java
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultReasonTestCase.java
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPTestCase.java
    webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPFaultTextTestBase.java
    webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextTest.java
    webservices/axiom/trunk/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/SOAPFaultTextTest.java
Modified:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java

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=1607207&r1=1607206&r2=1607207&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
Tue Jul  1 22:36:47 2014
@@ -210,6 +210,8 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.faultdetail.TestSerialization(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.faultdetail.TestWSCommons202(metaFactory, spec));
         if (spec.getFaultTextQName() != null) {
+            addTest(new org.apache.axiom.ts.soap.faulttext.TestGetLang(metaFactory, spec));
+            addTest(new org.apache.axiom.ts.soap.faulttext.TestGetLangFromParser(metaFactory,
spec));
             addTest(new org.apache.axiom.ts.soap.faulttext.TestSetLang(metaFactory, spec));
         }
         if (spec.getFaultNodeQName() != null) {

Copied: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java
(from r1607160, webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java?p2=webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java&p1=webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java&r1=1607160&r2=1607207&rev=1607207&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultTestCase.java
(original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java
Tue Jul  1 22:36:47 2014
@@ -16,22 +16,26 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.axiom.ts.soap.faulttext;
 
-package org.apache.axiom.soap;
+import javax.xml.XMLConstants;
 
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
 
-public abstract class SOAPFaultTestCase extends SOAPBodyTestCase {
-    protected SOAPFault soap11Fault;
-    protected SOAPFault soap12Fault;
-
-    public SOAPFaultTestCase(OMMetaFactory omMetaFactory) {
-        super(omMetaFactory);
+public class TestGetLang extends SOAPTestCase {
+    public TestGetLang(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
     }
 
-    protected void setUp() throws Exception {
-        super.setUp();
-        soap11Fault = soap11Factory.createSOAPFault(soap11Body);
-        soap12Fault = soap12Factory.createSOAPFault(soap12Body);
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFaultText faultText = soapFactory.createSOAPFaultText();
+        faultText.setText("test");
+        assertNull(faultText.getLang());
+        faultText.addAttribute("lang", "fr", soapFactory.createOMNamespace(XMLConstants.XML_NS_URI,
XMLConstants.XML_NS_PREFIX));
+        assertEquals("fr", faultText.getLang());
     }
 }

Propchange: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLang.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
(from r1607160, webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestCase.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java?p2=webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java&p1=webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestCase.java&r1=1607160&r2=1607207&rev=1607207&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPBodyTestCase.java
(original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
Tue Jul  1 22:36:47 2014
@@ -16,24 +16,23 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-package org.apache.axiom.soap;
+package org.apache.axiom.ts.soap.faulttext;
 
 import org.apache.axiom.om.OMMetaFactory;
-
-public abstract class SOAPBodyTestCase extends SOAPTestCase {
-    protected SOAPBody soap11Body;
-    protected SOAPBody soap12Body;
-
-    public SOAPBodyTestCase(OMMetaFactory omMetaFactory) {
-        super(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.TestMessageAdapter;
+import org.apache.axiom.ts.soap.TestMessageSet;
+
+public class TestGetLangFromParser extends SOAPTestCase {
+    public TestGetLangFromParser(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
     }
 
-    protected void setUp() throws Exception {
-        super.setUp();
-        soap11Body = soap11Factory.createSOAPBody(soap11Envelope);
-        soap12Body = soap12Factory.createSOAPBody(soap12Envelope);
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPEnvelope env = TestMessageSet.SIMPLE_FAULT.getMessage(spec).getAdapter(TestMessageAdapter.class).getSOAPEnvelope(metaFactory);
+        assertEquals("en", env.getBody().getFault().getReason().getFirstSOAPText().getLang());
     }
-
 }

Propchange: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faulttext/TestGetLangFromParser.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message