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/07/01 20:12:25 UTC

svn commit: r1607154 - in /webservices/axiom/trunk/modules: axiom-api/src/test/java/org/apache/axiom/soap/ axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/ axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/ axiom-testsuite/src/main/java/o...

Author: veithen
Date: Tue Jul  1 18:12:24 2014
New Revision: 1607154

URL: http://svn.apache.org/r1607154
Log:
AXIOM-311: Refactored/overhauled some test cases.

Added:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValue.java   (with props)
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java   (with props)
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestSetFaultNodeValue.java   (with props)
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValue.java   (with props)
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestSetRoleValue.java   (with props)
Removed:
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultNodeTestBase.java
    webservices/axiom/trunk/modules/axiom-api/src/test/java/org/apache/axiom/soap/SOAPFaultRoleTestBase.java
    webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPFaultRoleTest.java
    webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPFaultNodeTest.java
    webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPFaultRoleTest.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=1607154&r1=1607153&r2=1607154&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 18:12:24 2014
@@ -212,7 +212,14 @@ public class SOAPTestSuiteBuilder extend
         if (spec.getFaultTextQName() != null) {
             addTest(new org.apache.axiom.ts.soap.faulttext.TestSetLang(metaFactory, spec));
         }
+        if (spec.getFaultNodeQName() != null) {
+            addTest(new org.apache.axiom.ts.soap.faultnode.TestGetFaultNodeValue(metaFactory, spec));
+            addTest(new org.apache.axiom.ts.soap.faultnode.TestGetFaultNodeValueWithParser(metaFactory, spec));
+            addTest(new org.apache.axiom.ts.soap.faultnode.TestSetFaultNodeValue(metaFactory, spec));
+        }
+        addTest(new org.apache.axiom.ts.soap.faultrole.TestGetRoleValue(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.faultrole.TestGetRoleValueWithParser(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.faultrole.TestSetRoleValue(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.header.TestAddHeaderBlock(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.header.TestAddHeaderBlockFromQName(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.header.TestAddHeaderBlockFromQNameWithoutNamespace(metaFactory, spec));

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValue.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValue.java?rev=1607154&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValue.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValue.java Tue Jul  1 18:12:24 2014
@@ -0,0 +1,38 @@
+/*
+ * 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.faultnode;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultNode;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetFaultNodeValue extends SOAPTestCase {
+    public TestGetFaultNodeValue(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFaultNode node = soapFactory.createSOAPFaultNode();
+        assertEquals("", node.getFaultNodeValue());
+        node.setText("http://my.node");
+        assertEquals("http://my.node", node.getFaultNodeValue());
+    }
+}

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

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java?rev=1607154&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestGetFaultNodeValueWithParser.java Tue Jul  1 18:12:24 2014
@@ -0,0 +1,38 @@
+/*
+ * 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.faultnode;
+
+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.TestMessageAdapter;
+import org.apache.axiom.ts.soap.TestMessageSet;
+
+public class TestGetFaultNodeValueWithParser extends SOAPTestCase {
+    public TestGetFaultNodeValueWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPEnvelope env = TestMessageSet.CUSTOM_ROLE_FAULT.getMessage(spec).getAdapter(TestMessageAdapter.class).getSOAPEnvelope(metaFactory);
+        assertEquals("http://gateway.corp.example.org/", env.getBody().getFault().getNode().getFaultNodeValue());
+    }
+}

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

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestSetFaultNodeValue.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestSetFaultNodeValue.java?rev=1607154&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestSetFaultNodeValue.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultnode/TestSetFaultNodeValue.java Tue Jul  1 18:12:24 2014
@@ -0,0 +1,37 @@
+/*
+ * 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.faultnode;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultNode;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestSetFaultNodeValue extends SOAPTestCase {
+    public TestSetFaultNodeValue(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFaultNode node = soapFactory.createSOAPFaultNode();
+        node.setFaultNodeValue("http://some.node");
+        assertEquals("http://some.node", node.getText());
+    }
+}

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

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValue.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValue.java?rev=1607154&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValue.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestGetRoleValue.java Tue Jul  1 18:12:24 2014
@@ -0,0 +1,38 @@
+/*
+ * 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.faultrole;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultRole;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestGetRoleValue extends SOAPTestCase {
+    public TestGetRoleValue(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFaultRole role = soapFactory.createSOAPFaultRole();
+        assertEquals("", role.getRoleValue());
+        role.setText("urn:my:custom:role");
+        assertEquals("urn:my:custom:role", role.getRoleValue());
+    }
+}

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

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestSetRoleValue.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestSetRoleValue.java?rev=1607154&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestSetRoleValue.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultrole/TestSetRoleValue.java Tue Jul  1 18:12:24 2014
@@ -0,0 +1,37 @@
+/*
+ * 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.faultrole;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.soap.SOAPFaultRole;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+public class TestSetRoleValue extends SOAPTestCase {
+    public TestSetRoleValue(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    @Override
+    protected void runTest() throws Throwable {
+        SOAPFaultRole role = soapFactory.createSOAPFaultRole();
+        role.setRoleValue("urn:some:role");
+        assertEquals("urn:some:role", role.getText());
+    }
+}

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