You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2007/08/06 18:08:00 UTC
svn commit: r563179 - in /incubator/woden/trunk/java/test:
javax/xml/namespace/QNameDeserializeTest.java
javax/xml/namespace/QNameTest.java org/apache/woden/tests/AllWodenTests.java
Author: jkaputin
Date: Mon Aug 6 09:08:00 2007
New Revision: 563179
URL: http://svn.apache.org/viewvc?view=rev&rev=563179
Log:
WODEN-137
Split the QName deserialize test into a separate class
that can be seperately excluded from the maven build
(i.e. because this test fails on SUN JRE 1.5.0_12 due to a
bug in its QName implementation).
Added:
incubator/woden/trunk/java/test/javax/xml/namespace/QNameDeserializeTest.java
Modified:
incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java
incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java
Added: incubator/woden/trunk/java/test/javax/xml/namespace/QNameDeserializeTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/javax/xml/namespace/QNameDeserializeTest.java?view=auto&rev=563179
==============================================================================
--- incubator/woden/trunk/java/test/javax/xml/namespace/QNameDeserializeTest.java (added)
+++ incubator/woden/trunk/java/test/javax/xml/namespace/QNameDeserializeTest.java Mon Aug 6 09:08:00 2007
@@ -0,0 +1,69 @@
+package javax.xml.namespace;
+
+/**
+ * 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.
+ */
+
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.net.URL;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+// * junit test for deserializing with the QName class.
+ *
+ * @author jkaputin@apache.org
+ */
+public class QNameDeserializeTest extends TestCase {
+
+ private static final String emptyString = "";
+ private QName qname;
+
+ public static Test suite()
+ {
+ return new TestSuite(QNameDeserializeTest.class);
+ }
+
+ public void testGoodDeserializeQNameWithoutPrefix() throws IOException,
+ ClassNotFoundException, Exception
+ {
+ /*
+ * Test that 'prefix' is initialized correctly when deserializing a v1.0 QName.
+ * The v1.0 QName does not have a 'prefix' field, so when it's deserialized using
+ * the v1.1 QName, its 'prefix' field should be set to the empty string "", not
+ * just initialized as null.
+ *
+ * The input to this testcase is a file containing a v1.0 QName serialized
+ * from the WSDL4J version of QName.
+ */
+
+ URL url = getClass().getClassLoader().getResource("javax/xml/namespace/serialized_QName_no_prefix");
+
+ ObjectInputStream ois =
+ new ObjectInputStream(url.openStream());
+
+ Object o = ois.readObject();
+ qname = (QName)o;
+
+ assertTrue("Expected a null 'prefix' to be initialized to the empty string \"\".",
+ qname.getPrefix() != null && qname.getPrefix().equals(emptyString));
+
+ }
+}
Modified: incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java?view=diff&rev=563179&r1=563178&r2=563179
==============================================================================
--- incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java (original)
+++ incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java Mon Aug 6 09:08:00 2007
@@ -450,34 +450,7 @@
qnameCopy.getLocalPart().equals("myLocalPart") &&
qnameCopy.getPrefix().equals("myPrefix")));
- }
-
- public void testGoodDeserializeQNameWithoutPrefix() throws IOException,
- ClassNotFoundException, Exception
- {
- /*
- * Test that 'prefix' is initialized correctly when deserializing a v1.0 QName.
- * The v1.0 QName does not have a 'prefix' field, so when it's deserialized using
- * the v1.1 QName, its 'prefix' field should be set to the empty string "", not
- * just initialized as null.
- *
- * The input to this testcase is a file containing a v1.0 QName serialized
- * from the WSDL4J version of QName.
- */
-
- URL url = getClass().getClassLoader().getResource("javax/xml/namespace/serialized_QName_no_prefix");
-
- ObjectInputStream ois =
- new ObjectInputStream(url.openStream());
-
- Object o = ois.readObject();
- qname = (QName)o;
-
- assertTrue("Expected a null 'prefix' to be initialized to the empty string \"\".",
- qname.getPrefix() != null && qname.getPrefix().equals(emptyString));
-
- }
-
+ }
/* ************************************************
* Tests for equals(obj) method
Modified: incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java?view=diff&rev=563179&r1=563178&r2=563179
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTests.java Mon Aug 6 09:08:00 2007
@@ -16,6 +16,7 @@
*/
package org.apache.woden.tests;
+import javax.xml.namespace.QNameDeserializeTest;
import javax.xml.namespace.QNameTest;
import junit.framework.Test;
@@ -60,6 +61,7 @@
* run the Woden junit tests for this class.
*/
addTest(QNameTest.suite());
+ addTest(QNameDeserializeTest.suite());
}
addTest(AllWodenTestsDOM.suite());
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org