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 2012/02/28 21:01:18 UTC

svn commit: r1294803 - in /webservices/commons/trunk/modules/axiom/modules: axiom-tests/src/test/java/org/apache/axiom/xpath/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/

Author: veithen
Date: Tue Feb 28 20:01:17 2012
New Revision: 1294803

URL: http://svn.apache.org/viewvc?rev=1294803&view=rev
Log:
AXIOM-311: Migrated the test cases for AXIOM-328 to the new test suite.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java
      - copied, changed from r1294798, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java
      - copied, changed from r1294798, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java
Removed:
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1294803&r1=1294802&r2=1294803&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Tue Feb 28 20:01:17 2012
@@ -337,6 +337,8 @@ public class OMTestSuiteBuilder extends 
                 addTest(new TestAXIOMXPath(metaFactory, methodName));
             }
         }
+        addTest(new org.apache.axiom.ts.om.xpath.TestAddNamespaces(metaFactory));
+        addTest(new org.apache.axiom.ts.om.xpath.TestAddNamespaces2(metaFactory));
         addTest(new org.apache.axiom.ts.om.xpath.TestGetAttributeQName(metaFactory));
     }
 }

Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java (from r1294798, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java&r1=1294798&r2=1294803&rev=1294803&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java Tue Feb 28 20:01:17 2012
@@ -17,35 +17,27 @@
  * under the License.
  */
 
-package org.apache.axiom.xpath;
-
-import junit.framework.TestCase;
+package org.apache.axiom.ts.om.xpath;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
 import org.apache.axiom.om.xpath.AXIOMXPath;
+import org.apache.axiom.ts.AxiomTestCase;
 
-/**
- * This class contains Axiom specific tests, while AXIOMXPathTest is
- * used for the Jaxen test harness.
- */
-public class AXIOMXPathTest2 extends TestCase {
-    public void testAddNamespaces() throws Exception {
-        OMElement root1 = AXIOMUtil.stringToOM(
-                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
-        OMElement root2 = AXIOMUtil.stringToOM(
-                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
-        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
-        xpath.addNamespaces(root1.getFirstElement());
-        assertEquals("text", xpath.stringValueOf(root2.getParent()));
+public class TestAddNamespaces extends AxiomTestCase {
+    public TestAddNamespaces(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
 
-    public void testAddNamespaces2() throws Exception {
-        OMElement root1 = AXIOMUtil.stringToOM(
-                "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
-        OMElement root2 = AXIOMUtil.stringToOM(
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
+        OMElement root1 = AXIOMUtil.stringToOM(factory,
+                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
+        OMElement root2 = AXIOMUtil.stringToOM(factory,
                 "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
-        AXIOMXPath xpath = new AXIOMXPath("//ns:child");
+        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
         xpath.addNamespaces(root1.getFirstElement());
         assertEquals("text", xpath.stringValueOf(root2.getParent()));
     }

Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java (from r1294798, webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java&r1=1294798&r2=1294803&rev=1294803&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/xpath/AXIOMXPathTest2.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java Tue Feb 28 20:01:17 2012
@@ -17,33 +17,25 @@
  * under the License.
  */
 
-package org.apache.axiom.xpath;
-
-import junit.framework.TestCase;
+package org.apache.axiom.ts.om.xpath;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
 import org.apache.axiom.om.xpath.AXIOMXPath;
+import org.apache.axiom.ts.AxiomTestCase;
 
-/**
- * This class contains Axiom specific tests, while AXIOMXPathTest is
- * used for the Jaxen test harness.
- */
-public class AXIOMXPathTest2 extends TestCase {
-    public void testAddNamespaces() throws Exception {
-        OMElement root1 = AXIOMUtil.stringToOM(
-                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
-        OMElement root2 = AXIOMUtil.stringToOM(
-                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
-        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
-        xpath.addNamespaces(root1.getFirstElement());
-        assertEquals("text", xpath.stringValueOf(root2.getParent()));
+public class TestAddNamespaces2 extends AxiomTestCase {
+    public TestAddNamespaces2(OMMetaFactory metaFactory) {
+        super(metaFactory);
     }
 
-    public void testAddNamespaces2() throws Exception {
-        OMElement root1 = AXIOMUtil.stringToOM(
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
+        OMElement root1 = AXIOMUtil.stringToOM(factory,
                 "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
-        OMElement root2 = AXIOMUtil.stringToOM(
+        OMElement root2 = AXIOMUtil.stringToOM(factory,
                 "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
         AXIOMXPath xpath = new AXIOMXPath("//ns:child");
         xpath.addNamespaces(root1.getFirstElement());