Author: gturrell
Date: Tue Feb 6 15:43:35 2007
New Revision: 504374
URL: http://svn.apache.org/viewvc?view=rev&rev=504374
Log:
[woden-139] changed ValidateWSDL20 to accept two additional args from the
build.xml task invocations, "catalog" and "baseURI",
which are then used by the URI resolver to set
o.a.w.resolver.simpleresolver.catalog and
o.a.w.resolver.simpleresolver.baseURIs properties. This removes the need to
specify system property values on the jvm command line of the
ant client. The string values passed from the build.xml are local file and
directory location respectively.
Modified:
incubator/woden/branches/M7/ant-test/build.xml
incubator/woden/branches/M7/src/org/apache/woden/ant/ValidateWSDL20.java
Modified: incubator/woden/branches/M7/ant-test/build.xml
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/M7/ant-test/build.xml?view=diff&rev=504374&r1=504373&r2=504374
==============================================================================
--- incubator/woden/branches/M7/ant-test/build.xml (original)
+++ incubator/woden/branches/M7/ant-test/build.xml Tue Feb 6 15:43:35 2007
@@ -53,12 +53,12 @@
<target name="documents-good" description="---> Validates W3C WSDL 2.0
good document test suite and outputs component model">
<mkdir dir="results" />
- <validatewsdl20 dir="${test-suite.dir}/documents/good"
includes="**/*.wsdl" cm="yes" cmdir="results"
report="documents-good-report.xml" />
+ <validatewsdl20 dir="${test-suite.dir}/documents/good"
includes="**/*.wsdl" cm="yes" cmdir="results"
report="documents-good-report.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
baseURI="${test-suite.dir}"/>
<zip destfile="test-suite-results.zip" basedir="results" />
</target>
<target name="validation-results" description="--> Generates
validation-results.xml for all documents.">
- <validatewsdl20 dir="${test-suite.dir}/documents"
includes="**/*.wsdl" cm="no" report="validation-results-without-ids.xml" />
+ <validatewsdl20 dir="${test-suite.dir}/documents"
includes="**/*.wsdl" cm="no" report="validation-results-without-ids.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
baseURI="${test-suite.dir}"/>
<property name="test-suite-xml"
location="${test-suite.dir}/test-suite.xml" />
<xslt style="identify-test-case-roots.xsl"
in="validation-results-without-ids.xml" out="validation-results.xml"
force="yes">
<param name="test-suite-dir"
expression="${test-suite.dir}" />
@@ -75,16 +75,16 @@
<target name="messages-good" description="---> Validates W3C WSDL 2.0
good message test suite and outputs component model">
<mkdir dir="messages-results" />
- <validatewsdl20 dir="${test-suite.dir}/messages/good"
includes="**/*.wsdl" cm="yes" cmdir="messages-results"
report="messages-good-report.xml" />
+ <validatewsdl20 dir="${test-suite.dir}/messages/good"
includes="**/*.wsdl" cm="yes" cmdir="messages-results"
report="messages-good-report.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
baseURI="${test-suite.dir}" />
<zip destfile="test-suite-messages-results.zip"
basedir="messages-results" />
</target>
<target name="messages-good-in-place" description="---> Validates W3C
WSDL 2.0 good message test suite and outputs component model in place">
- <validatewsdl20 dir="${test-suite.dir}/messages/good"
includes="**/*.wsdl" cm="yes" cmdir="${test-suite.dir}/messages/good"
report="${test-suite.dir}/messages/good/messages-good-report.xml" />
+ <validatewsdl20 dir="${test-suite.dir}/messages/good"
includes="**/*.wsdl" cm="yes" cmdir="${test-suite.dir}/messages/good"
report="${test-suite.dir}/messages/good/messages-good-report.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
baseURI="${test-suite.dir}" />
</target>
<target name="documents-bad" description="---> Validates W3C WSDL 2.0
bad document test suite and outputs report">
- <validatewsdl20 dir="${test-suite.dir}/documents/bad"
includes="**/*.wsdl" excludes="Binding-4B/Echo.wsdl" cm="no"
report="documents-bad-report.xml" />
+ <validatewsdl20 dir="${test-suite.dir}/documents/bad"
includes="**/*.wsdl" excludes="Binding-4B/Echo.wsdl" cm="no"
report="documents-bad-report.xml"
catalog="${woden.dir}/test/org/apache/woden/resolver/resources/W3Ctests.catalog"
baseURI="${test-suite.dir}" />
</target>
<target name="schemavalidate-results" description="---> Validates
component model interchange format results againt schema.">
Modified:
incubator/woden/branches/M7/src/org/apache/woden/ant/ValidateWSDL20.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/M7/src/org/apache/woden/ant/ValidateWSDL20.java?view=diff&rev=504374&r1=504373&r2=504374
==============================================================================
--- incubator/woden/branches/M7/src/org/apache/woden/ant/ValidateWSDL20.java
(original)
+++ incubator/woden/branches/M7/src/org/apache/woden/ant/ValidateWSDL20.java
Tue Feb 6 15:43:35 2007
@@ -20,6 +20,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
+import java.net.MalformedURLException;
import javax.xml.namespace.QName;
@@ -94,6 +95,13 @@
// report writer
private Report reportWriter;
+ // resolver catalog location
+ private String catalog;
+
+ // base URI for the catalog
+ private String baseURI;
+
+
// default extension for Component Model interchange format output
private static final String CMEXT_DEFAULT = ".wsdlcm";
@@ -417,5 +425,39 @@
wsdlCm.write(descComp);
out.close();
fos.close();
+ }
+
+ /**
+ * Sets the resolver catalog file.
+ *
+ * @param catalog resolver catalog file URI
+ */
+ public void setCatalog(String catalog) {
+ this.catalog = getURLFilePath(catalog);
+ System.setProperty("org.apache.woden.resolver.simpleresolver.catalog",
this.catalog);
+ }
+
+ /**
+ * Sets the resolver base URI path.
+ *
+ * @param baseURI base URI path
+ */
+ public void setBaseURI(String baseURI) {
+ this.baseURI = getURLFilePath(baseURI);
+
System.setProperty("org.apache.woden.resolver.simpleresolver.baseURIs",
this.baseURI);
+ }
+
+ private String getURLFilePath(String localPath) {
+ File localFile = new File(localPath);
+ if (localFile.exists()) {
+ try {
+ return localFile.toURI().toURL().toString();
+ } catch (MalformedURLException mue) {
+ System.err.println("Got MalformedURLException trying to create
a URL from " + localPath);
+ return localPath;
+ }
+ } else {
+ return localPath;
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]