ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1334242 - in /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement: TestName1DefaultPrefix.java TestName1QualifiedPrefix.java
Date Fri, 04 May 2012 22:32:31 GMT
Author: veithen
Date: Fri May  4 22:32:31 2012
New Revision: 1334242

URL: http://svn.apache.org/viewvc?rev=1334242&view=rev
Log:
Avoid OMSourcedElement prefix mismatches in unit tests. Currently OMSourcedElement allows
such mismatches, but this should change.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1DefaultPrefix.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1QualifiedPrefix.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1DefaultPrefix.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1DefaultPrefix.java?rev=1334242&r1=1334241&r2=1334242&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1DefaultPrefix.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1DefaultPrefix.java
Fri May  4 22:32:31 2012
@@ -41,20 +41,19 @@ public class TestName1DefaultPrefix exte
     protected void runTest() throws Throwable {
         OMFactory f = metaFactory.getOMFactory();
 
-        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses
the default prefix
+        // Create OMSE with an unknown prefix
         OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
         OMNamespace ns =
-                f.createOMNamespace("http://www.sosnoski.com/uwjws/library", "DUMMYPREFIX");
+                f.createOMNamespace("http://www.sosnoski.com/uwjws/library", null);
         OMElement element =
                 f.createOMElement(new TestDataSource(testDocument), "library", ns);
         OMElement root = f.createOMElement("root", rootNS);
         root.addChild(element);
 
-        // Test getting the namespace, localpart and prefix.  This should used not result
in expansion
+        // Test getting the local name and namespace URI. This should used not result in
expansion
         assertTrue(element.getLocalName().equals("library"));
         assertTrue(element.getNamespace().getNamespaceURI().equals(
                 "http://www.sosnoski.com/uwjws/library"));
-        assertTrue(element.getNamespace().getPrefix().equals("DUMMYPREFIX"));
 
         // Serialize and cache.  This should cause expansion.  The prefix should be updated
to match the testDocument string
         StringWriter writer = new StringWriter();
@@ -68,8 +67,6 @@ public class TestName1DefaultPrefix exte
                 "http://www.sosnoski.com/uwjws/library"));
         assertTrue(element.getNamespace().getPrefix().equals(""));
         assertTrue(element.getDefaultNamespace() != null);
-        assertTrue(result.indexOf("DUMMYPREFIX") <
-                0);  // Make sure that the serialized string does not contain DUMMYPREFIX
         assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);
 
         // Serialize again
@@ -84,8 +81,6 @@ public class TestName1DefaultPrefix exte
                 "http://www.sosnoski.com/uwjws/library"));
         assertTrue(element.getNamespace().getPrefix().equals(""));
         assertTrue(element.getDefaultNamespace() != null);
-        assertTrue(result.indexOf("DUMMYPREFIX") <
-                0);  // Make sure that the serialized string does not contain DUMMYPREFIX
         assertTrue("Serialized text error" + result, result.indexOf("1930110111") > 0);
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1QualifiedPrefix.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1QualifiedPrefix.java?rev=1334242&r1=1334241&r2=1334242&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1QualifiedPrefix.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestName1QualifiedPrefix.java
Fri May  4 22:32:31 2012
@@ -41,19 +41,18 @@ public class TestName1QualifiedPrefix ex
     protected void runTest() throws Throwable {
         OMFactory f = metaFactory.getOMFactory();
 
-        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses
the default prefix
+        // Create OMSE with an unknown prefix
         OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
-        OMNamespace ns = f.createOMNamespace("http://www.sosnoski.com/uwjws/library", "");
+        OMNamespace ns = f.createOMNamespace("http://www.sosnoski.com/uwjws/library", null);
         OMElement element =
                 f.createOMElement(new TestDataSource(testDocument2), "library", ns);
         OMElement root = f.createOMElement("root", rootNS);
         root.addChild(element);
 
-        // Test getting the namespace, localpart and prefix.  This should used not result
in expansion
+        // Test getting the local name and namespace URI. This should used not result in
expansion
         assertTrue(element.getLocalName().equals("library"));
         assertTrue(element.getNamespace().getNamespaceURI().equals(
                 "http://www.sosnoski.com/uwjws/library"));
-        assertTrue(element.getNamespace().getPrefix().equals(""));
 
         // Serialize and cache.  This should cause expansion and update the name to match
the testDocument string
         StringWriter writer = new StringWriter();



Mime
View raw message