Author: bimargulies Date: Fri Nov 14 17:19:44 2008 New Revision: 714206 URL: http://svn.apache.org/viewvc?rev=714206&view=rev Log: Run all the tests from the plain 'test' package from mvn. Fix the TestSimpleRestriction test. add a default goal of install to the pom.
Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/build.xml webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/pom.xml webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchema.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnnotationTest.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnyTest.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/RecursiveImportTest.java webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/TestSimpleRestriction.java Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/build.xml URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/build.xml?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/build.xml (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/build.xml Fri Nov 14 17:19:44 2008 @@ -53,9 +53,11 @@ </target> <target name="get-deps" if="downloadLibs"> - <get src="http://www.ibiblio.org/maven2/xmlunit/xmlunit/1.0/xmlunit-1.0.jar" - dest="${build_lib.dir}/xmlunit-1.0.jar"/> - </target> + <get src="http://www.ibiblio.org/maven2/xmlunit/xmlunit/1.0/xmlunit-1.0.jar" + dest="${build_lib.dir}/xmlunit-1.0.jar"/> + <get src="http://mirrors.ibiblio.org/pub/mirrors/maven2/junit/junit/3.8.2/junit-3.8.2.jar" + dest="${build_lib.dir}/junit-3.8.2.jar"/> + </target> <target name="prepare-tests"> <mkdir dir="${test_classes.dir}"/> Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/pom.xml URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/pom.xml?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/pom.xml (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/pom.xml Fri Nov 14 17:19:44 2008 @@ -149,12 +149,13 @@ <configuration> <includes> <include>**/*Test.java</include> + <include>**/Test*.java</include> <!-- Fails in about half of the tests <include>tests/w3c/TestW3CSchemaBucket.java</include> --> </includes> <excludes> - <exclude>tests/w3c/SchemaTest.java</exclude> + <exclude>tests/w3c/**.java</exclude> </excludes> </configuration> </plugin> @@ -164,7 +165,7 @@ <descriptors> <descriptor>src/main/assembly/bin.xml</descriptor> <descriptor>src/main/assembly/src.xml</descriptor> - <descriptor>src/main/assembly/doc.xml</descriptor> + <descriptor>src/main/assembly/doc.xml</descriptor> </descriptors> <tarLongFileMode>gnu</tarLongFileMode> </configuration> @@ -184,6 +185,7 @@ </plugin> </plugins> + <defaultGoal>install</defaultGoal> </build> <profiles> <profile> @@ -228,13 +230,14 @@ <configuration> <includes> <include>**/*Test.java</include> + <include>**/Test*.java</include> <!-- Fails in about half of the tests <include>tests/w3c/TestW3CSchemaBucket.java</include> --> </includes> <excludes> <exclude> - tests/w3c/SchemaTest.java + tests/w3c/**.java </exclude> </excludes> <systemProperties> Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchema.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchema.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchema.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchema.java Fri Nov 14 17:19:44 2008 @@ -28,7 +28,6 @@ import javax.xml.transform.*; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; import java.io.*; import java.util.Map; import java.util.HashMap; Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java Fri Nov 14 17:19:44 2008 @@ -19,34 +19,40 @@ package org.apache.ws.commons.schema; +import java.io.IOException; +import java.io.Reader; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Source; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; + import org.apache.ws.commons.schema.constants.Constants; import org.apache.ws.commons.schema.extensions.ExtensionRegistry; import org.apache.ws.commons.schema.resolver.DefaultURIResolver; import org.apache.ws.commons.schema.resolver.URIResolver; +import org.apache.ws.commons.schema.utils.DOMUtil; import org.apache.ws.commons.schema.utils.NamespacePrefixList; import org.apache.ws.commons.schema.utils.TargetNamespaceValidator; -import org.apache.ws.commons.schema.utils.DOMUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.sax.SAXSource; -import javax.xml.transform.stream.StreamSource; -import java.io.IOException; -import java.io.Reader; -import java.util.*; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; - /** * Contains a cache of XML Schema definition language (XSD). * Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java Fri Nov 14 17:19:44 2008 @@ -48,6 +48,11 @@ finalDerivation = new XmlSchemaDerivationMethod(Constants.BlockConstants.NONE); } + /** + * This function returns null. It is intended at some point to return the base type in the event of a restriction, + * but that functionality is not implemented. + * @return null + */ public Object getBaseSchemaType() { return baseSchemaType; } Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnnotationTest.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnnotationTest.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnnotationTest.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnnotationTest.java Fri Nov 14 17:19:44 2008 @@ -59,7 +59,7 @@ "emptyAppinfo"); InputStream is = new FileInputStream(Resources.asURI("annotation.xsd")); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); - XmlSchema schema = schemaCol.read(new StreamSource(is), null); + schemaCol.read(new StreamSource(is), null); XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(TYPE_QNAME); @@ -125,7 +125,7 @@ "emptyDocumentation"); InputStream is = new FileInputStream(Resources.asURI("annotation.xsd")); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); - XmlSchema schema = schemaCol.read(new StreamSource(is), null); + schemaCol.read(new StreamSource(is), null); XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(TYPE_QNAME); @@ -189,7 +189,7 @@ "emptyAppinfoDocumentation"); InputStream is = new FileInputStream(Resources.asURI("annotation.xsd")); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); - XmlSchema schema = schemaCol.read(new StreamSource(is), null); + schemaCol.read(new StreamSource(is), null); XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(TYPE_QNAME); @@ -227,7 +227,7 @@ "annotationTest"); InputStream is = new FileInputStream(Resources.asURI("annotation.xsd")); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); - XmlSchema schema = schemaCol.read(new StreamSource(is), null); + schemaCol.read(new StreamSource(is), null); XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)schemaCol.getTypeByQName(TYPE_QNAME); Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnyTest.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnyTest.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnyTest.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/AnyTest.java Fri Nov 14 17:19:44 2008 @@ -82,7 +82,7 @@ "department"); InputStream is = new FileInputStream(Resources.asURI("any.xsd")); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); - XmlSchema schema = schemaCol.read(new StreamSource(is), null); + schemaCol.read(new StreamSource(is), null); verifyAccuracy(ELEMENT_QNAME, schemaCol,5L,10L); @@ -121,7 +121,7 @@ schema.write(baos); XmlSchemaCollection schemaCol2 = new XmlSchemaCollection(); - XmlSchema schema2 = schemaCol2.read(new StreamSource(new ByteArrayInputStream(baos.toByteArray())), null); + schemaCol2.read(new StreamSource(new ByteArrayInputStream(baos.toByteArray())), null); verifyAccuracy(ELEMENT_QNAME, schemaCol2,0,0); Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/RecursiveImportTest.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/RecursiveImportTest.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/RecursiveImportTest.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/RecursiveImportTest.java Fri Nov 14 17:19:44 2008 @@ -26,7 +26,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.namespace.QName; -import java.io.File; public class RecursiveImportTest extends TestCase { Modified: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/TestSimpleRestriction.java URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/TestSimpleRestriction.java?rev=714206&r1=714205&r2=714206&view=diff ============================================================================== --- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/TestSimpleRestriction.java (original) +++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/TestSimpleRestriction.java Fri Nov 14 17:19:44 2008 @@ -21,6 +21,8 @@ import junit.framework.TestCase; import org.apache.ws.commons.schema.XmlSchemaCollection; import org.apache.ws.commons.schema.XmlSchemaElement; +import org.apache.ws.commons.schema.XmlSchemaSimpleType; +import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction; import org.apache.ws.commons.schema.XmlSchemaType; import javax.xml.namespace.QName; @@ -55,8 +57,10 @@ schema.read(new StreamSource(is), null); XmlSchemaType principalId = schema.getTypeByQName(new QName("", "XdwsPrincipalId")); assertNotNull(principalId); - XmlSchemaType groupId = schema.getTypeByQName(new QName("", "XdwsGroupId")); + XmlSchemaSimpleType groupId = (XmlSchemaSimpleType)schema.getTypeByQName(new QName("", "XdwsGroupId")); assertNotNull(groupId); - assertEquals(groupId.getBaseSchemaType(), principalId); + QName baseName = ((XmlSchemaSimpleTypeRestriction)groupId.getContent()).getBaseTypeName(); + + assertEquals(principalId.getQName(), baseName); } }