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/12 11:38:15 UTC
svn commit: r421205 - in /incubator/woden/branches/WODEN-40: ./
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: Wed Jul 12 02:38:13 2006
New Revision: 421205
URL: http://svn.apache.org/viewvc?rev=421205&view=rev
Log:
Merged https://svn.apache.org/...../woden/java (a.k.a. trunk) changes r420507:420989 into the WODEN-40 branch
Added:
incubator/woden/branches/WODEN-40/test/org/apache/woden/OMWSDLFactoryTest.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/OMWSDLFactoryTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/OMWSDLReaderTest.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/OMWSDLReaderTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTestsDOM.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsDOM.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTestsOM.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/tests/AllWodenTestsOM.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/OMW3CTestSuiteTest.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/tests/OMW3CTestSuiteTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMEndpointElementTest.java
- copied unchanged from r420959, incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMEndpointElementTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
- copied, changed from r420959, incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
Modified:
incubator/woden/branches/WODEN-40/.classpath
incubator/woden/branches/WODEN-40/build.properties
incubator/woden/branches/WODEN-40/build.xml
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/util/om/OMUtils.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTests.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/W3CFileRepository.java
Modified: incubator/woden/branches/WODEN-40/.classpath
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/.classpath?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/.classpath (original)
+++ incubator/woden/branches/WODEN-40/.classpath Wed Jul 12 02:38:13 2006
@@ -12,5 +12,8 @@
<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/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/branches/WODEN-40/build.properties
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/build.properties?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/build.properties (original)
+++ incubator/woden/branches/WODEN-40/build.properties Wed Jul 12 02:38:13 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/branches/WODEN-40/build.xml
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/build.xml?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/build.xml (original)
+++ incubator/woden/branches/WODEN-40/build.xml Wed Jul 12 02:38:13 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/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java (original)
+++ incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java Wed Jul 12 02:38:13 2006
@@ -834,9 +834,6 @@
String name = DOMUtils.getAttribute(faultEl, Constants.ATTR_NAME);
if(name != null)
{
- String ns = desc.getTargetNamespace() != null ?
- desc.getTargetNamespace().toString() :
- Constants.VALUE_EMPTY_STRING;
fault.setName(new NCName(name));
}
Modified: incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java (original)
+++ incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java Wed Jul 12 02:38:13 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)){
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);
+ }
+ parseImport(wsdlComponent, desc, wsdlModules);
+ }
+ else if (QNameUtils.matches(Constants.Q_ELEM_INCLUDE, wsdlComponent)){
+ if(documentBaseURI != null && !wsdlModules.containsKey(documentBaseURI)){
+ wsdlModules.put(documentBaseURI, desc);
+ }
+ 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);
}
}
@@ -846,9 +953,6 @@
String name = OMUtils.getAttribute(faultEl, Constants.ATTR_NAME);
if(name != null){
- String ns = desc.getTargetNamespace() != null ?
- desc.getTargetNamespace().toString() :
- Constants.VALUE_EMPTY_STRING;
fault.setName(new NCName(name));
}
@@ -856,7 +960,7 @@
if(element != null){
try {
- QName qname = OMUtils.getQName(element, faultEl, desc);
+ QName qname = OMUtils.getQName(element, faultEl);
fault.setElementName(qname);
}
catch (WSDLException e) {
@@ -1035,7 +1139,6 @@
InputSource schemaSource = new InputSource(new ByteArrayInputStream(schemaElbytes));
try {
- String baseLoc = contextURI != null ? contextURI.toString() : null;
XmlSchemaCollection xsc = new XmlSchemaCollection();
schemaDef = xsc.read(schemaSource, null);
fImportedSchemas.put(schemaURL, schemaDef);
@@ -1064,7 +1167,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 +1175,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 +1202,6 @@
ErrorReporter.SEVERITY_WARNING,
e);
}
-
if(schemaDef != null) {
schema.setSchemaDefinition(schemaDef);
}
@@ -1147,6 +1259,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 +1359,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 +1436,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/branches/WODEN-40/src/org/apache/woden/internal/util/om/OMUtils.java
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/util/om/OMUtils.java?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/util/om/OMUtils.java (original)
+++ incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/util/om/OMUtils.java Wed Jul 12 02:38:13 2006
@@ -15,35 +15,33 @@
*/
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.
*/
public class OMUtils {
- /**
- * The namespaceURI represented by the prefix <code>xmlns</code>.
- */
- private static String NS_URI_XMLNS = "http://www.w3.org/2000/xmlns/";
- private static final String ATTR_XMLNS = "xmlns";
private static final String emptyString = "";
/**
@@ -123,68 +121,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();
}
/**
Modified: incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTests.java
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTests.java?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTests.java (original)
+++ incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/AllWodenTests.java Wed Jul 12 02:38:13 2006
@@ -15,32 +15,9 @@
*/
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 AllWodenTests extends TestSuite
{
/**
@@ -64,39 +41,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
}
Modified: incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/W3CFileRepository.java
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/W3CFileRepository.java?rev=421205&r1=421204&r2=421205&view=diff
==============================================================================
--- incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/W3CFileRepository.java (original)
+++ incubator/woden/branches/WODEN-40/test/org/apache/woden/tests/W3CFileRepository.java Wed Jul 12 02:38:13 2006
@@ -16,6 +16,7 @@
package org.apache.woden.tests;
import java.io.File;
+import java.net.MalformedURLException;
public class W3CFileRepository {
@@ -42,7 +43,8 @@
*
* @param path
* path of the file in the W3C CVS repository
- * @return path to use to get the local file
+ * @return if the file exists locally then a file URL, otherwise, the path
+ * parameter value.
*/
public String getFilePath(String path) {
// If we don't have a cache return the server path
@@ -59,7 +61,12 @@
String localPath = localBase + path.substring(w3cBase.length());
File localFile = new File(localPath);
if (localFile.exists()) {
- return localPath;
+ try {
+ return localFile.toURL().toString();
+ } catch (MalformedURLException mue) {
+ System.err.println("Got MalformedURLException trying to create a URL from " + localPath);
+ return path;
+ }
} else {
return path;
}
Copied: incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java (from r420959, incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java)
URL: http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java?p2=incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java&p1=incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java&r1=420959&r2=421205&rev=421205&view=diff
==============================================================================
--- incubator/woden/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java (original)
+++ incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java Wed Jul 12 02:38:13 2006
@@ -97,8 +97,7 @@
public void testSetAndGetNameFromOM() throws Exception{
DescriptionElement descElem = new DescriptionImpl();
descElem.setTargetNamespace(new URI("urn:woden"));
- ServiceElement service = new ServiceImpl();
- descElem.addServiceElement(service);
+ ServiceElement service = descElem.createServiceElement();
service.setName(new NCName(fQName.getLocalPart()));
assertTrue("QName returned by ServiceElement.getName() was not the one set by setName().",
fQName.equals(service.getName()));
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org