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 hu...@apache.org on 2006/07/11 13:15:46 UTC
svn commit: r420800 [1/2] - in /incubator/woden/java: ./
src/org/apache/woden/internal/ src/org/apache/woden/internal/util/om/
test/org/apache/woden/ test/org/apache/woden/tests/
test/org/apache/woden/wsdl20/xml/
Author: hughesj
Date: Tue Jul 11 04:15:45 2006
New Revision: 420800
URL: http://svn.apache.org/viewvc?rev=420800&view=rev
Log:
WODEN-37: commit Oshani's patch for OM based parsing. Thanks Oshani!
Added:
incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java
incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java
incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java
incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java
incubator/woden/java/test/org/apache/woden/tests/OMW3CTestSuiteTest.java
incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMEndpointElementTest.java
incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
Modified:
incubator/woden/java/.classpath
incubator/woden/java/build.properties
incubator/woden/java/build.xml
incubator/woden/java/src/org/apache/woden/internal/OMWSDLReader.java
incubator/woden/java/src/org/apache/woden/internal/util/om/OMUtils.java
incubator/woden/java/test/org/apache/woden/tests/AllWodenTests.java
incubator/woden/java/test/org/apache/woden/tests/W3CFileRepository.java
Modified: incubator/woden/java/.classpath
URL: http://svn.apache.org/viewvc/incubator/woden/java/.classpath?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/.classpath (original)
+++ incubator/woden/java/.classpath Tue Jul 11 04:15:45 2006
@@ -12,5 +12,9 @@
<classpathentry kind="lib" path="downloads/lib/wsdl4j.jar"/>
<classpathentry kind="lib" path="downloads/lib/axiom-api-1.0.jar"/>
<classpathentry kind="lib" path="downloads/lib/stax-api-1.0.1.jar"/>
+ <classpathentry kind="lib" path="downloads/lib/commons-logging-1.0.4.jar"/>
+ <classpathentry kind="lib" path="downloads/lib/axiom-impl-1.0.jar"/>
+ <classpathentry kind="lib" path="downloads/lib/commons-logging-api-1.1.jar"/>
+ <classpathentry kind="lib" path="downloads/lib/wstx-asl-2.9.3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: incubator/woden/java/build.properties
URL: http://svn.apache.org/viewvc/incubator/woden/java/build.properties?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/build.properties (original)
+++ incubator/woden/java/build.properties Tue Jul 11 04:15:45 2006
@@ -27,11 +27,16 @@
AntJar = ant.jar
WSDL4JURL = http://superb-west.dl.sourceforge.net/sourceforge/wsdl4j/wsdl4j-bin-1.5.2.zip
WSDL4JFile = wsdl4j-bin-1.5.2.zip
-AxiomURL = http://www.apache.org/dist/ws/commons/axiom/1_0/axiom-1.0-bin.zip
-AxiomFile = axiom-1.0-bin.zip
-AxiomJar = axiom-api-1.0.jar
+AxiomApiURL = http://www.apache.org/dist/java-repository/ws-commons/jars/axiom-api-1.0.jar
+AxiomApiFile = axiom-api-1.0.jar
+AxiomImplURL = http://www.apache.org/dist/java-repository/ws-commons/jars/axiom-impl-1.0.jar
+AxiomImplFile = axiom-impl-1.0.jar
+CommonsLoggingURL = http://apache.osuosl.org/java-repository/commons-logging/jars/commons-logging-api-1.1.jar
+CommonsLoggingFile = commons-logging-api-1.1.jar
StaxURL = http://www.ibiblio.org/maven/stax/jars/stax-api-1.0.1.jar
StaxFile = stax-api-1.0.1.jar
+WstxURL = http://mirrors.dotsrc.org/maven/woodstox/jars/wstx-asl-2.9.3.jar
+WstxFile = wstx-asl-2.9.3.jar
! The location of the Woden build home
build.home = ${basedir}
@@ -53,4 +58,4 @@
ant.name = woden-ant
! Woden Archive name
-archive.name = woden-incubating
\ No newline at end of file
+archive.name = woden-incubating
Modified: incubator/woden/java/build.xml
URL: http://svn.apache.org/viewvc/incubator/woden/java/build.xml?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/build.xml (original)
+++ incubator/woden/java/build.xml Tue Jul 11 04:15:45 2006
@@ -24,7 +24,6 @@
<property name="build.home" value="." />
<property name="build.output" value="${build.home}/build" />
<property name="version" value="1.0.0" />
-
<property name="downloads" value="${build.home}/downloads" />
<property name="libraryDir" value="${downloads}/lib" />
<property name="build.classes" value="${build.output}/classes" />
@@ -71,11 +70,16 @@
<echo message="AntJar=${AntJar}" />
<echo message="WSDL4JURL=${WSDL4JURL}" />
<echo message="WSDL4JFile=${WSDL4JFile}" />
- <echo message="AxiomURL=${AxiomURL}" />
- <echo message="AxiomFile=${AxiomFile}" />
- <echo message="AxiomJar=${AxiomJar}" />
+ <echo message="AxiomApiURL=${AxiomApiURL}" />
+ <echo message="AxiomApiFile=${AxiomApiFile}" />
+ <echo message="AxiomImplURL=${AxiomImplURL}" />
+ <echo message="AxiomImplFile=${AxiomImplFile}" />
+ <echo message="CommonsLoggingURL=${CommonsLoggingURL}" />
+ <echo message="CommonsLoggingFile=${CommonsLoggingFile}" />
<echo message="StaxURL=${StaxURL}" />
<echo message="StaxFile=${StaxFile}" />
+ <echo message="WstxURL=${WstxURL}" />
+ <echo message="WstxFile=${WstxFile}" />
<echo message="build.home=${build.home}" />
<echo message="version=${version}" />
<echo message="milestone=${milestone}" />
@@ -117,17 +121,23 @@
<available file="${downloads}/${XercesFile}" property="Xerces.exists" />
<available file="${downloads}/${AntFile}" property="Ant.exists" />
<available file="${downloads}/${WSDL4JFile}" property="WSDL4J.exists" />
- <available file="${downloads}/${AxiomFile}" property="Axiom.exists" />
- <!-- The Stax 1.0.x API jar is only available in jar form, not zip
- so we download it straight into the libraryDir -->
+
+ <!-- The following jars are downloaded straight into the libraryDir -->
+ <available file="${libraryDir}/${AxiomApiFile}" property="AxiomApi.exists" />
+ <available file="${libraryDir}/${AxiomImplFile}" property="AxiomImpl.exists" />
+ <available file="${libraryDir}/${CommonsLoggingFile}" property="CommonsLogging.exists" />
<available file="${libraryDir}/${StaxFile}" property="Stax.exists" />
+ <available file="${libraryDir}/${WstxFile}" property="Wstx.exists" />
<antcall target="getXmlSchema" />
<antcall target="getXerces" />
<antcall target="getAnt" />
<antcall target="getWSDL4J" />
- <antcall target="getAxiom" />
+ <antcall target="getAxiomApi" />
+ <antcall target="getAxiomImpl" />
+ <antcall target="getCommonsLogging" />
<antcall target="getStax" />
+ <antcall target="getWstx" />
<antcall target="extractXmlSchema" />
@@ -186,22 +196,31 @@
</unzip>
</target>
- <!-- Get the latest version of Axiom and unzip it -->
- <target name="getAxiom" unless="Axiom.exists">
- <get src="${AxiomURL}" dest="${downloads}/${AxiomFile}" />
+ <!-- Get the latest version of Axiom Api jar -->
+ <target name="getAxiomApi" unless="AxiomApi.exists">
+ <get src="${AxiomApiURL}" dest="${libraryDir}/${AxiomApiFile}" />
+ </target>
- <unzip src="${downloads}/${AxiomFile}" dest="${libraryDir}">
- <patternset>
- <include name="**/${AxiomJar}" />
- </patternset>
- </unzip>
+ <!-- Get the latest version of Axiom Impl jar -->
+ <target name="getAxiomImpl" unless="AxiomImpl.exists">
+ <get src="${AxiomImplURL}" dest="${libraryDir}/${AxiomImplFile}" />
+ </target>
+
+ <!-- Get the latest version of Commons Logging Api jar -->
+ <target name="getCommonsLogging" unless="CommonsLogging.exists">
+ <get src="${CommonsLoggingURL}" dest="${libraryDir}/${CommonsLoggingFile}" />
</target>
- <!-- Get the latest version of Stax API and unzip it -->
+ <!-- Get the latest version of Stax API jar -->
<target name="getStax" unless="Stax.exists">
<get src="${StaxURL}" dest="${libraryDir}/${StaxFile}" />
</target>
+ <!-- Get the latest version of Wstx API jar -->
+ <target name="getWstx" unless="Wstx.exists">
+ <get src="${WstxURL}" dest="${libraryDir}/${WstxFile}" />
+ </target>
+
<!-- Copy the XmlSchema file to the lib dir -->
<target name="extractXmlSchema">
<copy file="${downloads}/${XmlSchemaFile}" todir="${libraryDir}" />
@@ -238,7 +257,7 @@
This task produces woden-api.jar. -->
<target name="buildAPI" depends="init">
<mkdir dir="${build.classes.api}" />
- <javac sourcepath="" srcdir="${src.home}" destdir="${build.classes.api}" classpath="${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2}">
+ <javac sourcepath="" srcdir="${src.home}" destdir="${build.classes.api}" classpath="${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2};${libraryDir}/${AxiomApiFile};${libraryDir}/${AxiomImplFile};${libraryDir}/${CommonsLoggingFile};${libraryDir}/${StaxFile};${libraryDir}/${WstxFile}">
<include name="**/*.java" />
<exclude name="**/internal/**/*.java" />
<exclude name="**/tool/converter/*.java" />
@@ -262,8 +281,8 @@
This task produces woden-ant.jar. -->
<target name="buildANT" depends="init">
<mkdir dir="${build.classes.ant}" />
- <javac sourcepath="" srcdir="${src.home}" destdir="${build.classes.ant}" classpath="${build.output}/${impl.name}.jar;${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2}">
- <include name="org/apache/woden/ant/**/*.java"/>
+ <javac sourcepath="" srcdir="${src.home}" destdir="${build.classes.ant}" classpath="${build.output}/${impl.name}.jar;${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2};${libraryDir}/${AxiomApiFile};${libraryDir}/${AxiomImplFile};${libraryDir}/${CommonsLoggingFile};${libraryDir}/${StaxFile};${libraryDir}/${WstxFile}">
+ <include name="org/apache/woden/ant/**/*.java"/>
</javac>
<!-- Copy all non Java files. -->
<copy todir="${build.classes.ant}">
@@ -290,7 +309,7 @@
This task produces woden-tests.jar. -->
<target name="buildTests" depends="init, informJunit, buildImplAndAPI" if="junitAvailable">
<mkdir dir="${build.classes.test}" />
- <javac sourcepath="" srcdir="${testsrc.home}" destdir="${build.classes.test}" classpath="${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2};${build.output}/${impl.name}.jar" />
+ <javac sourcepath="" srcdir="${testsrc.home}" destdir="${build.classes.test}" classpath="${libraryDir}/${XmlSchemaFile};${libraryDir}/${XercesJar1};${libraryDir}/${XercesJar2};${libraryDir}/${AxiomApiFile};${libraryDir}/${AxiomImplFile};${libraryDir}/${CommonsLoggingFile};${libraryDir}/${StaxFile};${libraryDir}/${WstxFile};${build.output}/${impl.name}.jar" />
<!-- Copy all non Java files. -->
<copy todir="${build.classes.test}">
<fileset dir="${testsrc.home}">
@@ -317,26 +336,80 @@
</javadoc>
</target>
+ <!-- Tests for both DOM and StAX/OM parsers-->
<target name="runTests" depends="init, informJunit, buildTests" if="junitAvailable">
-
<mkdir dir="${test.results}" />
-
<junit>
<classpath>
<pathelement location="${build.classes}" />
<pathelement location="${build.classes.test}" />
<pathelement location="${libraryDir}/${XmlSchemaFile}" />
+ <pathelement location="${libraryDir}/${AxiomImplFile}" />
+ <pathelement location="${libraryDir}/${AxiomApiFile}" />
+ <pathelement location="${libraryDir}/${CommonsLoggingFile}" />
+ <pathelement location="${libraryDir}/${StaxFile}" />
+ <pathelement location="${libraryDir}/${WstxFile}" />
<pathelement location="${libraryDir}/${XercesJar1}" />
<pathelement location="${libraryDir}/${XercesJar2}" />
</classpath>
-
<test name="org.apache.woden.tests.AllWodenTests" haltonfailure="no" outfile="woden-${buildId}-test-results" todir="${test.results}">
<formatter type="xml" />
</test>
</junit>
+ <mkdir dir="${test.results}/html" />
+ <junitreport tofile="woden-${buildId}-test-results.html">
+ <fileset dir="${test.results}">
+ <include name="*.xml" />
+ </fileset>
+ <report format="noframes" todir="${test.results}/html" />
+ </junitreport>
+ </target>
+ <!-- Tests for DOM alone-->
+ <target name="runTestsDOM" depends="init, informJunit, buildTests" if="junitAvailable">
+ <mkdir dir="${test.results}" />
+ <junit>
+ <classpath>
+ <pathelement location="${build.classes}" />
+ <pathelement location="${build.classes.test}" />
+ <pathelement location="${libraryDir}/${XmlSchemaFile}" />
+ <pathelement location="${libraryDir}/${XercesJar1}" />
+ <pathelement location="${libraryDir}/${XercesJar2}" />
+ </classpath>
+ <test name="org.apache.woden.tests.AllWodenTestsDOM" haltonfailure="no" outfile="woden-${buildId}-test-results" todir="${test.results}">
+ <formatter type="xml" />
+ </test>
+ </junit>
<mkdir dir="${test.results}/html" />
+ <junitreport tofile="woden-${buildId}-test-results.html">
+ <fileset dir="${test.results}">
+ <include name="*.xml" />
+ </fileset>
+ <report format="noframes" todir="${test.results}/html" />
+ </junitreport>
+ </target>
+ <!-- Tests for StAX/OM alone-->
+ <target name="runTestsOM" depends="init, informJunit, buildTests" if="junitAvailable">
+ <mkdir dir="${test.results}" />
+ <junit>
+ <classpath>
+ <pathelement location="${build.classes}" />
+ <pathelement location="${build.classes.test}" />
+ <pathelement location="${libraryDir}/${XmlSchemaFile}" />
+ <pathelement location="${libraryDir}/${AxiomApiFile}" />
+ <pathelement location="${libraryDir}/${AxiomImplFile}" />
+ <pathelement location="${libraryDir}/${CommonsLoggingFile}" />
+ <pathelement location="${libraryDir}/${StaxFile}" />
+ <pathelement location="${libraryDir}/${WstxFile}" />
+ <pathelement location="${libraryDir}/${XercesJar1}" />
+ <pathelement location="${libraryDir}/${XercesJar2}" />
+ </classpath>
+ <test name="org.apache.woden.tests.AllWodenTestsOM" haltonfailure="no" outfile="woden-${buildId}-test-results" todir="${test.results}">
+ <formatter type="xml" />
+ </test>
+ </junit>
+ <mkdir dir="${test.results}/html" />
<junitreport tofile="woden-${buildId}-test-results.html">
<fileset dir="${test.results}">
<include name="*.xml" />
@@ -421,4 +494,4 @@
<delete dir="${build.output}" />
</target>
-</project>
\ No newline at end of file
+</project>
Modified: incubator/woden/java/src/org/apache/woden/internal/OMWSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/src/org/apache/woden/internal/OMWSDLReader.java?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/OMWSDLReader.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/OMWSDLReader.java Tue Jul 11 04:15:45 2006
@@ -15,38 +15,65 @@
*/
package org.apache.woden.internal;
-import org.apache.woden.wsdl20.xml.*;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
-import org.apache.woden.wsdl20.enumeration.Direction;
-import org.apache.woden.wsdl20.enumeration.MessageLabel;
-import org.apache.woden.*;
-import org.apache.woden.types.NCName;
-import org.apache.woden.schema.Schema;
+import java.io.ByteArrayInputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.woden.ErrorHandler;
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLSource;
+import org.apache.woden.internal.schema.ImportedSchemaImpl;
+import org.apache.woden.internal.schema.InlinedSchemaImpl;
+import org.apache.woden.internal.schema.SchemaConstants;
+import org.apache.woden.internal.util.StringUtils;
import org.apache.woden.internal.util.om.OMUtils;
import org.apache.woden.internal.util.om.QNameUtils;
-import org.apache.woden.internal.util.StringUtils;
import org.apache.woden.internal.wsdl20.Constants;
-import org.apache.woden.internal.schema.SchemaConstants;
-import org.apache.woden.internal.schema.InlinedSchemaImpl;
-import org.apache.woden.internal.schema.ImportedSchemaImpl;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
+import org.apache.woden.schema.Schema;
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.enumeration.Direction;
+import org.apache.woden.wsdl20.enumeration.MessageLabel;
+import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
+import org.apache.woden.wsdl20.xml.BindingElement;
+import org.apache.woden.wsdl20.xml.BindingFaultElement;
+import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingOperationElement;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.EndpointElement;
+import org.apache.woden.wsdl20.xml.FeatureElement;
+import org.apache.woden.wsdl20.xml.ImportElement;
+import org.apache.woden.wsdl20.xml.IncludeElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+import org.apache.woden.wsdl20.xml.PropertyElement;
+import org.apache.woden.wsdl20.xml.ServiceElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaException;
import org.xml.sax.InputSource;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.*;
-import java.io.ByteArrayInputStream;
-
/**
* Implements WSDL reader behaviour for OM based parsing
*/
@@ -71,8 +98,14 @@
throw new WSDLException(WSDLException.PARSER_ERROR, msg, e);
}
- String wsdlURL = url.toString();
- OMElement wsdlDescription = OMUtils.getElement(wsdlURI);
+ //This is needed because StAXOMBuilder expects a URI to read a WSDL
+ int index = wsdlURI.indexOf(':');
+ String wsdlURL = (index != -1)
+ ? wsdlURI
+ : ("file://"+wsdlURI);
+
+ OMElement wsdlDescription = OMUtils.getElement(wsdlURL);
+
return parseDescription(wsdlURL, wsdlDescription, null);
}
@@ -144,7 +177,18 @@
else if (QNameUtils.matches(Constants.Q_ELEM_SERVICE, wsdlComponent)){
desc.addServiceElement(parseService(wsdlComponent, desc));
}
- //todo: Add parsing for includes & imports
+ else if (QNameUtils.matches(Constants.Q_ELEM_IMPORT, wsdlComponent)){
+ if(documentBaseURI != null && !wsdlModules.containsKey(documentBaseURI)){
+ wsdlModules.put(documentBaseURI, desc);
+ }
+ desc.addImportElement(parseImport(wsdlComponent, desc, wsdlModules));
+ }
+ else if (QNameUtils.matches(Constants.Q_ELEM_INCLUDE, wsdlComponent)){
+ if(documentBaseURI != null && !wsdlModules.containsKey(documentBaseURI)){
+ wsdlModules.put(documentBaseURI, desc);
+ }
+ desc.addIncludeElement(parseInclude(wsdlComponent, desc, wsdlModules));
+ }
else{
desc.addExtensionElement(parseExtensionElement(DescriptionElement.class, desc, wsdlComponent, desc) );
}
@@ -229,8 +273,17 @@
QName intfaceQN;
String intface = OMUtils.getAttribute(serviceEl, Constants.ATTR_INTERFACE);
if(intface != null){
- intfaceQN = OMUtils.getQName(intface, serviceEl, desc);
- service.setInterfaceName(intfaceQN);
+ try{
+ intfaceQN = OMUtils.getQName(intface, serviceEl);
+ service.setInterfaceName(intfaceQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ serviceEl.getLocalName(),
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
parseExtensionAttributes(serviceEl, ServiceElement.class, service, desc);
@@ -276,8 +329,17 @@
QName bindingQN;
String binding = OMUtils.getAttribute(endpointEl, Constants.ATTR_BINDING);
if(binding != null){
- bindingQN = OMUtils.getQName(binding, endpointEl, desc);
- endpoint.setBindingName(bindingQN);
+ try{
+ bindingQN = OMUtils.getQName(binding, endpointEl);
+ endpoint.setBindingName(bindingQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {binding, QNameUtils.newQName(endpointEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
String address = OMUtils.getAttribute(endpointEl, Constants.ATTR_ADDRESS);
@@ -323,8 +385,17 @@
QName intfaceQN = null;
String intface = OMUtils.getAttribute(bindEl, Constants.ATTR_INTERFACE);
if(intface != null){
- intfaceQN = OMUtils.getQName(intface, bindEl, desc);
- binding.setInterfaceName(intfaceQN);
+ try{
+ intfaceQN = OMUtils.getQName(intface, bindEl);
+ binding.setInterfaceName(intfaceQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {intface, QNameUtils.newQName(bindEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
String type = OMUtils.getAttribute(bindEl, Constants.ATTR_TYPE);
@@ -362,9 +433,9 @@
private BindingOperationElement parseBindingOperation(OMElement bindOpEl,
- DescriptionElement desc,
- WSDLElement parent)
- throws WSDLException{
+ DescriptionElement desc,
+ WSDLElement parent)
+ throws WSDLException{
BindingOperationElement oper = desc.createBindingOperationElement();
oper.setParentElement(parent);
@@ -372,8 +443,17 @@
QName refQN = null;
String ref = OMUtils.getAttribute(bindOpEl, Constants.ATTR_REF);
if(ref != null){
- refQN = OMUtils.getQName(ref, bindOpEl, desc);
- oper.setRef(refQN);
+ try{
+ refQN = OMUtils.getQName(ref, bindOpEl);
+ oper.setRef(refQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {ref, QNameUtils.newQName(bindOpEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
parseExtensionAttributes(bindOpEl, BindingOperationElement.class, oper, desc);
@@ -424,8 +504,17 @@
QName refQN = null;
String ref = OMUtils.getAttribute(faultRefEl, Constants.ATTR_REF);
if(ref != null){
- refQN = OMUtils.getQName(ref, faultRefEl, desc);
- faultRef.setRef(refQN);
+ try{
+ refQN = OMUtils.getQName(ref, faultRefEl);
+ faultRef.setRef(refQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {ref, QNameUtils.newQName(faultRefEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
String msgLabel = OMUtils.getAttribute(faultRefEl, Constants.ATTR_MESSAGE_LABEL);
@@ -538,8 +627,17 @@
QName intFltQN = null;
String ref = OMUtils.getAttribute(bindFaultEl, Constants.ATTR_REF);
if(ref != null){
- intFltQN = OMUtils.getQName(ref, bindFaultEl, desc);
- fault.setRef(intFltQN);
+ try{
+ intFltQN = OMUtils.getQName(ref, bindFaultEl);
+ fault.setRef(intFltQN);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {ref, QNameUtils.newQName(bindFaultEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
parseExtensionAttributes(bindFaultEl, BindingFaultElement.class, fault, desc);
@@ -591,7 +689,7 @@
Iterator it = stringList.iterator();
while(it.hasNext()){
qnString = (String)it.next();
- intface.addExtendedInterfaceName(OMUtils.getQName(qnString, interfaceEl, desc));
+ intface.addExtendedInterfaceName(OMUtils.getQName(qnString, interfaceEl));
}
}
@@ -709,8 +807,17 @@
String ref = OMUtils.getAttribute(faultRefEl, Constants.ATTR_REF);
if(ref != null){
- QName qname = OMUtils.getQName(ref, faultRefEl, desc);
- faultRef.setRef(qname);
+ try{
+ QName qname = OMUtils.getQName(ref, faultRefEl);
+ faultRef.setRef(qname);
+ }
+ catch(WSDLException e){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(),
+ "WSDL505",
+ new Object[] {ref, QNameUtils.newQName(faultRefEl)},
+ ErrorReporter.SEVERITY_ERROR);
+ }
}
String msgLabel = OMUtils.getAttribute(faultRefEl, Constants.ATTR_MESSAGE_LABEL);
@@ -800,7 +907,7 @@
else{
//element is not #any, #none or #other, so it must be an element qname
message.setMessageContentModel(Constants.NMTOKEN_ELEMENT);
- QName qname = OMUtils.getQName(element, msgRefEl, desc);
+ QName qname = OMUtils.getQName(element, msgRefEl);
message.setElementName(qname);
}
}
@@ -856,7 +963,7 @@
if(element != null){
try {
- QName qname = OMUtils.getQName(element, faultEl, desc);
+ QName qname = OMUtils.getQName(element, faultEl);
fault.setElementName(qname);
}
catch (WSDLException e) {
@@ -1064,7 +1171,6 @@
throws WSDLException{
InlinedSchemaImpl schema = new InlinedSchemaImpl();
-
schema.setId(OMUtils.getAttribute(schemaElement, Constants.ATTR_ID));
String tns = OMUtils.getAttribute(schemaElement, Constants.ATTR_TARGET_NAMESPACE);
if(tns != null) {
@@ -1073,15 +1179,26 @@
String baseURI = desc.getDocumentBaseURI() != null ?
desc.getDocumentBaseURI().toString() : null;
+
XmlSchema schemaDef = null;
try {
InputSource schemaSource = OMUtils.getInputSource(schemaElement);
XmlSchemaCollection xsc = new XmlSchemaCollection();
- schemaDef = xsc.read(schemaSource, null); //todo This schema does not include the other namespaces
- // as attributes as in the DOMWSDLREader
+
+ //Set the baseURI and the namespaces from the DescriptionElement in the XMLSchemaCollection
+ xsc.setBaseUri(baseURI);
+ Iterator prefixKeySet = desc.getNamespaces().keySet().iterator();
+ Object prefix;
+ while (prefixKeySet.hasNext()){
+ prefix = prefixKeySet.next();
+ String namespace = desc.getNamespaces().get(prefix).toString();
+ xsc.mapNamespace(prefix.toString(),namespace);
+ }
+ schemaDef = xsc.read(schemaSource, null);
}
catch (XmlSchemaException e){
+
getErrorReporter().reportError(
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL521",
@@ -1089,7 +1206,6 @@
ErrorReporter.SEVERITY_WARNING,
e);
}
-
if(schemaDef != null) {
schema.setSchemaDefinition(schemaDef);
}
@@ -1147,6 +1263,53 @@
return feature;
}
+ private ImportElement parseImport(OMElement importEl,
+ DescriptionElement desc,
+ Map wsdlModules)
+ throws WSDLException{
+ ImportElement imp = desc.createImportElement();
+
+ String namespaceURI = OMUtils.getAttribute(importEl, Constants.ATTR_NAMESPACE);
+ String locationURI = OMUtils.getAttribute(importEl, Constants.ATTR_LOCATION);
+
+ parseExtensionAttributes(importEl, ImportElement.class, imp, desc);
+
+ if(namespaceURI != null){
+ //TODO handle missing namespace attribute (REQUIRED attr)
+ imp.setNamespace(getURI(namespaceURI));
+ }
+
+ if(locationURI != null){
+ //TODO handle missing locationURI (OPTIONAL attr)
+ imp.setLocation(getURI(locationURI));
+ DescriptionElement importedDesc =
+ getWSDLFromLocation(locationURI, desc, wsdlModules);
+ imp.setDescriptionElement(importedDesc);
+ }
+
+ return imp;
+ }
+
+ private IncludeElement parseInclude(OMElement includeEl,
+ DescriptionElement desc,
+ Map wsdlModules)
+ throws WSDLException{
+ IncludeElement include = desc.createIncludeElement();
+
+ String locationURI = OMUtils.getAttribute(includeEl, Constants.ATTR_LOCATION);
+
+ parseExtensionAttributes(includeEl, IncludeElement.class, include, desc);
+
+ if(locationURI != null){
+ include.setLocation(getURI(locationURI));
+ DescriptionElement includedDesc =
+ getWSDLFromLocation(locationURI, desc, wsdlModules);
+ include.setDescriptionElement(includedDesc);
+ }
+
+ return include;
+ }
+
//TODO
private ExtensionElement parseExtensionElement(Class parentType,
@@ -1200,19 +1363,18 @@
}
-
- ///////////////////////////////////////
- // METHODS FOR READING FROM A SOURCE
- ///////////////////////////////////////
-
-
- //TODO
public DescriptionElement readWSDL(String wsdlURI,
ErrorHandler errorHandler)
throws WSDLException {
- return null;
+ if(errorHandler != null)
+ getErrorReporter().setErrorHandler(errorHandler);
+
+ return readWSDL(wsdlURI);
}
+ ///////////////////////////////////////
+ // METHODS FOR READING FROM A SOURCE
+ ///////////////////////////////////////
//TODO
public DescriptionElement readWSDL(WSDLSource wsdlSource)
@@ -1278,6 +1440,72 @@
}
}
+ /*
+ * Retrieve a WSDL document by resolving the location URI specified
+ * on a WSDL <import> or <include> element.
+ *
+ * TODO add support for a URL Catalog Resolver
+ */
+ private DescriptionElement getWSDLFromLocation(String locationURI,
+ DescriptionElement desc,
+ Map wsdlModules)
+ throws WSDLException{
+ DescriptionElement referencedDesc = null;
+ OMElement docEl;
+ URL locationURL = null;
+ URI contextURI = null;
+
+ try{
+ contextURI = desc.getDocumentBaseURI();
+ URL contextURL = (contextURI != null) ? contextURI.toURL() : null;
+ locationURL = StringUtils.getURL(contextURL, locationURI);
+ }
+ catch (MalformedURLException e){
+ String baseURI = contextURI != null ? contextURI.toString() : null;
+
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(), //TODO line&col nos.
+ "WSDL502",
+ new Object[] {baseURI, locationURI},
+ ErrorReporter.SEVERITY_ERROR);
+
+ //can't continue import with a bad URL.
+ return null;
+ }
+
+ String locationStr = locationURL.toString();
+
+ //Check if WSDL imported or included previously from this location.
+ referencedDesc = (DescriptionElement)wsdlModules.get(locationStr);
+
+ if(referencedDesc == null){
+ //not previously imported or included, so retrieve the WSDL.
+ docEl = OMUtils.getElement(locationStr);
+
+ //The referenced document should contain a WSDL <description>
+ if(!QNameUtils.matches(Constants.Q_ELEM_DESCRIPTION, docEl)){
+ getErrorReporter().reportError(
+ new ErrorLocatorImpl(), //TODO line&col nos.
+ "WSDL501",
+ new Object[] {Constants.Q_ELEM_DESCRIPTION,
+ QNameUtils.newQName(docEl)},
+ ErrorReporter.SEVERITY_ERROR);
+
+ //cannot continue without a <description> element
+ return null;
+ }
+
+ referencedDesc = parseDescription(locationStr,
+ docEl,
+ wsdlModules);
+
+ if(!wsdlModules.containsKey(locationStr)){
+ wsdlModules.put(locationStr, referencedDesc);
+ }
+ }
+
+ return referencedDesc;
+ }
//TODO
public WSDLSource createWSDLSource() {
Modified: incubator/woden/java/src/org/apache/woden/internal/util/om/OMUtils.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/src/org/apache/woden/internal/util/om/OMUtils.java?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/util/om/OMUtils.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/util/om/OMUtils.java Tue Jul 11 04:15:45 2006
@@ -15,24 +15,27 @@
*/
package org.apache.woden.internal.util.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.WSDLException;
-import org.apache.woden.ErrorReporter;
-import org.apache.woden.internal.ErrorReporterImpl;
-import org.apache.woden.internal.ErrorLocatorImpl;
-import org.xml.sax.InputSource;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.namespace.QName;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Iterator;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.ErrorLocatorImpl;
+import org.apache.woden.internal.ErrorReporterImpl;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.xml.sax.InputSource;
+
/**
* This class contains utility methods required for parsing elements
* in a WSDL using AXIOM.
@@ -123,68 +126,47 @@
}
/**
- * TODO: check if the QName returned is correct in all cases
* @param prefixedValue to which the QName is prefixed
* @param contextEl Element in which the QName is sought for
- * @param desc The DescriptionElement which contains elements so far read from the WSDL
* @return The relevant QName for the prefix
* @throws WSDLException
*/
public static QName getQName(String prefixedValue,
- OMElement contextEl,
- DescriptionElement desc) throws WSDLException {
-
+ OMElement contextEl)
+ throws WSDLException{
int index = prefixedValue.indexOf(':');
String prefix = (index != -1)
? prefixedValue.substring(0, index)
: null;
- String localPart = prefixedValue.substring(index + 1);
- String namespaceURI = getNamespaceURIFromPrefix(desc, prefix);
-
- if (namespaceURI != null){
- //TODO investigate changing the registration of namespaces and prefixes (i.e. namespace decls)
- try {
- registerUniquePrefix(prefix, namespaceURI, desc);
- }
- catch (WSDLException e) {
- e.printStackTrace();
- }
+ String localPart = prefixedValue.substring(index + 1);
+ String namespaceURI = null;
- //TODO when passing prefix to QName ctor, what if it was modified by
- //registerUniquePrefix because of a name clash (pass original or modification)?
- return new QName( namespaceURI,
- localPart,
- prefix != null ? prefix : emptyString);
+ if (prefix != null){
+ namespaceURI = contextEl.findNamespaceURI(prefix).getName();
+ //TODO investigate changing the registration of namespaces and prefixes (i.e. namespace decls)
+ //so it can happen within any WSDL element, not just Description (current behaviour is copied from WSDL4J)
+ //registerUniquePrefix(prefix, namespaceURI, desc);
+
+ //TODO when passing prefix to QName ctor, what if it was modified by
+ //registerUniquePrefix because of a name clash (pass original or modification)?
+ return new QName(namespaceURI,
+ localPart,
+ prefix != null ? prefix : emptyString);
}
else{
- //TODO use ErrorReporter here or in callers to report the problem
- String faultCode = (prefix == null)
- ? WSDLException.NO_PREFIX_SPECIFIED
- : WSDLException.UNBOUND_PREFIX;
-
- WSDLException wsdlExc = new WSDLException(faultCode,
- "Unable to determine " +
- "namespace of '" +
- prefixedValue + "'.");
+ //TODO use ErrorReporter here or in callers to report the problem
- //TODO Get XPath from the node
- //wsdlExc.setLocation(XPathUtils.getXPathExprFromNode(contextEl));
+ String faultCode = (prefix == null)
+ ? WSDLException.NO_PREFIX_SPECIFIED
+ : WSDLException.UNBOUND_PREFIX;
+
+ WSDLException wsdlExc = new WSDLException(faultCode,
+ "Unable to determine " +
+ "namespace of '" +
+ prefixedValue + "'.");
- throw wsdlExc;
+ throw wsdlExc;
}
- }
-
- /**
- * TODO: might be a wrong approach to get the NamespaceURI!
- * This method assumes that all the namespaces are registered with the DescriptionElement
- * @param desc
- * @param prefix the prefix to find an xmlns:prefix=uri for the relevant element
- *
- * @return the namespace URI or null if not found
- */
- public static String getNamespaceURIFromPrefix (DescriptionElement desc,
- String prefix) {
- return desc.getNamespaces().get(prefix).toString();
}
/**
Added: incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java?rev=420800&view=auto
==============================================================================
--- incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java (added)
+++ incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java Tue Jul 11 04:15:45 2006
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2005 Apache Software Foundation
+ *
+ * Licensed 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.woden;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+
+public class OMWSDLFactoryTest extends TestCase{
+
+ public static Test suite(){
+ return new TestSuite(OMWSDLFactoryTest.class);
+ }
+
+ public void testCreateOMWSDLFactory(){
+ try{
+ WSDLFactory factory = WSDLFactory.newInstance("org.apache.woden.internal.OMWSDLFactory");
+ assertNotNull("WSDL factory created is null.", factory);
+ }
+ catch(WSDLException e){
+ fail("Unable to create WSDL factory." + e.getMessage());
+ }
+ }
+
+ public void testCreateOMWSDLReader(){
+ WSDLFactory factory = null;
+ try{
+ factory = WSDLFactory.newInstance("org.apache.woden.internal.OMWSDLFactory");
+ WSDLReader reader = factory.newWSDLReader();
+ assertNotNull("WSDL reader created is null.", reader);
+ }
+ catch (WSDLException e){
+ fail("Unable to create WSDL reader. " + e.getMessage());
+ }
+ }
+
+}
Added: incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java?rev=420800&view=auto
==============================================================================
--- incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java (added)
+++ incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java Tue Jul 11 04:15:45 2006
@@ -0,0 +1,72 @@
+/**
+ * Copyright 2005, 2006 Apache Software Foundation
+ *
+ * Licensed 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.woden;
+
+import java.net.URL;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.tests.TestErrorHandler;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+
+public class OMWSDLReaderTest extends TestCase{
+
+ private WSDLFactory omWSDLFactory = null;
+ private WSDLReader omWSDLReader = null;
+ private ErrorHandler handler = null;
+
+ public static Test suite(){
+ return new TestSuite(OMWSDLReaderTest.class);
+ }
+
+ protected void setUp() throws Exception{
+
+ handler = new TestErrorHandler();
+ try{
+ omWSDLFactory = WSDLFactory.newInstance("org.apache.woden.internal.OMWSDLFactory");
+ omWSDLReader = omWSDLFactory.newWSDLReader();
+ }
+ catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+
+ public void testReadValidWSDL20FromOM(){
+ DescriptionElement desc = null;
+ try{
+ URL wsdlURL = getClass().getClassLoader().getResource("./org/apache/woden/primer-hotelReservationService.wsdl");
+ desc = omWSDLReader.readWSDL(wsdlURL.toString(), handler);
+ }
+ catch(WSDLException e){
+ fail("Unexpected exception: " + e.getMessage());
+ }
+ assertNotNull("The description returned is null.", desc);
+ }
+
+ public void testReadInvalidWSDL20FromOM(){
+ try{
+ URL wsdlURL = getClass().getClassLoader().getResource("./org/apache/woden/badDescriptionTags.wsdl");
+ omWSDLReader.readWSDL(wsdlURL.toString(), handler);
+ fail("Expected a WSDLException because the \"description\" tag was deliberately misspelt.");
+ }
+ catch(WSDLException e){
+ assertTrue("Expected a WSDLException with message containing \"WSDL501\", but got: " + e.getMessage() ,
+ e.getMessage().indexOf("WSDL501") > -1);
+ }
+ }
+}
\ No newline at end of file
Modified: incubator/woden/java/test/org/apache/woden/tests/AllWodenTests.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/test/org/apache/woden/tests/AllWodenTests.java?rev=420800&r1=420799&r2=420800&view=diff
==============================================================================
--- incubator/woden/java/test/org/apache/woden/tests/AllWodenTests.java (original)
+++ incubator/woden/java/test/org/apache/woden/tests/AllWodenTests.java Tue Jul 11 04:15:45 2006
@@ -20,27 +20,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.apache.woden.WSDLFactoryTest;
-import org.apache.woden.WSDLReaderTest;
-import org.apache.woden.internal.ReaderFeaturesTest;
-import org.apache.woden.internal.wsdl20.validation.WSDLComponentValidatorTest;
-import org.apache.woden.internal.wsdl20.validation.WSDLDocumentValidatorTest;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensionsTest;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensionsTest;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensionsTest;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensionsTest;
-import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensionsTest;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensionsTest;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultExtensionsTest;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultReferenceExtensionsTest;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingMessageReferenceExtensionsTest;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingOperationExtensionsTest;
-import org.apache.woden.wsdl20.xml.EndpointElementTest;
-import org.apache.woden.wsdl20.xml.NameAttributeTest;
-import org.apache.woden.wsdl20.xml.ServiceElementTest;
-import org.apache.woden.xml.IntOrTokenAttrTest;
-import org.apache.woden.xml.TokenAttrTest;
-
public class AllWodenTests extends TestSuite
{
/**
@@ -64,39 +43,8 @@
{
super("AllWodenTests");
- String ver = System.getProperty("java.version");
- if(ver.startsWith("1.4"))
- {
- /*
- * From Java 1.5.0 the QName class is included in the jre and loaded
- * by the bootstrap classloader. However, we are running a 1.4 jvm
- * now, so the Woden QName class will be loaded and we do want to
- * run the junit tests for this class.
- */
- addTest(QNameTest.suite());
- }
-
- addTest(WSDLFactoryTest.suite());
- addTest(WSDLReaderTest.suite());
- addTest(W3CTestSuiteTest.suite());
- addTestSuite(ReaderFeaturesTest.class);
- addTest(WSDLDocumentValidatorTest.suite());
- addTest(WSDLComponentValidatorTest.suite());
- addTest(ServiceElementTest.suite());
- addTest(EndpointElementTest.suite());
- addTest(NameAttributeTest.suite());
- addTest(IntOrTokenAttrTest.suite());
- addTest(TokenAttrTest.suite());
- addTest(SOAPBindingExtensionsTest.suite());
- addTest(SOAPBindingFaultExtensionsTest.suite());
- addTest(SOAPBindingOperationExtensionsTest.suite());
- addTest(SOAPBindingMessageReferenceExtensionsTest.suite());
- addTest(SOAPBindingFaultReferenceExtensionsTest.suite());
- addTest(HTTPBindingExtensionsTest.suite());
- addTest(HTTPBindingFaultExtensionsTest.suite());
- addTest(HTTPBindingOperationExtensionsTest.suite());
- addTest(HTTPBindingMessageReferenceExtensionsTest.suite());
- addTest(HTTPEndpointExtensionsTest.suite());
+ addTest(AllWodenTestsDOM.suite());
+ addTest(AllWodenTestsOM.suite());
//TODO in-progress 30May06 tests for BindingOpExt and BindingMsgRefExt
}
Added: incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java?rev=420800&view=auto
==============================================================================
--- incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java (added)
+++ incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java Tue Jul 11 04:15:45 2006
@@ -0,0 +1,103 @@
+/**
+ * Copyright 2005, 2006 Apache Software Foundation
+ *
+ * Licensed 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.woden.tests;
+
+import javax.xml.namespace.QNameTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.woden.WSDLFactoryTest;
+import org.apache.woden.WSDLReaderTest;
+import org.apache.woden.internal.ReaderFeaturesTest;
+import org.apache.woden.internal.wsdl20.validation.WSDLComponentValidatorTest;
+import org.apache.woden.internal.wsdl20.validation.WSDLDocumentValidatorTest;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensionsTest;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensionsTest;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensionsTest;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensionsTest;
+import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensionsTest;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensionsTest;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultExtensionsTest;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingFaultReferenceExtensionsTest;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingMessageReferenceExtensionsTest;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingOperationExtensionsTest;
+import org.apache.woden.wsdl20.xml.EndpointElementTest;
+import org.apache.woden.wsdl20.xml.NameAttributeTest;
+import org.apache.woden.wsdl20.xml.ServiceElementTest;
+import org.apache.woden.xml.IntOrTokenAttrTest;
+import org.apache.woden.xml.TokenAttrTest;
+
+public class AllWodenTestsDOM extends TestSuite
+{
+ /**
+ * Create this test suite.
+ *
+ * @return This test suite.
+ */
+ public static Test suite()
+ {
+ return new AllWodenTestsDOM();
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(AllWodenTestsDOM.suite());
+ }
+
+ /**
+ * Constructor
+ */
+ public AllWodenTestsDOM()
+ {
+ super("AllWodenTestsDOM");
+
+ String ver = System.getProperty("java.version");
+ if(ver.startsWith("1.4"))
+ {
+ /*
+ * From Java 1.5.0 the QName class is included in the jre and loaded
+ * by the bootstrap classloader. However, we are running a 1.4 jvm
+ * now, so the Woden QName class will be loaded and we do want to
+ * run the junit tests for this class.
+ */
+ addTest(QNameTest.suite());
+ }
+
+ addTest(WSDLFactoryTest.suite());
+ addTest(WSDLReaderTest.suite());
+ addTest(W3CTestSuiteTest.suite());
+ addTestSuite(ReaderFeaturesTest.class);
+ addTest(WSDLDocumentValidatorTest.suite());
+ addTest(WSDLComponentValidatorTest.suite());
+ addTest(ServiceElementTest.suite());
+ addTest(EndpointElementTest.suite());
+ addTest(NameAttributeTest.suite());
+ addTest(IntOrTokenAttrTest.suite());
+ addTest(TokenAttrTest.suite());
+ addTest(SOAPBindingExtensionsTest.suite());
+ addTest(SOAPBindingFaultExtensionsTest.suite());
+ addTest(SOAPBindingOperationExtensionsTest.suite());
+ addTest(SOAPBindingMessageReferenceExtensionsTest.suite());
+ addTest(SOAPBindingFaultReferenceExtensionsTest.suite());
+ addTest(HTTPBindingExtensionsTest.suite());
+ addTest(HTTPBindingFaultExtensionsTest.suite());
+ addTest(HTTPBindingOperationExtensionsTest.suite());
+ addTest(HTTPBindingMessageReferenceExtensionsTest.suite());
+ addTest(HTTPEndpointExtensionsTest.suite());
+ //TODO in-progress 30May06 tests for BindingOpExt and BindingMsgRefExt
+ }
+
+}
Added: incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java?rev=420800&view=auto
==============================================================================
--- incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java (added)
+++ incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java Tue Jul 11 04:15:45 2006
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2005, 2006 Apache Software Foundation
+ *
+ * Licensed 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.woden.tests;
+
+import javax.xml.namespace.QNameTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.woden.OMWSDLFactoryTest;
+import org.apache.woden.OMWSDLReaderTest;
+import org.apache.woden.wsdl20.xml.OMEndpointElementTest;
+import org.apache.woden.wsdl20.xml.OMServiceElementTest;
+
+public class AllWodenTestsOM extends TestSuite{
+
+ /**
+ * Create this test suite.
+ *
+ * @return This test suite.
+ */
+ public static Test suite(){
+ return new AllWodenTestsOM();
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(AllWodenTestsOM.suite());
+ }
+
+ /**
+ * Constructor
+ */
+ public AllWodenTestsOM(){
+ super("AllWodenTestsOM");
+
+ String ver = System.getProperty("java.version");
+ if(ver.startsWith("1.4")){
+ /*
+ * From Java 1.5.0 the QName class is included in the jre and loaded
+ * by the bootstrap classloader. However, we are running a 1.4 jvm
+ * now, so the Woden QName class will be loaded and we do want to
+ * run the junit tests for this class.
+ */
+ addTest(QNameTest.suite());
+ }
+ addTest(OMWSDLFactoryTest.suite());
+ addTest(OMWSDLReaderTest.suite());
+ addTest(OMW3CTestSuiteTest.suite());
+ addTest(OMServiceElementTest.suite());
+ addTest(OMEndpointElementTest.suite());
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org