[jboss-svn-commits] JBL Code SVN: r26493 - in labs/jbossesb/workspace/dbevenius/jbossas5: product and 32 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed May 13 04:11:47 EDT 2009
Author: beve
Date: 2009-05-13 04:11:46 -0400 (Wed, 13 May 2009)
New Revision: 26493
Added:
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/util/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtil.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/util/XssUtil.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas2.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir.esb
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/types/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/types/custom-request-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/util/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtilUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/util/XssUtilUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/qa/junit/resources/server/ebws/META-INF/deployment.xml
labs/jbossesb/workspace/dbevenius/jbossas5/testlib/jetty-6.1.15.jar
labs/jbossesb/workspace/dbevenius/jbossas5/testlib/jetty-util-6.1.15.jar
Removed:
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd
Modified:
labs/jbossesb/workspace/dbevenius/jbossas5/
labs/jbossesb/workspace/dbevenius/jbossas5/product/.classpath
labs/jbossesb/workspace/dbevenius/jbossas5/product/build-distr.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/docs/ProgrammersGuide.odt
labs/jbossesb/workspace/dbevenius/jbossas5/product/install/build.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/ivy.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployer.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployer.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployer.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/build.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployerUnitTest.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/native_client/readme.txt
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/build.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/readme.txt
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/request.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/response.xsd
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice_inonly/listener.log
labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/attribute.jsp
labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/index.jsp
labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/operations.jsp
labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/results.jsp
Log:
Merged revisions 25583-26392 via svnmerge from
https://svn.jboss.org/repos/labs/labs/jbossesb/trunk
........
r25586 | beve | 2009-03-11 10:00:16 +0100 (Wed, 11 Mar 2009) | 2 lines
Work for https://jira.jboss.org/jira/browse/JBESB-2461 "XMLHelper uses a single instance of SchemaFactory which is not thread safe."
........
r25654 | beve | 2009-03-15 22:46:17 +0100 (Sun, 15 Mar 2009) | 2 lines
Work for https://jira.jboss.org/jira/browse/JBESB-2470 "Duplicate schema types in wsdl generated by EBWS"
........
r25705 | beve | 2009-03-18 10:02:17 +0100 (Wed, 18 Mar 2009) | 2 lines
Work for https://jira.jboss.org/jira/browse/JBESB-2477
........
r25706 | beve | 2009-03-18 12:57:14 +0100 (Wed, 18 Mar 2009) | 2 lines
https://jira.jboss.org/jira/browse/JBESB-2323 "Implement support for schema import in EBWS WSDL generation/action pipeline validation."
........
r25726 | beve | 2009-03-19 09:43:09 +0100 (Thu, 19 Mar 2009) | 2 lines
Work for https://jira.jboss.org/jira/browse/JBESB-2470 "Duplicate schema types in wsdl generated by EBWS"
........
r25824 | tfennelly | 2009-03-25 18:20:21 +0100 (Wed, 25 Mar 2009) | 1 line
https://jira.jboss.org/jira/browse/JBESB-2490
........
r25829 | beve | 2009-03-25 19:04:58 +0100 (Wed, 25 Mar 2009) | 2 lines
Missed to check this one in.
........
r25830 | beve | 2009-03-25 19:23:33 +0100 (Wed, 25 Mar 2009) | 2 lines
Enabling the test that was failing because I had missed checking in a file.
........
r25885 | mark.little at jboss.com | 2009-03-30 12:26:44 +0200 (Mon, 30 Mar 2009) | 1 line
https://jira.jboss.org/jira/browse/SOA-1245
........
r25886 | tfennelly | 2009-03-30 13:04:46 +0200 (Mon, 30 Mar 2009) | 1 line
https://jira.jboss.org/jira/browse/JBESB-2496
........
Property changes on: labs/jbossesb/workspace/dbevenius/jbossas5
___________________________________________________________________
Name: svnmerge-integrated
- /labs/jbossesb/trunk:1-25582
+ /labs/jbossesb/trunk:1-26392
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/.classpath
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/.classpath 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/.classpath 2009-05-13 08:11:46 UTC (rev 26493)
@@ -166,7 +166,7 @@
<classpathentry kind="lib" path="build/lib/jboss-common-core-2.2.11.GA.jar"/>
<classpathentry kind="lib" path="build/lib/jboss-ejb-api-3.0.0.GA.jar"/>
<classpathentry kind="lib" path="build/lib/jboss-logging-spi-2.0.5.GA.jar"/>
- <classpathentry kind="lib" path="build/lib/jboss-vfs-2.1.0.GA.jar" sourcepath="/opt/jboss/microcontainer/vfs/2.1.0.GA/src/main/java"/>
+ <classpathentry kind="lib" path="build/lib/jboss-vfs-2.1.0.GA.jar" sourcepath="/opt/jboss/microcontainer/vfs/2.1.1.GA"/>
<classpathentry kind="lib" path="build/lib/jboss-test-1.1.3.GA.jar" sourcepath="/opt/jboss/microcontainer/test1.1.3.GA"/>
<classpathentry kind="lib" path="build/lib/jboss-as-bootstrap-5.0.1.GA.jar"/>
<classpathentry kind="lib" path="build/lib/jboss-as-jmx-5.0.1.GA.jar"/>
@@ -183,5 +183,7 @@
<classpathentry kind="lib" path="build/lib/jboss-reflect-2.0.1.GA.jar"/>
<classpathentry kind="lib" path="build/lib/jboss-metadata-1.0.0.Beta6.jar" sourcepath="/opt/jboss/microcontainer/metadata/1.0.0.Beta6"/>
<classpathentry kind="lib" path="build/lib/jboss-profileservice-spi-5.0.3.GA.jar" sourcepath="/opt/jboss/microcontainer/deployers/2.0.5.GA"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/jbossas5/testlib/jetty-6.1.15.jar"/>
+ <classpathentry kind="lib" path="/opt/jboss/esb/jbossas5/testlib/jetty-util-6.1.15.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/build-distr.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/build-distr.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -138,6 +138,7 @@
<!-- Mina -->
<fileset dir="${lib.dir}" includes="mina-*.jar"/>
<fileset dir="${lib.dir}" includes="slf4j-*.jar"/>
+ <fileset dir="${lib.dir}" includes="xmlunit-*.jar"/>
</copy>
<copy todir="${build.dir}/jbossesb.sar">
<fileset dir="${installation.files.dir}/jUDDI-registry" includes="juddi.war"/>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/install/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/install/build.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/install/build.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -220,6 +220,7 @@
<include name="wstx-asl-3.2.0.jar"/>
<include name="xbean-2.2.0.jar"/>
<include name="xstream-1.2.2.jar"/>
+ <include name="xmlunit-1.2.jar"/>
</fileset>
<fileset dir="${org.jboss.esb.dist.lib}">
<include name="commons-codec-1.3.jar"/>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/ivy.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/ivy.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/ivy.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -131,5 +131,7 @@
<dependency org="javax.xml.bind" name="jaxb-api" rev="2.1"/>
+ <!-- xmlunit -->
+ <dependency org="xmlunit" name="xmlunit" rev="1.2"/>
</dependencies>
</ivy-module>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/addressing/eprs/DefaultInVMReplyToEpr.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -28,41 +28,25 @@
public class DefaultInVMReplyToEpr extends InVMEpr {
- private static ThreadLocal<InVMEPRThreadTracker> invmThreadReplyTracker = new ThreadLocal<InVMEPRThreadTracker>();
+ private static volatile long counter = 0;
public DefaultInVMReplyToEpr(InVMEpr epr) {
- super(getThreadEPR());
+ super(createEprAndCourier());
}
- private static EPR getThreadEPR() {
- // We assign an InVMEpr/Courier to each thread
+ private static EPR createEprAndCourier() {
+ try {
+ InVMEpr epr;
- InVMEPRThreadTracker tracker = invmThreadReplyTracker.get();
+ synchronized (DefaultInVMReplyToEpr.class) {
+ counter++;
+ epr = new InVMEpr(URI.create("invm://thread-" + Thread.currentThread().getId() + "-" + counter));
+ }
+ CourierFactory.getInstance().addInVMCourier(epr);
- if(tracker == null) {
- tracker = new InVMEPRThreadTracker();
- invmThreadReplyTracker.set(tracker);
- } else if(tracker.lastEPR != null) {
- // Deactivate the last InVMCourier used on this thread...
- CourierFactory.getInstance().removeInVMCourier(tracker.lastEPR);
- tracker.lastEPR = null;
- }
-
- try {
- // Create a brand new EPR for this invocation and register a
- // new InVMCourier for it...
- tracker.counter++;
- tracker.lastEPR = new InVMEpr(URI.create("invm://thread-" + Thread.currentThread().getId() + "-" + tracker.counter));
- CourierFactory.getInstance().addInVMCourier(tracker.lastEPR);
+ return epr;
} catch (URISyntaxException e) {
throw new RuntimeException("Unexpected Exception creating replyTo InVMEpr.", e);
}
-
- return tracker.lastEPR;
}
-
- private static class InVMEPRThreadTracker {
- private InVMEpr lastEPR;
- private long counter = 0;
- }
}
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java (from rev 25886, labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/SchemaResolver.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,286 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSResourceResolver;
+
+/**
+ * SchemaResolver is a {@link LSResourceResolver} implemention that locates
+ * resources by first trying to locate the resource on the local filesystem,
+ * and failing to find it there it will try the classpath.
+ * </p>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class SchemaResolver implements LSResourceResolver
+{
+ private Logger log = Logger.getLogger(SchemaResolver.class);
+
+ /**
+ * The encoding to use when reading resources.
+ */
+ final private String encoding;
+
+ /**
+ * Base URI that resources will be resolved realtive to.
+ */
+ private final URI parentSchemaUri;
+
+ /**
+ * Constructs an instance with the default encoding (UTF-8) and
+ * using the passed in baseUri.
+ *
+ * @param baseUri Base URI that resources will be resolved realtive to.
+ */
+ public SchemaResolver(final URI baseUri)
+ {
+ this("UTF-8", baseUri);
+ }
+
+ /**
+ * Constructs an instance with the specified encoding.
+ *
+ * @param encoding The encoding to use when reading resources. Must not be null;
+ * @param baseUri Base URI that resources will be resolved realtive to.
+ */
+ public SchemaResolver(final String encoding, final URI baseUri)
+ {
+ AssertArgument.isNotNullAndNotEmpty(encoding, "encoding");
+ AssertArgument.isNotNull(baseUri, "baseUri");
+ this.encoding = encoding;
+ this.parentSchemaUri = baseUri;
+ }
+
+ /**
+ * Tries to resolve the resource.
+ *
+ * @return LSInput A new {@link LSInputImpl} object instance.
+ */
+ public LSInput resolveResource(final String type, final String namespaceURI, final String publicId, String systemId, final String baseURI)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug(String.format("parentSchemaUri='%s', systemId='%s', baseURI='%s'", this.parentSchemaUri, systemId, baseURI));
+ }
+
+ LSInputImpl inputImpl = new LSInputImpl();
+
+ URI resolvedUri;
+ if (baseURI != null)
+ {
+ // Resolve relative to the baseUri passed in.
+ URI uri = URI.create(baseURI);
+ log.debug("Try to resolve " + uri + "/" + systemId);
+ resolvedUri = uri.resolve(systemId);
+ }
+ else
+ {
+ // Resolve the systemId (the schema path) relative to the parent schema.
+ resolvedUri = parentSchemaUri.resolve(systemId);
+ }
+ log.debug("Resolved Schema '" + resolvedUri + "'");
+
+ inputImpl.setSystemId(resolvedUri.toString());
+ inputImpl.setCharacterStream(getReader(resolvedUri));
+ return inputImpl;
+ }
+
+ private Reader getReader(final URI resolvedUri)
+ {
+ String scheme = resolvedUri.getScheme();
+ if (resolvedUri.isAbsolute())
+ {
+ if (scheme.equals("file"))
+ {
+ try
+ {
+ // Try to locate the resource from the local filesystem.
+ InputStream in = getFileInputStream(resolvedUri);
+ return new StringReader(StreamUtils.readStreamString(in, encoding));
+ }
+ catch (final FileNotFoundException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ }
+ else if (scheme.equals("classpath"))
+ {
+ InputStream in = ClassUtil.getResourceAsStream(resolvedUri.getPath(), getClass());
+ if (in != null)
+ {
+ try
+ {
+ return new StringReader(StreamUtils.readStreamString(in, encoding));
+ }
+ catch (final UnsupportedEncodingException e)
+ {
+ log.error(e.getMessage(), e);
+ }
+ }
+ else
+ {
+ log.info("Could not read resource : " + resolvedUri.getPath());
+ }
+ }
+ }
+ return null;
+ }
+
+ private class LSInputImpl implements LSInput
+ {
+ private String publicId;
+ private String systemId;
+ private String baseUri;
+ private Reader reader;
+
+ public LSInputImpl()
+ {
+ }
+
+ public Reader getCharacterStream()
+ {
+ return reader;
+ }
+
+ /**
+ * @return null
+ */
+ public InputStream getByteStream()
+ {
+ return null;
+ }
+
+ /**
+ * @return null
+ */
+ public String getStringData()
+ {
+ return null;
+ }
+
+ public String getSystemId()
+ {
+ return systemId;
+ }
+
+ public String getBaseURI()
+ {
+ return baseUri;
+ }
+
+ public String getPublicId()
+ {
+ return publicId;
+ }
+
+ public String getEncoding()
+ {
+ return encoding;
+ }
+
+ /**
+ * @return false
+ */
+ public boolean getCertifiedText()
+ {
+ return false;
+ }
+
+ public void setBaseURI(String baseURI)
+ {
+ this.baseUri = baseURI;
+ }
+
+ public void setByteStream(InputStream byteStream)
+ {
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ */
+ public void setCertifiedText(boolean certifiedText)
+ {
+ throw new UnsupportedOperationException("setCertifiedText is not supported");
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ */
+ public void setCharacterStream(Reader characterStream)
+ {
+ this.reader = characterStream;
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ */
+ public void setEncoding(String encoding)
+ {
+ throw new UnsupportedOperationException("setEncoding is not supported");
+ }
+
+ public void setPublicId(String publicId)
+ {
+ this.publicId = publicId;
+ }
+
+ /**
+ * @throws UnsupportedOperationException
+ */
+ public void setStringData(String stringData)
+ {
+ throw new UnsupportedOperationException("setStringData is not supported");
+ }
+
+ public void setSystemId(String systemId)
+ {
+ this.systemId = systemId;
+ }
+ }
+
+ private InputStream getFileInputStream(final URI uri) throws FileNotFoundException
+ {
+ File file = new File(uri);
+ if (file.exists() && !file.isDirectory())
+ {
+ return new FileInputStream(file);
+ }
+
+ throw new FileNotFoundException("Could not locate '" + uri + "' on local filesystem");
+ }
+}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/util/XMLHelper.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,12 +20,17 @@
*/
package org.jboss.internal.soa.esb.util;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
@@ -39,10 +44,12 @@
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
+import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.util.stax.ParsingSupport;
import org.jboss.internal.soa.esb.util.stax.StreamHelper;
import org.jboss.soa.esb.util.ClassUtil;
import org.jboss.util.StringPropertyReplacer;
+import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.SAXException;
/**
@@ -52,6 +59,8 @@
*/
public class XMLHelper
{
+ private static Logger log = Logger.getLogger(XMLHelper.class);
+
/**
* The XML input factory.
*/
@@ -60,10 +69,6 @@
* The XML output factory.
*/
private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance() ;
- /**
- * The schema factory.
- */
- private static final SchemaFactory SCHEMA_FACTORY = SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
/**
* Get the XML stream reader.
@@ -169,14 +174,106 @@
* @return The resource schema for validation.
* @throws SAXException For errors during parsing.
*/
- public static Schema getSchema(final String resource)
- throws SAXException
+ public static Schema getSchema(final String resource) throws SAXException
{
- final InputStream resourceIS = ClassUtil.getResourceAsStream(resource, XMLHelper.class) ;
- return SCHEMA_FACTORY.newSchema(new StreamSource(resourceIS)) ;
+ SchemaResolver schemaResolver;
+ try
+ {
+ URI schemaUri = getResourceUri(resource, XMLHelper.class) ;
+ log.debug("schemaUri : " + schemaUri);
+ schemaResolver = new SchemaResolver(schemaUri);
+
+ URL schemaUrl;
+ if (schemaUri.getScheme().equals("classpath"))
+ {
+ schemaUrl = ClassUtil.getResource(schemaUri.getPath(), XMLHelper.class) ;
+ }
+ else
+ {
+ schemaUrl = schemaUri.toURL();
+ }
+ log.debug("schemaUrl : " + schemaUrl);
+
+ return getSchema(schemaUrl, schemaResolver);
+ }
+ catch (final URISyntaxException e)
+ {
+ throw new SAXException("URISyntaxException while trying to locate '" + resource + "'");
+ }
+ catch (final MalformedURLException e)
+ {
+ throw new SAXException("MalformedURLException while trying to located '" + resource + "'");
+ }
+ catch (final IOException e)
+ {
+ throw new SAXException("IOException while trying to locate '" + resource + "'");
+ }
}
/**
+ * Get the schema for the specified resource and use the specified resolver to locate
+ * external resources, for example import schemas in the xsd.
+ *
+ * @param resource The schema resource to parse.
+ * @param resolver The {@link LSResourceResolver} for locating external resources.
+ * @return Schema The resource schema for validation.
+ * @throws SAXException
+ * @throws IOException
+ */
+ public static Schema getSchema(final URL resource, final LSResourceResolver resolver) throws SAXException, IOException
+ {
+ final SchemaFactory schemaFactory = newSchemaFactory();
+ schemaFactory.setResourceResolver(resolver);
+
+ final InputStream resourceIS = resource.openStream();
+ return schemaFactory.newSchema(new StreamSource(resourceIS)) ;
+ }
+
+ public static URI getResourceUri(final String resourceName, final Class<?> caller) throws URISyntaxException, MalformedURLException
+ {
+ File file = new File(resourceName);
+ if (file.exists() && !file.isDirectory())
+ {
+ return file.toURI();
+ }
+
+ String resource = resourceName;
+ if (resourceName.startsWith("/"))
+ {
+ resource = resourceName.substring(1) ;
+ }
+
+ final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+ if (threadClassLoader != null)
+ {
+ final URL url = threadClassLoader.getResource(resource) ;
+ if (url != null)
+ {
+ return URI.create("classpath://" + resourceName);
+ }
+ }
+
+ final ClassLoader classLoader = caller.getClassLoader() ;
+ if (classLoader != null)
+ {
+ final URL url = classLoader.getResource(resource) ;
+ if (url != null)
+ {
+ return URI.create("classpath://" + resourceName);
+ }
+ }
+
+ URL systemResource = ClassLoader.getSystemResource(resource);
+ if (systemResource != null)
+ {
+ return systemResource.toURI();
+ }
+
+ return new URI(resourceName);
+ }
+
+
+ /**
* Get the schema for the specified resources.
* @param resources The schema resources to parse.
* @return The resource schema for validation.
@@ -192,7 +289,7 @@
final InputStream resourceIS = ClassUtil.getResourceAsStream(resources[count], XMLHelper.class) ;
sources[count] = new StreamSource(resourceIS) ;
}
- return SCHEMA_FACTORY.newSchema(sources) ;
+ return newSchemaFactory().newSchema(sources) ;
}
/**
@@ -209,12 +306,23 @@
validator.validate(new StreamSource(new StringReader(xml))) ;
return true ;
}
- catch (final IOException ioe) {} // fall through
- catch (final SAXException saxe) {} // fall through
+ catch (final IOException ioe)
+ {
+ log.debug(ioe.getMessage(), ioe);
+ }
+ catch (final SAXException saxe)
+ {
+ log.debug(saxe.getMessage(), saxe);
+ }
return false ;
}
+ private static SchemaFactory newSchemaFactory()
+ {
+ return SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" );
+ }
+
/**
* Create the XML input factory.
* @return The XML input factory.
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,15 +20,18 @@
package org.jboss.internal.soa.esb.webservice;
import java.io.InputStream;
+import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.wsdl.Binding;
import javax.wsdl.BindingFault;
@@ -51,7 +54,14 @@
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.custommonkey.xmlunit.XMLUnit;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.dom.YADOMUtil;
@@ -61,6 +71,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
import com.ibm.wsdl.extensions.schema.SchemaImpl;
import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
@@ -97,6 +108,9 @@
// add types
Types types = def.createTypes();
def.setTypes(types);
+
+ // Keeps track of schema types added to avoid duplicates.
+ Set<String> schemasAdded = new HashSet<String>();
Message reqMessage = null;
Message resMessage = null;
@@ -111,7 +125,8 @@
try {
Document doc = YADOMUtil.parseStream(getResourceAsStream(inXsd, classLoader), false, false);
if (doc != null) {
- reqMessage = addMessage(def, doc.getDocumentElement(), serviceInfo.getRequestName(), "in", ++nsSuffixCounter);
+ reqMessage = addMessage(def, doc.getDocumentElement(),
+ serviceInfo.getRequestName(), "in", ++nsSuffixCounter, schemasAdded);
}
} catch (Exception e) {
throw new ConfigurationException("File defined in inXsd attribute '" + inXsd + "' not found in classpath.", e);
@@ -123,7 +138,7 @@
Document doc = YADOMUtil.parseStream(getResourceAsStream(outXsd, classLoader), false, false);
if (doc != null) {
resMessage = addMessage(def, doc.getDocumentElement(),
- serviceInfo.getResponseName(), "out", ++nsSuffixCounter);
+ serviceInfo.getResponseName(), "out", ++nsSuffixCounter, schemasAdded);
}
} catch (Exception e) {
throw new ConfigurationException("File defined in outXsd attribute '" + outXsd + "' not found in classpath.", e);
@@ -139,7 +154,7 @@
Document doc = YADOMUtil.parseStream(getResourceAsStream(xsd, classLoader), false, false);
if (doc != null) {
addFaultMessage(faultMessages, def, doc.getDocumentElement(),
- serviceInfo.getFaultName(), "fault", ++nsSuffixCounter);
+ serviceInfo.getFaultName(), "fault", ++nsSuffixCounter, schemasAdded);
}
}
} catch (Exception e) {
@@ -176,17 +191,47 @@
return ClassUtil.getResourceAsStream(resource, ESBContractGenerator.class);
}
- private static void addSchema(Types types, Element xsdElement) {
- SchemaImpl schemaImpl = new SchemaImpl();
- schemaImpl.setElement(xsdElement);
- schemaImpl.setElementType(XSD_QN);
- types.addExtensibilityElement(schemaImpl);
+ private static void addSchema(Types types, Element xsdElement, Set<String> schemasAdded) throws SAXException, IOException, TransformerException {
+ if (add(xsdElement, schemasAdded))
+ {
+ SchemaImpl schemaImpl = new SchemaImpl();
+ schemaImpl.setElement(xsdElement);
+ schemaImpl.setElementType(XSD_QN);
+ types.addExtensibilityElement(schemaImpl);
+ }
}
- private static Message addMessage(Definition def, Element element, String msgName, String partName, int nsSuffixCounter) {
+ private static boolean add(final Element schemaElement, final Set<String> schemasAdded) throws SAXException, IOException, TransformerException
+ {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer();
+ StringWriter writer = new StringWriter();
+ Result result = new StreamResult(writer);
+ transformer.transform(new DOMSource(schemaElement), result);
+ String newType = writer.toString();
+ if (schemasAdded.size() == 0)
+ {
+ return schemasAdded.add(newType);
+ }
+ else
+ {
+ XMLUnit.setIgnoreWhitespace(true);
+ for (String existingType : schemasAdded)
+ {
+ if (!XMLUnit.compareXML(existingType, newType).identical())
+ {
+ return schemasAdded.add(newType);
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static Message addMessage(Definition def, Element element, String msgName, String partName, int nsSuffixCounter, Set<String> schemasAdded) throws SAXException, IOException, TransformerException {
String schemaNs = YADOMUtil
.getAttribute(element, "targetNamespace", "");
- addSchema(def.getTypes(), element);
+ addSchema(def.getTypes(), element, schemasAdded);
if (def.getNamespace(schemaNs) == null) {
def.addNamespace("ns" + nsSuffixCounter, schemaNs);
}
@@ -206,10 +251,10 @@
private static void addFaultMessage(final List<Message> faultMessages,
Definition def, Element element, String msgName, String partName,
- int nsSuffixCounter) {
+ int nsSuffixCounter, Set<String> schemasAdded) throws SAXException, IOException, TransformerException {
String schemaNs = YADOMUtil
.getAttribute(element, "targetNamespace", "");
- addSchema(def.getTypes(), element);
+ addSchema(def.getTypes(), element, schemasAdded);
if (def.getNamespace(schemaNs) == null) {
def.addNamespace("ns" + nsSuffixCounter, schemaNs);
}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -34,6 +34,7 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.eprs.InVMEpr;
import org.jboss.soa.esb.addressing.util.DefaultReplyTo;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.Environment;
@@ -670,12 +671,24 @@
throw new MessageDeliverException("Caught unexpected throwable during send. Bailing-out!", t);
} finally {
- CourierUtil.cleanCourier(courier);
+ EPR replyToEpr = null;
+
+ try {
+ CourierUtil.cleanCourier(courier);
+ // put back the old To since we will have changed it.
- // put back the old To since we will have changed it.
-
- call.setTo(currentToEpr) ;
- call.setReplyTo(currentReplyToEpr) ;
+ replyToEpr = call.getReplyTo();
+ call.setTo(currentToEpr);
+ call.setReplyTo(currentReplyToEpr);
+ } finally {
+ // Need to do "special" cleanup for InVM replyTo couriers. Of course, this may
+ // not be most "pure" to the courier architecture, but we can't use Courier.cleanup because it
+ // is getting called multiple times between async delivery and pickup, which totally breaks
+ // InVM delivery because it zaps the in-mem queue.
+ if (replyToEpr instanceof InVMEpr) {
+ CourierFactory.getInstance().removeInVMCourier((InVMEpr) replyToEpr);
+ }
+ }
}
}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -21,10 +21,20 @@
*/
package org.jboss.soa.esb.listeners.config;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -32,6 +42,12 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -42,15 +58,25 @@
import org.jboss.deployment.SubDeployerSupport;
import org.jboss.internal.soa.esb.publish.ContractReferencePublisher;
import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.webservice.AddressingHandler;
+import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
+import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
+import org.jboss.internal.soa.esb.webservice.ESBServiceContractPublisher;
+import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
+import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
import org.jboss.logging.Logger;
import org.jboss.metadata.MetaData;
import org.jboss.metadata.XmlFileLoader;
import org.jboss.mx.loading.LoaderRepositoryFactory;
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.mx.util.ObjectNameConverter;
+import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;
import org.jboss.soa.esb.listeners.config.model.ModelAdapter;
import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.util.FileUtil;
import org.jboss.system.ServiceControllerMBean;
import org.jboss.system.server.ServerConfig;
import org.jboss.system.server.ServerConfigImplMBean;
@@ -118,8 +144,8 @@
}
return false;
}
-
- /**
+
+ /**
* Returns true if this deployer can deploy the given DeploymentInfo.
*
* @return True if this deployer can deploy the given DeploymentInfo.
@@ -406,6 +432,166 @@
}
}
+ private File createWebserviceWars(final DeploymentInfo di, final ModelAdapter model, final String deploymentName,
+ final List<ContractReferencePublisher> publishers)
+ throws DeploymentException
+ {
+ final String esbName = di.shortName;
+ final List<WebserviceInfo> endpointServices = model.getWebserviceServices() ;
+ if (endpointServices != null)
+ {
+ if (endpointServices.size() > 0)
+ {
+ final StringWriter filterDefinitions = new StringWriter() ;
+ final StringWriter filterMappings = new StringWriter() ;
+ final StringWriter servletDefinitions = new StringWriter() ;
+ final StringWriter servletMappings = new StringWriter() ;
+
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
+ final ZipOutputStream zos = new ZipOutputStream(baos) ;
+ zos.setComment("ESB war file for exposing webservices: " + esbName) ;
+ try
+ {
+ final JAXWSProviderClassGenerator generator = new JAXWSProviderClassGenerator() ;
+
+ for(WebserviceInfo webserviceInfo: endpointServices)
+ {
+ final Service service = webserviceInfo.getService() ;
+
+ // Copy all schemas to the wsdl directory to support imports.
+ final File esbArchive = new File(di.watch.getFile());
+ final Map<String, String> schemasMap = JBoss4ESBDeployer.getSchemas(esbArchive);
+ final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
+ for (Entry<String, String> schemaEntry : schemasMap.entrySet())
+ {
+ try
+ {
+ addFile(zos, wsdlDir + schemaEntry.getKey(), schemaEntry.getValue()) ;
+ log.debug("Added schema " + wsdlDir + schemaEntry.getKey());
+ }
+ catch (final ZipException e)
+ {
+ log.debug(e.getMessage(), e);
+ }
+ }
+
+ final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo) ;
+ final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo) ;
+ addFile(zos, serviceInfo.getWSDLFileName(), wsdl) ;
+
+ final String handlers = JBossDeployerUtil.getHandlers(serviceInfo) ;
+ final boolean includeHandlers = (handlers != null) ;
+ if (includeHandlers)
+ {
+ final String wsHandlerName = "WEB-INF/classes/" + serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml" ;
+ addFile(zos, wsHandlerName, handlers) ;
+ }
+
+ final byte[] wsClass = generator.generate(service.getCategory(),
+ service.getName(), serviceInfo, includeHandlers) ;
+ final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class" ;
+ addFile(zos, "WEB-INF/classes/" + wsClassName, wsClass) ;
+
+ // Filter...
+ // At the moment we only need the filter to overcome a bug in JBossWS re In-Only endpoints, so
+ // we only include for one way services...
+ if(serviceInfo.isOneWay()) {
+ String filterName = serviceInfo.getServletName() + "_Filter";
+
+ filterDefinitions.append("<filter><filter-name>") ;
+ filterDefinitions.append(filterName) ;
+ filterDefinitions.append("</filter-name><filter-class>") ;
+ filterDefinitions.append(ESBResponseFilter.class.getName()) ;
+ filterDefinitions.append("</filter-class>") ;
+ filterDefinitions.append("<init-param><param-name>OneWay</param-name><param-value>true</param-value></init-param>") ;
+ filterDefinitions.append("</filter>") ;
+
+ filterMappings.append("<filter-mapping><filter-name>") ;
+ filterMappings.append(filterName) ;
+ filterMappings.append("</filter-name><servlet-name>") ;
+ filterMappings.append(serviceInfo.getServletName()) ;
+ filterMappings.append("</servlet-name></filter-mapping>") ;
+ }
+
+ // Servlet....
+ servletDefinitions.append("<servlet><servlet-name>") ;
+ servletDefinitions.append(serviceInfo.getServletName()) ;
+ servletDefinitions.append("</servlet-name><servlet-class>") ;
+ servletDefinitions.append(serviceInfo.getClassName()) ;
+ servletDefinitions.append("</servlet-class></servlet>") ;
+
+ servletMappings.append("<servlet-mapping><servlet-name>") ;
+ servletMappings.append(serviceInfo.getServletName()) ;
+ servletMappings.append("</servlet-name><url-pattern>") ;
+ servletMappings.append(serviceInfo.getServletPath()) ;
+ servletMappings.append("</url-pattern></servlet-mapping>") ;
+
+ final ContractReferencePublisher publisher = new ESBServiceContractPublisher(service, webserviceInfo.getDescription(), serviceInfo.getServletName()) ;
+ publishers.add(publisher) ;
+ }
+
+ final StringWriter webXml = new StringWriter() ;
+ webXml.append("<web-app xmlns=\"http://java.sun.com/xml/ns/j2ee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"") ;
+ webXml.append(" xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\" version=\"2.4\">") ;
+ webXml.append(filterDefinitions.getBuffer()) ;
+ webXml.append(filterMappings.getBuffer()) ;
+ webXml.append(servletDefinitions.getBuffer()) ;
+ webXml.append(servletMappings.getBuffer()) ;
+ webXml.append("</web-app>") ;
+
+ addFile(zos, "WEB-INF/web.xml", webXml.toString()) ;
+
+ final File warFile = getESBWarFile(deploymentName, esbName, true) ;
+
+ zos.close() ;
+
+ final FileOutputStream fos = new FileOutputStream(warFile) ;
+ fos.write(baos.toByteArray()) ;
+ fos.close() ;
+ return warFile ;
+ }
+ catch (final Exception ex)
+ {
+ throw new DeploymentException("Failed to create webservice artifact", ex) ;
+ }
+ }
+ }
+ return null ;
+ }
+
+ private File getESBWarFile(final String deploymentName, final String esbName, final boolean createDir)
+ {
+ final File esbDir = new File(esbWarFiles, deploymentName) ;
+ if (!esbDir.exists())
+ {
+ if (!createDir)
+ {
+ return null ;
+ }
+ esbDir.mkdir() ;
+ }
+
+ final int lastSeparator = esbName.lastIndexOf('.') ;
+ final String warFileName = ((lastSeparator >= 0) ? esbName.substring(0, lastSeparator) : esbName) + ".war" ;
+
+ return new File(esbDir, warFileName) ;
+ }
+
+ private void addFile(final ZipOutputStream zos, final String filename, final String contents)
+ throws IOException
+ {
+ addFile(zos, filename, contents.getBytes()) ;
+ }
+
+ private void addFile(final ZipOutputStream zos, final String filename, final byte[] contents)
+ throws IOException
+ {
+ final ZipEntry entry = new ZipEntry(filename) ;
+ zos.putNextEntry(entry) ;
+ zos.write(contents) ;
+ zos.closeEntry() ;
+ }
+
public synchronized void start(DeploymentInfo di)
throws DeploymentException
{
@@ -497,4 +683,113 @@
{
this.serverTmpDir = tmpDir;
}
+
+ static Map<String, String> getSchemas(final File file) throws DeploymentException
+ {
+ if (file == null)
+ {
+ return Collections.emptyMap();
+ }
+
+ if (file.isDirectory())
+ {
+ return getSchemasFromDirectory(file);
+ }
+ else
+ {
+ return getSchemasFromArchive(file);
+ }
+ }
+
+ static Map<String, String> getSchemasFromDirectory(final File directory) throws DeploymentException
+ {
+ if (directory != null)
+ {
+ if (directory.isDirectory())
+ {
+ final File[] schemas = directory.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ return isXsd(name);
+ }
+ });
+ if (schemas.length > 0)
+ {
+ final Map<String, String> schemasMap = new HashMap<String, String>();
+ for (File file : schemas)
+ {
+ try
+ {
+ schemasMap.put(file.getName(), FileUtil.readTextFile(file));
+ }
+ catch (final IOException e)
+ {
+ throw new DeploymentException("IOException while trying to read xsd '" + file.getName() + "'", e);
+ }
+ }
+ return schemasMap;
+ }
+ }
+ }
+
+ return Collections.emptyMap();
+ }
+
+ private static boolean isXsd(final String fileName)
+ {
+ return fileName.endsWith(".xsd");
+ }
+
+ static Map<String, String> getSchemasFromArchive(final File archive) throws DeploymentException
+ {
+ if (archive == null || !archive.isFile() || !archive.getName().endsWith(".esb"))
+ {
+ return Collections.emptyMap();
+ }
+
+ final HashMap<String, String> schemas = new HashMap<String, String>();
+ final ZipFile zip = getZipFile(archive);
+
+ final Enumeration<? extends ZipEntry> entries = zip.entries();
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+
+ final String fileName = entry.getName();
+ if (isXsd(fileName))
+ {
+ InputStream in = null;
+ try
+ {
+ in = zip.getInputStream(entry);
+ schemas.put(fileName, StreamUtils.readStreamString(in, "UTF-8"));
+ }
+ catch (final IOException e)
+ {
+ throw new DeploymentException("IOException while trying to read from file '" + fileName + "' from archive '" + archive + "'", e);
+ }
+ finally
+ {
+ try { in.close(); } catch (IOException ignore) { log.error("Error while trying to close in stream for file '" + fileName + "'", ignore); }
+ }
+ }
+ }
+ return schemas;
+ }
+
+ private static ZipFile getZipFile(final File archive) throws DeploymentException
+ {
+ try
+ {
+ return new ZipFile(archive);
+ }
+ catch (ZipException e)
+ {
+ throw new DeploymentException(e.getMessage(), e);
+ }
+ catch (IOException e)
+ {
+ throw new DeploymentException(e.getMessage(), e);
+ }
+ }
}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -151,7 +151,6 @@
*/
public void create() throws Exception
{
- log.info("Created");
actionArtifactProperties = JBossDeployerUtil.getArtifactProperties(actionArtifactsFile);
}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployer.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployer.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -126,7 +126,7 @@
*/
private BeanMetaData createBeanMetaData(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws DeploymentException, IOException
{
- log.info(esbMetaData);
+ log.debug(esbMetaData);
BeanMetaDataBuilder bmdBuilder = BeanMetaDataBuilder.createBuilder(BEAN_PREFIX + "." + deploymentUnit.getName(), EsbDeployment.class.getName());
// Setup the first constructor argument (esb config xml).
bmdBuilder.addConstructorParameter(String.class.getName(), esbMetaData.getEsbConfigXml());
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -105,7 +105,7 @@
public void start() throws Exception
{
- log.info("Starting EBS Deployment '" + deploymentName + "'");
+ log.info("Starting '" + deploymentName + "'");
if (controller == null)
{
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployer.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployer.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,7 +20,6 @@
*/
package org.jboss.soa.esb.listeners.deployers.mc;
-import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -49,6 +48,7 @@
import org.jboss.metadata.web.spec.ServletMappingMetaData;
import org.jboss.soa.esb.Service;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.deployers.mc.util.VfsUtil;
import org.jboss.virtual.MemoryFileFactory;
import org.jboss.virtual.VirtualFile;
@@ -118,12 +118,19 @@
try
{
- // Used to dynamically add in-memory files to the deployment.
- final URL dynamicClasspathUrl = createDynamicVFS(deploymentUnit, esbMetaData);
+ // Create an in-memory file system
+ final URL inMemRootUrl = VfsUtil.createInMemUrl(esbMetaData.getDeploymentName());
+ final VirtualFile inMemRootDir = VfsUtil.createInMemoryFs(inMemRootUrl);
- // Create WEB-INF/classes
- final URL webInfUrl = new URL(dynamicClasspathUrl.toExternalForm() + "/WEB-INF");
- final URL classesUrl = new URL(webInfUrl + "/classes/");
+ // Attach the in-memory classpath URL and virtual file to this deployment unit so we can remove then upon undeploy.
+ deploymentUnit.addAttachment(DYNAMIC_CL_URL_KEY, inMemRootUrl);
+ deploymentUnit.addAttachment(DYNAMIC_CL_DIR_KEY, inMemRootDir);
+
+ // Add the in-memory classpath to this deployment unit.
+ deploymentUnit.addClassPath(inMemRootDir);
+
+ // Create WEB-INF/classes relative to the in-memory root.
+ final URL classesUrl = VfsUtil.createInMemUrl(inMemRootUrl, "/WEB-INF/classes");
final VirtualFile classesDir = MemoryFileFactory.createDirectory(classesUrl);
deploymentUnit.addClassPath(classesDir);
@@ -137,7 +144,7 @@
{
deploymentUnit.appendMetaDataLocation(classesDir);
final String wsHandlerName = serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml";
- MemoryFileFactory.putFile(new URL(classesUrl + wsHandlerName), handlers.getBytes());
+ VfsUtil.addFile(classesUrl, wsHandlerName, handlers.getBytes());
}
if (serviceInfo.isOneWay())
@@ -152,7 +159,7 @@
final String servletClassName = serviceInfo.getClassName().replace('.', '/') + ".class";
final URL servletClassUrl = new URL(classesUrl + "/" + servletClassName);
// Add the servlet to the virtual file system.
- MemoryFileFactory.putFile(servletClassUrl, servletClass);
+ VfsUtil.addFile(classesUrl, servletClassName, servletClass);
log.debug("Generated ws impl: " + servletClassUrl);
servlets.add(createServlets(service, serviceInfo, generator, includeHandlers));
@@ -184,28 +191,6 @@
}
}
- private URL createDynamicVFS(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws IOException
- {
- // Used to dynamically add in-memory files to the deployment.
- final URL dynamicClasspathUrl = new URL("vfsmemory", esbMetaData.getDeploymentName(), "");
- final VirtualFile dynamicClasspathDir = MemoryFileFactory.createRoot(dynamicClasspathUrl).getRoot();
-
- // Attach the dynamic classpath URL and virtual file to this deployment unit so we can
- // remove then upon undeploy.
- deploymentUnit.addAttachment(DYNAMIC_CL_DIR_KEY, dynamicClasspathDir);
- deploymentUnit.addAttachment(DYNAMIC_CL_URL_KEY, dynamicClasspathUrl);
-
- // Add the dynamic classpath to this deployment unit.
- deploymentUnit.addClassPath(dynamicClasspathDir);
- return dynamicClasspathUrl;
-
- }
-
- private boolean hasWebServices(final List<WebserviceInfo> endpointServices)
- {
- return endpointServices != null && endpointServices.size() > 0;
- }
-
@Override
public void undeploy(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData)
{
@@ -235,6 +220,11 @@
}
}
+ private boolean hasWebServices(final List<WebserviceInfo> endpointServices)
+ {
+ return endpointServices != null && endpointServices.size() > 0;
+ }
+
private ServletMappingMetaData createServletMapping(final ESBServiceEndpointInfo serviceInfo)
{
final ServletMappingMetaData servletMapping = new ServletMappingMetaData();
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployer.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployer.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,6 +20,9 @@
*/
package org.jboss.soa.esb.listeners.deployers.mc;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
@@ -31,8 +34,10 @@
import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
+import org.jboss.soa.esb.listeners.deployers.mc.util.VfsUtil;
import org.jboss.virtual.MemoryFileFactory;
import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
/**
@@ -52,7 +57,6 @@
*/
public class EsbWsdlDeployer extends AbstractSimpleVFSRealDeployer<EsbMetaData>
{
- /** Logger */
private Logger log = Logger.getLogger(EsbWsdlDeployer.class);
/**
@@ -69,6 +73,11 @@
private static final String DYNAMIC_CL_URL_KEY = "WSDL-DYNAMIC-CL-URL";
/**
+ * {@link VirtualFileFilter} that selects '.xsd'.
+ */
+ private static final VirtualFileFilter schemaFileFilter = new SchemaFileFilter();
+
+ /**
* No-args constructor.
*/
public EsbWsdlDeployer()
@@ -78,11 +87,18 @@
setOutput(UnifiedMetaData.class);
}
- public void create()
- {
- log.info("Created");
- }
-
+ /**
+ * Generates a wsdl for all web services specified in the {@link EsbMetaData}s model and makes it available
+ * as deployment unit metadata.
+ * <p/>
+ * Deploy will inspect the {@link EsbMetaData} and see if its model contains web services information and
+ * if so generates the wsdl for them, and will add any additional schemas in the deployment unit to an in-memory
+ * virtual file system.
+ * <p/>
+ *
+ * @param deploymentUnit The {@link VFSDeploymentUnit} for this deploment.
+ * @param esbMetaData The {@link EsbMetaData} for this deployment.
+ */
@Override
public void deploy(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData) throws DeploymentException
{
@@ -91,21 +107,33 @@
{
try
{
- final URL dynamicClassRoot = new URL("vfsmemory", esbMetaData.getDeploymentName() + "_WSDL", "");
- final VirtualFile dynamicClasspathDir = MemoryFileFactory.createRoot(dynamicClassRoot).getRoot();
+ final String inMemoryRoot = esbMetaData.getDeploymentName() + "_WSDL";
+ final URL inMemRootUrl = VfsUtil.createInMemUrl(inMemoryRoot);
+ final VirtualFile inMemRootDir = VfsUtil.createInMemoryFs(inMemRootUrl);
+ // Attach the in-memory classpath URL and virtual file to this deployment unit so we can remove then upon undeploy.
+ deploymentUnit.addAttachment(DYNAMIC_CL_URL_KEY, inMemRootUrl);
+ deploymentUnit.addAttachment(DYNAMIC_CL_DIR_KEY, inMemRootDir);
+
for (WebserviceInfo webserviceInfo : endpointServices)
{
final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo);
final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo, deploymentUnit.getClassLoader());
- final URL wsdlUrl = new URL(dynamicClassRoot + "/" + serviceInfo.getWSDLFileName());
- log.info("Generating wsdl : " + wsdlUrl);
+ final URL wsdlUrl = new URL(inMemRootUrl + "/" + serviceInfo.getWSDLFileName());
+ log.info("Generating wsdl url : " + wsdlUrl);
// Add the wsdl in the virtual file system
- MemoryFileFactory.putFile(wsdlUrl, wsdl.getBytes());
+ VirtualFile putFile = VfsUtil.addFile(inMemRootUrl, serviceInfo.getWSDLFileName(), wsdl.getBytes());
+ //VirtualFile putFile = MemoryFileFactory.putFile(wsdlUrl, wsdl.getBytes());
+ // Get any other schemas in the deployment. They might be imports.
+ List<VirtualFile> schemas = getAllSchemas(deploymentUnit.getRoot());
+
+ // Add the imports to the in-memory virtual file system.
+ addSchemasToVfs(schemas, putFile.getParent(), esbMetaData.getArchiveName());
+
// Add the root of the virtual file system as a meta data location.
- deploymentUnit.appendMetaDataLocation(dynamicClasspathDir);
+ deploymentUnit.appendMetaDataLocation(inMemRootDir);
}
}
catch (final Exception e)
@@ -115,6 +143,49 @@
}
}
+ /**
+ * Retrieves all the schemas (.xsd) from the virtual file root passed in.
+ *
+ * @param root The virtual file that should be searched recursively for schemas.
+ * @return List<VirtualFile> List of virtual files that are schemas.
+ * @throws IOException If an exception in the search occurs.
+ */
+ List<VirtualFile> getAllSchemas(final VirtualFile root) throws IOException
+ {
+ return root.getChildrenRecursively(schemaFileFilter);
+ }
+
+ /**
+ * Will add all the schemas to the virtual file system specified by toVfs.
+ * <p/>
+ * For example, the following vfs file:
+ * "Quickstart_publish_as_webservice.esb/request.xsd"
+ * will be added to the virtual toVfs with the following url:
+ * "vfsmemory://Quickstart_publish_as_webservice_WSDL/WEB-INF/wsdl/ESBServiceSample/request.xsd"
+ * <p/>
+ *
+ * @param schemas The schemas to add.
+ * @param toVfs The destination vfs to which the schemas should be added.
+ * @param archiveName Is the name of this archive deployment.
+ *
+ * @throws MalformedURLException
+ * @throws IOException
+ * @throws URISyntaxException
+ */
+ void addSchemasToVfs(final List<VirtualFile> schemas, VirtualFile toVfs, String archiveName) throws MalformedURLException, IOException, URISyntaxException
+ {
+ VfsUtil.addFiles(schemas, toVfs.toURL(), archiveName, "WEB-INF/wsdl/" + toVfs.getName());
+ }
+
+ /**
+ * Undeploy will inspect the deployment unit to see if the deploy method attached a
+ * {@link VirtualFile} representing an in-memory file system. If one exists it will
+ * be removed.
+ * <p/>
+ *
+ * @param deploymentUnit The {@link VFSDeploymentUnit} for this deploment.
+ * @param esbMetaData The {@link EsbMetaData} for this deployment.
+ */
@Override
public void undeploy(final VFSDeploymentUnit deploymentUnit, final EsbMetaData esbMetaData)
{
@@ -143,4 +214,19 @@
}
}
}
+
+ /**
+ * A {@link VirtualFileFilter} that selects all files ending with
+ * '.xsd'.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+ private static class SchemaFileFilter implements VirtualFileFilter
+ {
+ public boolean accepts(final VirtualFile file)
+ {
+ return file.getName().endsWith(".xsd");
+ }
+ }
}
Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtil.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtil.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.virtual.MemoryFileFactory;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Util methods for interacting with JBoss VFS
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public final class VfsUtil
+{
+ private static final String IN_MEMORY_PROTOCOL = "vfsmemory";
+
+ private static Logger log = Logger.getLogger(VfsUtil.class);
+
+ private VfsUtil() {}
+
+ /**
+ * Creates a new in-memory virtual file system or returns an already existing one..
+ *
+ * @param url The url which of which this host property will be the root of the fs.
+ * @return VirtualFile The {@link VirtualFile} that represents the root of the fs.
+ * @throws IOException
+ */
+ public static VirtualFile createInMemoryFs(final URL rootUrl) throws IOException
+ {
+ //log.info("Creating in-memory fs : '" + rootUrl + "'");
+ return MemoryFileFactory.createRoot(rootUrl).getRoot();
+ }
+
+ /**
+ * Will add the fileContent to the in-memory rootUrl a the location specified by filePath.
+ * </p>
+ *
+ * @param rootUrl The root of the in-memory fs.
+ * @param filePath The path relative to the rootUrl.
+ * @param fileContent The contents of the file to add.
+ * @return {@link VirtualFile} A reference to the newly created file in the in-memory file system.
+ * @throws MalformedURLException
+ */
+ public static VirtualFile addFile(final URL rootUrl, final String filePath, final byte[] fileContent) throws MalformedURLException
+ {
+ final URL fileUrl = new URL(rootUrl + "/" + filePath);
+ return MemoryFileFactory.putFile(fileUrl, fileContent);
+ }
+
+ /**
+ * A simple method that creates a new url with a protocol of 'vfsmemory'.
+ *
+ * @param root Will be the name (hostname) of the root in-memory file system.
+ * @return {@link URL} An url that represents a root of an in-memory file system.
+ * @throws MalformedURLException
+ */
+ public static URL createInMemUrl(final String root) throws MalformedURLException
+ {
+ return new URL(IN_MEMORY_PROTOCOL, root, "");
+ }
+
+ public static URL createInMemUrl(final String root, final String path) throws MalformedURLException
+ {
+ return new URL(IN_MEMORY_PROTOCOL, root, "/" + path);
+ }
+
+ public static URL createInMemUrl(final URL root, final String path) throws MalformedURLException
+ {
+ return new URL(IN_MEMORY_PROTOCOL, root.getHost(), "/" + path);
+ }
+
+ public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath) throws IOException, URISyntaxException
+ {
+ addFiles(files, destUrl, subPath, null);
+ }
+
+ public static void addFiles(final List<VirtualFile> files, final URL destUrl, final String subPath, final String pathPrefix) throws IOException, URISyntaxException
+ {
+ for (final VirtualFile file : files)
+ {
+ InputStream in = null;
+ try
+ {
+ in = file.openStream();
+ final URL newUrl = createInMemUrl(destUrl.getHost(), subpath(file.getPathName(), subPath, pathPrefix));
+ MemoryFileFactory.putFile(newUrl, StreamUtils.readStream(in));
+ }
+ finally
+ {
+ in.close();
+ }
+ }
+ }
+
+ static String subpath(final String path, final String pathName, final String pathPrefix)
+ {
+ if (path == null || pathName == null)
+ {
+ return path;
+ }
+
+ final int idx = path.indexOf(pathName);
+ if (idx != -1)
+ {
+ String filePath = path.substring(idx + pathName.length());
+ if (pathPrefix == null)
+ {
+ return filePath;
+ }
+ else
+ {
+ return pathPrefix + filePath;
+ }
+ }
+
+ return path;
+
+ }
+
+ static String subpath(final String path, final String pathName)
+ {
+ return subpath(path, pathName, null);
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -34,6 +34,7 @@
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.services.security.SecurityContextPropagator;
import org.jboss.internal.soa.esb.services.security.SecurityContextPropagatorFactory;
+import org.jboss.internal.soa.esb.util.SchemaResolver;
import org.jboss.internal.soa.esb.util.XMLHelper;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionLifecycle;
@@ -199,7 +200,7 @@
final String outXsd = config.getAttribute(ListenerTagNames.OUT_XSD_ATTRIBUTE_TAG) ;
try
{
- responseSchema = (outXsd == null ? null : XMLHelper.getSchema(outXsd)) ;
+ responseSchema = (outXsd == null ? null : XMLHelper.getSchema(outXsd));
}
catch (final SAXException saxe)
{
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/util/XssUtil.java (from rev 25886, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XssUtil.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/util/XssUtil.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/util/XssUtil.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Cross Site Scripting (XSS) util class.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public final class XssUtil
+{
+ private static Pattern ampPattern = Pattern.compile("&");
+ private static Pattern quotePattern = Pattern.compile("[\"]");
+ private static Pattern openTagPattern = Pattern.compile("[<]|(%3C)");
+ private static Pattern closeTagPattern = Pattern.compile("[>]|(%3E)");
+
+ private XssUtil()
+ {
+ }
+
+ public static String escape(final String text)
+ {
+ String replace = replace(ampPattern, text, "&");
+ replace = replace(quotePattern, replace, """);
+ replace = replace(openTagPattern, replace, "<");
+ replace = replace(closeTagPattern, replace, ">");
+ return replace;
+ }
+
+ private static String replace(final Pattern pattern, final String text, final String replacement)
+ {
+ final Matcher m = pattern.matcher(text);
+ if (m.find())
+ {
+ return m.replaceAll(replacement);
+ }
+ return text;
+
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/build.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/build.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -118,6 +118,7 @@
</copy>
<copy todir="${org.jboss.esb.tests.classes.dir}" >
<fileset dir="${org.jboss.esb.module.tests.src.dir}" includes="**/*.xml" />
+ <fileset dir="${org.jboss.esb.module.tests.src.dir}" includes="**/*.xsd" />
</copy>
<copy file="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb-1.0.1.xsd" todir="${org.jboss.esb.tests.classes.dir}"/>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SchemaResolverUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.Reader;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * Unit test for {@link SchemaResolver}.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class SchemaResolverUnitTest
+{
+ private SchemaResolver schemaResolver;
+
+ @Before
+ public void setup() throws URISyntaxException
+ {
+ URL resource = getClass().getResource("/org/jboss/internal/soa/esb/util/types/custom-type.xsd");
+ schemaResolver = new SchemaResolver(resource.toURI());
+ }
+
+ @Test
+ public void testSchemaOnClasspath()
+ {
+ final String type = "http://www.w3.org/2001/XMLSchema";
+ final String systemId = "custom-type.xsd";
+
+ LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
+ Reader characterStream = lsInput.getCharacterStream();
+ assertNotNull(characterStream);
+ }
+
+ @Test
+ public void testSchemaWithHttpUrlSystemId()
+ {
+ final String type = "http://www.w3.org/2001/XMLSchema";
+
+ final String systemId = "http://www.jboss.org/esb/custom-type.xsd";
+
+ LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
+ assertNull(lsInput.getCharacterStream());
+ assertNotNull(lsInput.getSystemId());
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(SchemaResolverUnitTest.class);
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/XMLHelperUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,23 +20,50 @@
*/
package org.jboss.internal.soa.esb.util;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
import java.util.Properties;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.validation.Schema;
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.testutils.StringUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.AbstractHandler;
+import org.xml.sax.SAXException;
-import junit.framework.TestCase;
-
/**
* Tests associated with the XML helper class.
*
* @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
*/
-public class XMLHelperUnitTest extends TestCase
+public class XMLHelperUnitTest
{
+ private static String returnUrl;
+ private static Server server;
+
+ private static final int PORT = 9999;
+ private static final String CONTEXT = "schematest";
+
+ @Test
public void testReplaceSystemProperties()
throws Exception
{
@@ -64,4 +91,98 @@
final boolean match = StringUtils.compareXMLContent(expectedContents, contents) ;
assertTrue("System property replacement", match) ;
}
+
+ @Test
+ public void testValidateSchemaOnCPWithImportsFromSubdir() throws ConfigurationException, UnsupportedEncodingException, SAXException
+ {
+ final Schema schema = XMLHelper.getSchema("/org/jboss/internal/soa/esb/util/schemas/request.xsd");
+
+ final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+ assertTrue(XMLHelper.validate(schema, xml));
+ }
+
+ @Test
+ public void testValidateSchemaOnCPWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+ {
+ final Schema schema = XMLHelper.getSchema("/org/jboss/internal/soa/esb/util/request2.xsd");
+
+ final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+ assertTrue(XMLHelper.validate(schema, xml));
+ }
+
+ @Test
+ public void testValidateSchemaOnFSWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+ {
+ URL resource = getClass().getResource("/org/jboss/internal/soa/esb/util/request2.xsd");
+ File file = new File(resource.getFile());
+ final Schema schema = XMLHelper.getSchema(file.getAbsolutePath());
+
+ final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+ assertTrue(XMLHelper.validate(schema, xml));
+ }
+
+ /**
+ * This is an integration test that is intended to be run manually.
+ */
+ @Test
+ public void testValidateSchemaHttpWithImports() throws ConfigurationException, UnsupportedEncodingException, SAXException
+ {
+ final Schema schema = XMLHelper.getSchema("http://localhost:9999/schemastest/request2.xsd");
+
+ final String xml = StreamUtils.readStreamString(getClass().getResourceAsStream("sample-request.xml"), "UTF-8");
+ assertTrue(XMLHelper.validate(schema, xml));
+ }
+
+
+ @BeforeClass
+ public static void setupJetty() throws Exception
+ {
+ server = new Server(PORT);
+ Handler handler = new AbstractHandler()
+ {
+ public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException
+ {
+ handleHttpRequest(target, request, response);
+ }
+ };
+
+ returnUrl = "http://localhost:" + Integer.toString(PORT) + "/" + CONTEXT;
+ server.setHandler(handler);
+ server.start();
+ }
+
+ public static void handleHttpRequest(String target, HttpServletRequest request, HttpServletResponse response)
+ {
+ try
+ {
+ String pathInfo = request.getPathInfo();
+ String file = pathInfo.substring(pathInfo.indexOf("/" + CONTEXT) + CONTEXT.length() + 3);
+ file = "/org/jboss/internal/soa/esb/util/" + file;
+ InputStream in = org.jboss.soa.esb.util.ClassUtil.getResourceAsStream(file, XMLHelperUnitTest.class);
+ String xsd = StreamUtils.readStreamString(in, "UTF-8");
+ response.setContentType("text/html");
+ response.getOutputStream().write(xsd.getBytes());
+ response.setStatus(HttpServletResponse.SC_OK);
+ ((Request)request).setHandled(true);
+ }
+ catch(Exception ignore)
+ {
+ }
+ }
+
+ @AfterClass
+ public static void shutdownJetty()
+ {
+ try
+ {
+ server.stop();
+ }
+ catch (Exception ignore) { }
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(XMLHelperUnitTest.class);
+ }
+
}
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/request2.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/sayHi"
+ xmlns:x1="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="./types/custom-type.xsd"/>
+
+ <xs:element name="sayHi" type="x1:sayHi"/>
+
+ <xs:complexType name="sayHi">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="1"/>
+ <xs:element ref="cust:customType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/sample-request.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<say:sayHi
+ xmlns:say="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:t="http://www.jboss.org/type2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <say:arg0>HelloWorld</say:arg0>
+
+ <cust:customType>
+ <cust:type>Some text</cust:type>
+ <sub:subType>
+ <sub:type>Some more text</sub:type>
+ <t:type2>
+ <t:type>Even more text</t:type>
+ </t:type2>
+ </sub:subType>
+ </cust:customType>
+
+</say:sayHi>
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,18 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/sayHi"
- xmlns:x1="http://www.jboss.org/sayHi"
- xmlns:cust="http://www.jboss.org/custom-request"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
-
- <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="../types/custom-type.xsd"/>
-
- <xs:element name="sayHi" type="x1:sayHi"/>
-
- <xs:complexType name="sayHi">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="1"/>
- <xs:element ref="cust:customType" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
-</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/schemas/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/sayHi"
+ xmlns:x1="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="../types/custom-type.xsd"/>
+
+ <xs:element name="sayHi" type="x1:sayHi"/>
+
+ <xs:complexType name="sayHi">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="1"/>
+ <xs:element ref="cust:customType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,18 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/custom-request"
- xmlns:cust="http://www.jboss.org/custom-request"
- xmlns:sub="http://www.jboss.org/custom-subtype"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
-
- <xs:element name="customType" type="cust:CustomType"/>
-
- <xs:complexType name="CustomType">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="1"/>
- <xs:element ref="sub:subType" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/custom-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/custom-request"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
+
+ <xs:element name="customType" type="cust:CustomType"/>
+
+ <xs:complexType name="CustomType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="1"/>
+ <xs:element ref="sub:subType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,18 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/custom-subtype"
- xmlns:sub="http://www.jboss.org/custom-subtype"
- xmlns:t="http://www.jboss.org/type2"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
-
- <xs:element name="subType" type="sub:SubType"/>
-
- <xs:complexType name="SubType">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="0"/>
- <xs:element ref="t:type2" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/subtypes/custom-subtype-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/custom-subtype"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:t="http://www.jboss.org/type2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
+
+ <xs:element name="subType" type="sub:SubType"/>
+
+ <xs:complexType name="SubType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="0"/>
+ <xs:element ref="t:type2" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,14 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/type2"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://www.jboss.org/type2"
- elementFormDefault="qualified">
-
- <xs:element name="type2" type="t:Type2"/>
-
- <xs:complexType name="Type2">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/types/type2-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,14 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/type2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://www.jboss.org/type2"
+ elementFormDefault="qualified">
+
+ <xs:element name="type2" type="t:Type2"/>
+
+ <xs:complexType name="Type2">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/ESBContractGeneratorUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -29,6 +29,7 @@
import javax.wsdl.Definition;
import javax.wsdl.Operation;
import javax.wsdl.PortType;
+import javax.wsdl.Types;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
@@ -65,9 +66,19 @@
public void testRequest110() throws Exception {
executeTest("jbossesb_config_08.110.xml") ;
}
+
+ public void testDuplicateSchemas() throws Exception {
+ Definition def = executeTest("jbossesb_duplicate_schemas.xml") ;
+ Types types = def.getTypes();
+ assertEquals(1, types.getExtensibilityElements().size());
+ def = executeTest("jbossesb_duplicate_schemas2.xml") ;
+ types = def.getTypes();
+ assertEquals(2, types.getExtensibilityElements().size());
+ }
+
@SuppressWarnings("unchecked")
- public void testWSAExtensions110() throws Exception {
+ public void _testWSAExtensions110() throws Exception {
final String targetNamespace = "http://soa.jboss.org/FirstServiceESB" ;
final String wsawNamespace = "http://www.w3.org/2006/05/addressing/wsdl" ;
@@ -115,6 +126,7 @@
final WebserviceInfo service = services.get(0) ;
final ESBServiceEndpointInfo endpointInfo = new ESBServiceEndpointInfo(service) ;
String wsdl = ESBContractGenerator.generateWSDL(service, endpointInfo);
+ //System.out.println(wsdl);
java.io.StringReader strReader = new java.io.StringReader(wsdl);
InputSource inputSource = new InputSource(strReader);
Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL("file://tmp.wsdl", inputSource);
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas.xml (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,16 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd">
+ <services>
+ <service category="FirstServiceESB" name="SimpleListener" description="Hello World" invmScope="GLOBAL">
+ <actions
+ inXsd="/org/jboss/internal/soa/esb/webservice/request.xsd"
+ outXsd="/org/jboss/internal/soa/esb/webservice/request.xsd"
+ faultXsd="/org/jboss/internal/soa/esb/webservice/request.xsd"
+ addressing="true">
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true" />
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas2.xml (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas2.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas2.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/internal/soa/esb/webservice/jbossesb_duplicate_schemas2.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,16 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd">
+ <services>
+ <service category="FirstServiceESB" name="SimpleListener" description="Hello World" invmScope="GLOBAL">
+ <actions
+ inXsd="/org/jboss/internal/soa/esb/webservice/request.xsd"
+ outXsd="/org/jboss/internal/soa/esb/webservice/request.xsd"
+ faultXsd="/org/jboss/internal/soa/esb/webservice/fault.xsd"
+ addressing="true">
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <property name="printfull" value="true" />
+ </action>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerUnitTest.java (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.config;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.deployment.DeploymentException;
+import org.junit.Test;
+
+/**
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class JBoss4ESBDeployerUnitTest
+{
+ @Test
+ public void getSchemasFromFileShouldReturnEmptyMap() throws DeploymentException
+ {
+ File file = new File(getClass().getResource("schemasDir/mock.xsd").getFile());
+ Map<String, String> schemas = JBoss4ESBDeployer.getSchemasFromDirectory(file);
+ assertTrue(schemas.isEmpty());
+ }
+
+ @Test
+ public void getSchemas() throws DeploymentException
+ {
+ File directory = new File(getClass().getResource("schemasDir").getFile());
+ Map<String, String> schemas = JBoss4ESBDeployer.getSchemasFromDirectory(directory);
+ assertTrue(schemas.containsKey("mock.xsd"));
+ }
+
+ @Test
+ public void getSchemasFromArchive() throws DeploymentException
+ {
+ URL resource = getClass().getResource("schemasDir.esb");
+ File archive = new File(resource.getFile());
+ Map<String, String> schemas = JBoss4ESBDeployer.getSchemasFromArchive(archive);
+ assertTrue(schemas.containsKey("mock.xsd"));
+ }
+
+ @Test
+ public void getSchemasFromArchiveNullArchive() throws DeploymentException
+ {
+ Map<String, String> schemas = JBoss4ESBDeployer.getSchemasFromArchive(null);
+ assertTrue(schemas.isEmpty());
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(JBoss4ESBDeployerUnitTest.class);
+ }
+
+}
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,9 +0,0 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom" xmlns:x1="http://www.jboss.org/custom" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="customType" type="x1:type"/>
- <xs:complexType name="type">
- <xs:sequence>
- <xs:element name="customType" type="xs:string" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/mock.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,9 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom" xmlns:x1="http://www.jboss.org/custom" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="customType" type="x1:type"/>
+ <xs:complexType name="type">
+ <xs:sequence>
+ <xs:element name="customType" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,9 +0,0 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom" xmlns:x1="http://www.jboss.org/custome" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="customType" type="x1:type"/>
- <xs:complexType name="type">
- <xs:sequence>
- <xs:element name="customType" type="xs:string" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,9 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom" xmlns:x1="http://www.jboss.org/custome" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="customType" type="x1:type"/>
+ <xs:complexType name="type">
+ <xs:sequence>
+ <xs:element name="customType" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir.esb (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/schemasDir.esb)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployerUnitTest.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployerUnitTest.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWebServiceDeployerUnitTest.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -6,13 +6,12 @@
<bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser"/>
- <!-- bean name="EsbClassPathSetup" class="org.jboss.soa.esb.listeners.deployers.mc.EsbWebServiceClassPathSetup"/-->
-
<bean name="EsbWebServiceDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbWebServiceDeployer"/>
+ <!-- bean name="EsbWsdlDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbWsdlDeployer"/-->
+
<bean name="EsbDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbDeployer"/>
-
<bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
<property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
<property name="deployers"><inject bean="Deployers"/></property>
Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+import org.jboss.virtual.MemoryFileFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Unit test for {@link EsbWsdlDeployer}
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class EsbWsdlDeployerUnitTest extends MicrocontainerTest
+{
+ private URL dir = getClass().getResource("/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives");
+
+ public EsbWsdlDeployerUnitTest(String name)
+ {
+ super(name);
+ }
+
+ public void testGetAllSchemas() throws Throwable
+ {
+ final VirtualFile virtualFile = VFS.getVirtualFile(dir, "exploded-esb-archive.esb");
+ final EsbWsdlDeployer esbWsdlDeployer = new EsbWsdlDeployer();
+ final List<VirtualFile> schemas = esbWsdlDeployer.getAllSchemas(virtualFile);
+
+ assertNotNull(schemas);
+ assertEquals(2, schemas.size());
+ }
+
+ public void testAddSchemasToVFS() throws IOException, URISyntaxException
+ {
+ final String archiveName = "exploded-esb-archive.esb";
+ final VirtualFile virtualFile = VFS.getVirtualFile(dir, archiveName);
+ final EsbWsdlDeployer esbWsdlDeployer = new EsbWsdlDeployer();
+ final List<VirtualFile> schemas = esbWsdlDeployer.getAllSchemas(virtualFile);
+
+ final URL dynamicClassRootUrl = new URL("vfsmemory", "junit", "");
+ final VirtualFile dynamicClasspathDir = MemoryFileFactory.createRoot(dynamicClassRootUrl).getRoot();
+ final URL wsdlUrl = new URL(dynamicClassRootUrl + "/somefile");
+ VirtualFile putFile = MemoryFileFactory.putFile(wsdlUrl, "dummy".getBytes());
+
+ esbWsdlDeployer.addSchemasToVfs(schemas, putFile.getParent(), archiveName);
+
+ final List<VirtualFile> addedSchemas = esbWsdlDeployer.getAllSchemas(dynamicClasspathDir);
+ assertNotNull(addedSchemas);
+ assertEquals(2, addedSchemas.size());
+
+ for (final VirtualFile schemaFile : addedSchemas)
+ {
+ final String fileName = schemaFile.getName();
+ if (fileName.equals("request.xsd"))
+ {
+ assertEquals("vfsmemory://junit/WEB-INF/wsdl/request.xsd", schemaFile.toURL().toString());
+ }
+ else
+ {
+ assertEquals("vfsmemory://junit/WEB-INF/wsdl/types/custom-request-type.xsd", schemaFile.toURL().toString());
+ }
+ }
+ }
+}
Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbWsdlDeployerUnitTest.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser"/>
+
+ <bean name="EsbWebServiceDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbWebServiceDeployer"/>
+
+ <bean name="EsbWsdlDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbWsdlDeployer"/>
+
+ <bean name="EsbDeployer" class="org.jboss.soa.esb.listeners.deployers.mc.EsbDeployer"/>
+
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ </bean>
+
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+ </property>
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <bean name="EsbStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+ <incallback method="addJarExtension">
+ <parameter><inject bean="EsbExtensionProvider"/></parameter>
+ </incallback>
+ </bean>
+ <bean name="EsbExtensionProvider" class="org.jboss.soa.esb.listeners.deployers.mc.EsbExtensionProvider"/>
+
+ <!--
+ The classloader implementation
+ -->
+ <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+ <classloader><null/></classloader>
+ <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+ </bean>
+
+ <!--
+ ClassLoader management and resolution
+ -->
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <classloader><null/></classloader>
+ <incallback method="addModule" state="Configured"/>
+ <uncallback method="removeModule" state="Configured"/>
+ </bean>
+
+
+</deployment>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/request.xsd
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/request.xsd 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,8 +1,17 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/sayHi"
+ xmlns:x1="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="./types/custom-request-type.xsd"/>
+
<xs:element name="sayHi" type="x1:sayHi"/>
<xs:complexType name="sayHi">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="1"/>
+ <xs:element ref="cust:customType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/types/custom-request-type.xsd
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/types/custom-request-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/test_esb_archives/exploded-esb-archive.esb/types/custom-request-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,14 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/custom-request"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:element name="customType" type="cust:CustomType"/>
+
+ <xs:complexType name="CustomType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtilUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/util/VfsUtilUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.listeners.deployers.mc.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.virtual.MemoryFileFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit test for {@link VfsUtil}.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class VfsUtilUnitTest
+{
+ @BeforeClass
+ public static void initVFS()
+ {
+ VFS.init();
+ }
+
+ @Test
+ public void createInMemoryFs() throws IOException
+ {
+ final URL rootUrl = new URL("vfsmemory", "VfsUtilUnitTest", "");
+ final VirtualFile root = VfsUtil.createInMemoryFs(rootUrl);
+ assertNotNull(root);
+
+ final VirtualFile root2 = VfsUtil.createInMemoryFs(rootUrl);
+ assertEquals(root, root2);
+ }
+
+ @Test
+ public void addFile() throws IOException
+ {
+ final URL rootUrl = new URL("vfsmemory", "VfsUtilUnitTest", "");
+ final VirtualFile rootFs = VfsUtil.createInMemoryFs(rootUrl);
+
+ VfsUtil.addFile(rootUrl, "test.xml", "bajja".getBytes());
+ final VirtualFile testFile = rootFs.getChild("test.xml");
+ assertNotNull(testFile);
+ }
+
+ @Test
+ public void createUrl() throws MalformedURLException
+ {
+ URL rootUrl = VfsUtil.createInMemUrl("vsftest");
+ assertEquals("vfsmemory://vsftest", rootUrl.toExternalForm());
+ }
+
+ @Test
+ public void createUrlPath() throws MalformedURLException
+ {
+ URL rootUrl = VfsUtil.createInMemUrl("vsftest", "WEB-INF");
+ assertEquals("vfsmemory://vsftest/WEB-INF", rootUrl.toExternalForm());
+ }
+
+ @Test
+ public void createUrlPathUrl() throws IOException
+ {
+ URL rootUrl = VfsUtil.createInMemUrl("vsftest");
+ URL pathUrl = VfsUtil.createInMemUrl(rootUrl, "WEB-INF/classes");
+ assertEquals("vfsmemory://vsftest/WEB-INF/classes", pathUrl.toExternalForm());
+ }
+
+ @Test
+ public void addFilesInFromInMemFs() throws IOException, URISyntaxException
+ {
+ URL sourceUrl = VfsUtil.createInMemUrl("vsftest");
+ VfsUtil.createInMemoryFs(sourceUrl);
+ VirtualFile file1 = VfsUtil.addFile(sourceUrl, "test", "dummy".getBytes());
+ VirtualFile file2 = VfsUtil.addFile(sourceUrl, "test2", "dummy".getBytes());
+
+ URL destUrl = VfsUtil.createInMemUrl("vsftest2");
+ VirtualFile destDir = VfsUtil.createInMemoryFs(destUrl);
+
+ VfsUtil.addFiles(Arrays.asList(file1, file2), destUrl, null);
+
+ assertNotNull(destDir.getChild("test"));
+ assertNotNull(destDir.getChild("test2"));
+ }
+
+ @Test
+ public void addSchemasInFromInMemFs() throws IOException, URISyntaxException
+ {
+ URL sourceUrl = VfsUtil.createInMemUrl("vsftest");
+ VfsUtil.createInMemoryFs(sourceUrl);
+ VirtualFile file1 = VfsUtil.addFile(sourceUrl, "/rootPath/somepath/types/test.xsd", "dummy".getBytes());
+ VirtualFile file2 = VfsUtil.addFile(sourceUrl, "/rootPath/somepath/types/test2.xsd", "dummy".getBytes());
+
+ URL destUrl = VfsUtil.createInMemUrl("vsftest2");
+ VirtualFile destDir = VfsUtil.createInMemoryFs(destUrl);
+
+ VfsUtil.addFiles(Arrays.asList(file1, file2), destUrl, "somepath", "WEB-INF/wsdl");
+
+ assertNotNull(destDir.getChild("WEB-INF/wsdl/types/test.xsd"));
+ assertNotNull(destDir.getChild("WEB-INF/wsdl/types/test2.xsd"));
+ }
+
+ @Test
+ public void addFilesInFromFileFs() throws IOException, URISyntaxException
+ {
+ File workDir = null;
+ try
+ {
+ // Create a working directory in the OS tmp dir.
+ File tmpFile = File.createTempFile("test", "junit");
+ tmpFile.deleteOnExit();
+ File tmpDir = new File(tmpFile.getParent());
+ workDir = new File(tmpDir, "VfsTest");
+ workDir.mkdir();
+
+ // Add two files to the working directory.
+ File file1 = new File(workDir, "test1.txt");
+ file1.createNewFile();
+ File file2 = new File(workDir, "test2.txt");
+ file2.createNewFile();
+
+ // Create a new virtual root using the workDir.
+ VirtualFile root = VFS.createNewRoot(workDir.toURI());
+ List<VirtualFile> files = root.getChildren();
+ assertEquals(2, files.size());
+
+ URL destUrl = VfsUtil.createInMemUrl("vsftest2");
+ VirtualFile destDir = VfsUtil.createInMemoryFs(destUrl);
+
+ VfsUtil.addFiles(files, destUrl, null);
+ assertNotNull(destDir.getChild("test"));
+ assertNotNull("test1.txt", destDir.getChild("test").getPathName());
+ assertNotNull(destDir.getChild("test2"));
+ assertNotNull("test2.txt", destDir.getChild("test2").getPathName());
+ }
+ finally
+ {
+ if (workDir != null)
+ {
+ File[] listFiles = workDir.listFiles();
+ for (File file : listFiles)
+ {
+ file.delete();
+ }
+ workDir.delete();
+ }
+ }
+ }
+
+ @Test
+ public void subpath()
+ {
+ String actualPath = "Test.esb/types/custom-request-type.xsd";
+ String expectedPath = "/types/custom-request-type.xsd";
+ assertEquals(expectedPath, VfsUtil.subpath(actualPath, "Test.esb"));
+ assertEquals(null, VfsUtil.subpath(null, "Test.esb"));
+ assertEquals(actualPath, VfsUtil.subpath(actualPath, null));
+ assertEquals(actualPath, VfsUtil.subpath(actualPath, "dummy"));
+ }
+
+ @Test
+ public void subpathWithSuffix()
+ {
+ String actualPath = "Test.esb/types/custom-request-type.xsd";
+ String expectedPath = "WEB-INF/wsdl/types/custom-request-type.xsd";
+
+ assertEquals(expectedPath, VfsUtil.subpath(actualPath, "Test.esb", "WEB-INF/wsdl"));
+ }
+
+}
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/util/XssUtilUnitTest.java (from rev 25886, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XssUtilUnitTest.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/util/XssUtilUnitTest.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/util/XssUtilUnitTest.java 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.util;
+
+import static org.junit.Assert.*;
+import junit.framework.JUnit4TestAdapter;
+
+import org.junit.Test;
+
+/**
+ * Unit test for {@link XssUtil}.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class XssUtilUnitTest
+{
+ private String expectedUrl = "http://www.jboss.org/jbossesb/attribute.jsp?<script>alert('sometext')</script>";
+ private String expectedUrlNonClosingTags = "http://www.jboss.org/jbossesb/attribute.jsp?<script>alert('sometext')<script>";
+
+ @Test
+ public void escapeNoSpecialCharacters()
+ {
+ String url = "http://wwww.jboss.org/jbossesb/attribute.jsp";
+ String escaped = XssUtil.escape(url);
+ assertEquals(url, escaped);
+ }
+
+ @Test
+ public void escapeScriptTag()
+ {
+ String escaped = XssUtil.escape("http://www.jboss.org/jbossesb/attribute.jsp?<script>alert('sometext')</script>");
+ assertEquals(expectedUrl, escaped);
+ }
+
+ @Test
+ public void escapeScriptTagsWithOutClosingTag()
+ {
+ String escaped = XssUtil.escape("http://www.jboss.org/jbossesb/attribute.jsp?<script>alert('sometext')<script>");
+ assertEquals(expectedUrlNonClosingTags, escaped);
+ }
+
+ @Test
+ public void escapeUnicodeScriptTags()
+ {
+ String escaped = XssUtil.escape("http://www.jboss.org/jbossesb/attribute.jsp?%3Cscript%3Ealert('sometext')%3C/script%3E");
+ assertEquals(expectedUrl, escaped);
+ }
+
+ @Test
+ public void escapeUnicodeScriptTagsWithOutClosingTag()
+ {
+ String escaped = XssUtil.escape("http://www.jboss.org/jbossesb/attribute.jsp?%3Cscript%3Ealert('sometext')%3Cscript%3E");
+ assertEquals(expectedUrlNonClosingTags, escaped);
+ }
+
+ @Test
+ public void escapeQuote()
+ {
+ String escaped = XssUtil.escape("\"sometext\"");
+ assertEquals(""sometext"", escaped);
+
+ }
+
+ @Test
+ public void escapeBodyOnloadTag()
+ {
+ String escaped = XssUtil.escape("http://127.0.0.1:8080/jbossesb/attribute.jsp?servername=%22%3CBODY%20ONLOAD=alert(%27XSS%27)%3E%22&id=80");
+ assertEquals("http://127.0.0.1:8080/jbossesb/attribute.jsp?servername=%22<BODY%20ONLOAD=alert(%27XSS%27)>%22&id=80", escaped);
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(XssUtilUnitTest.class);
+ }
+
+}
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/native_client/readme.txt
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/native_client/readme.txt 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/native_client/readme.txt 2009-05-13 08:11:46 UTC (rev 26493)
@@ -20,6 +20,8 @@
1. In a command terminal window in the quickstart folder type 'ant deploy'.
2. Using a browser, hit the following URL: "http://localhost:8080/jbossws".
+
+ Click on the "View a list of deployed services" link.
You should see something like the following:
-----------------------------------------------------------------------
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/build.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/build.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -6,7 +6,7 @@
</description>
<!-- additional deploys -->
- <property name="additional.deploys" value="*.xsd"/>
+ <property name="additional.deploys" value="*.xsd types/**/*.xsd"/>
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/error-soap-message.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,9 +1,28 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:say="http://www.jboss.org/sayHi">
+<soap:Envelope
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:say="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:t="http://www.jboss.org/type2">
<soap:Body>
- <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>
+
+ <say:sayHi>
+ <say:arg0>Error</say:arg0>
+
+ <cust:customType>
+ <cust:type>Some text</cust:type>
+ <sub:subType>
+ <sub:type>Some more text</sub:type>
+ <t:type2>
+ <t:type>Even more text</t:type>
+ </t:type2>
+ </sub:subType>
+ </cust:customType>
+ </say:sayHi>
+
</soap:Body>
-</soap:Envelope>
+</soap:Envelope>
+
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -25,7 +25,7 @@
maxThreads="1"
/>
</listeners>
- <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd">
+ <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" validate="true">
<action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
</actions>
</service>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/readme.txt
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/readme.txt 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/readme.txt 2009-05-13 08:11:46 UTC (rev 26493)
@@ -3,6 +3,9 @@
The purpose of the publish_as_webservice quickstart sample is to demonstrate how to
publish a esb service as a web service.
+ This quickstart also demonstrates how messages can be validate by JBossESB by configuring
+ a service for validation and how schemas imports are used.
+
Running this quickstart:
========================
Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
@@ -31,3 +34,24 @@
2. sendesb ant target
This target will call the SendEsbMessage twice. The first call will be with a valid message body content
and the second will generate a FaultMessageException.
+
+What to look for in this quickstart
+===================================
+ 1. Message validation
+ Validation of request and response messages can be enabled by setting the 'validate' attribute to true.
+ For example:
+ <actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" validate="true">
+ ...
+ </actions>
+
+ 2. Schema imports
+ Schema import elements are used to add multiple schemas with different target namespaces to a document.
+
+ a) Take a look the import element in request.xsd:
+ <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="custom-request-type.xsd"/>
+ This custom-request-type.xsd should in this case be packaged in the root of the .esb archive.
+
+ b) Another example can be found in response.xsd:
+ <xs:import namespace="http://www.jboss.org/custom-response" schemaLocation="imports/custom-response-type.xsd"/>
+ In this case the xsd has is located in a directory named 'imports' in the .esb archive.
+
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/request.xsd
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/request.xsd 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/request.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,8 +1,19 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/sayHi"
+ xmlns:x1="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-request" schemaLocation="./types/custom-request-type.xsd"/>
+
<xs:element name="sayHi" type="x1:sayHi"/>
+
<xs:complexType name="sayHi">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="1"/>
+ <xs:element ref="cust:customType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
+
</xs:schema>
+
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/response.xsd
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/response.xsd 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/response.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,8 +1,17 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/sayHi"
+ xmlns:x1="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-response"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-response" schemaLocation="types/custom-response-type.xsd"/>
+
<xs:element name="sayHiResponse" type="x1:sayHiResponse"/>
<xs:complexType name="sayHiResponse">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ <xs:element name="importedElement" type="cust:customType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/soap-userpass-message.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,11 +1,29 @@
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+<soap:Envelope
+ xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:say="http://www.jboss.org/sayHi">
+ xmlns:say="http://www.jboss.org/sayHi"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:t="http://www.jboss.org/type2">
<soap:Body>
- <say:sayHi>
- <say:arg0>HelloWorld</say:arg0>
- </say:sayHi>"
+
+ <say:sayHi>
+
+ <say:arg0>HelloWorld</say:arg0>
+
+ <cust:customType>
+ <cust:type>Some text</cust:type>
+ <sub:subType>
+ <sub:type>Some more text</sub:type>
+ <t:type2>
+ <t:type>Even more text</t:type>
+ </t:type2>
+ </sub:subType>
+ </cust:customType>
+
+ </say:sayHi>
+
</soap:Body>
</soap:Envelope>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,18 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/custom-request"
- xmlns:cust="http://www.jboss.org/custom-request"
- xmlns:sub="http://www.jboss.org/custom-subtype"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
-
- <xs:element name="customType" type="cust:CustomType"/>
-
- <xs:complexType name="CustomType">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="1"/>
- <xs:element ref="sub:subType" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-request-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,18 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/custom-request"
+ xmlns:cust="http://www.jboss.org/custom-request"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/custom-subtype" schemaLocation="./subtypes/custom-subtype-type.xsd"/>
+
+ <xs:element name="customType" type="cust:CustomType"/>
+
+ <xs:complexType name="CustomType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="1"/>
+ <xs:element ref="sub:subType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,8 +0,0 @@
-<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom-response" xmlns:cust="http://www.jboss.org/custom-response" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
-
- <xs:complexType name="customType">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/custom-response-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/custom-response" xmlns:cust="http://www.jboss.org/custom-response" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+ <xs:complexType name="customType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/subtypes)
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,19 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/custom-subtype"
- xmlns:sub="http://www.jboss.org/custom-subtype"
- xmlns:t="http://www.jboss.org/type2"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
-
- <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
-
- <xs:element name="subType" type="sub:SubType"/>
-
- <xs:complexType name="SubType">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="0"/>
- <xs:element ref="t:type2" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/subtypes/custom-subtype-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,19 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/custom-subtype"
+ xmlns:sub="http://www.jboss.org/custom-subtype"
+ xmlns:t="http://www.jboss.org/type2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <xs:import namespace="http://www.jboss.org/type2" schemaLocation="../type2-type.xsd"/>
+
+ <xs:element name="subType" type="sub:SubType"/>
+
+ <xs:complexType name="SubType">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="0"/>
+ <xs:element ref="t:type2" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Deleted: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd 2009-03-30 11:04:46 UTC (rev 25886)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,15 +0,0 @@
-<xs:schema version="1.0"
- targetNamespace="http://www.jboss.org/type2"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://www.jboss.org/type2"
- elementFormDefault="qualified">
-
- <xs:element name="type2" type="t:Type2"/>
-
- <xs:complexType name="Type2">
- <xs:sequence>
- <xs:element name="type" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd (from rev 25886, labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd)
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice/types/type2-type.xsd 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,15 @@
+<xs:schema version="1.0"
+ targetNamespace="http://www.jboss.org/type2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://www.jboss.org/type2"
+ elementFormDefault="qualified">
+
+ <xs:element name="type2" type="t:Type2"/>
+
+ <xs:complexType name="Type2">
+ <xs:sequence>
+ <xs:element name="type" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice_inonly/listener.log
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice_inonly/listener.log 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/publish_as_webservice_inonly/listener.log 2009-05-13 08:11:46 UTC (rev 26493)
@@ -1,20 +1,34 @@
-2008-10-24 10:08:10,203 DEBUG [main][httpclient.wire.header] >> "POST /Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubService?wsdl HTTP/1.1[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Host: 127.0.0.1:8080[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "Content-Length: 324[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.header] >> "[\r][\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" [\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsd="http://www.w3.org/2001/XMLSchema"[\n]"
-2008-10-24 10:08:10,218 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:say="http://www.jboss.org/sayHi">[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <soap:Body>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " <say:sayHi><say:arg0>Error</say:arg0></say:sayHi>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> " </soap:Body>[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "[\n]"
-2008-10-24 10:08:10,234 DEBUG [main][httpclient.wire.content] >> "</soap:Envelope> [\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Content-Length: 0[\r][\n]"
-2008-10-24 10:08:10,281 DEBUG [main][httpclient.wire.header] << "Date: Fri, 24 Oct 2008 09:08:10 GMT[\r][\n]"
+2009-05-11 10:22:11,355 DEBUG [main][httpclient.wire.header] >> "POST /Quickstart_publish_as_webservice_inonly/ESBServiceSample/HelloWorldPubServiceInOnly?wsdl HTTP/1.1[\r][\n]"
+2009-05-11 10:22:11,367 DEBUG [main][httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
+2009-05-11 10:22:11,367 DEBUG [main][httpclient.wire.header] >> "Host: 127.0.0.1:8080[\r][\n]"
+2009-05-11 10:22:11,368 DEBUG [main][httpclient.wire.header] >> "Content-Length: 337[\r][\n]"
+2009-05-11 10:22:11,368 DEBUG [main][httpclient.wire.header] >> "[\r][\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" [\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:xsd="http://www.w3.org/2001/XMLSchema"[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9][0x9]xmlns:say="http://www.jboss.org/sayHi">[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> " <soap:Body>[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> " <say:sayHi>[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[0x9][0x9]<say:arg0>HelloWorld</say:arg0>[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[0x9] </say:sayHi>"[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> " </soap:Body>[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "[\n]"
+2009-05-11 10:22:11,369 DEBUG [main][httpclient.wire.content] >> "</soap:Envelope> [\n]"
+2009-05-11 10:22:11,423 DEBUG [main][httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
+2009-05-11 10:22:11,425 DEBUG [main][httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
+2009-05-11 10:22:11,425 DEBUG [main][httpclient.wire.header] << "X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1[\r][\n]"
+2009-05-11 10:22:11,425 DEBUG [main][httpclient.wire.header] << "Content-Type: text/xml;charset=UTF-8[\r][\n]"
+2009-05-11 10:22:11,425 DEBUG [main][httpclient.wire.header] << "Transfer-Encoding: chunked[\r][\n]"
+2009-05-11 10:22:11,425 DEBUG [main][httpclient.wire.header] << "Date: Mon, 11 May 2009 08:22:11 GMT[\r][\n]"
+2009-05-11 10:22:11,428 DEBUG [main][httpclient.wire.content] << "8"
+2009-05-11 10:22:11,428 DEBUG [main][httpclient.wire.content] << "1"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\r]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\n]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body></env:Body></env:Envelope>"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\r]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\n]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "0"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\r]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\n]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\r]"
+2009-05-11 10:22:11,429 DEBUG [main][httpclient.wire.content] << "[\n]"
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/attribute.jsp
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/attribute.jsp 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/attribute.jsp 2009-05-13 08:11:46 UTC (rev 26493)
@@ -13,7 +13,7 @@
org.jboss.soa.esb.monitoring.server.TimeSeriesChartProducer,
org.jfree.data.time.Minute,
org.jfree.chart.JFreeChart,
- org.apache.taglibs.standard.tag.common.core.Util
+ org.jboss.soa.esb.util.XssUtil;
"%>
<%!
private static int imagecounter = 0;
@@ -46,7 +46,7 @@
<hr>
<%
Long id = new Long(request.getParameter("id"));
-String servername = Util.escapeXml(request.getParameter("servername"));
+String servername = request.getParameter("servername");
int maxrecords = 10;
try {
maxrecords = Integer.parseInt(request.getParameter("maxrecords"));
@@ -105,7 +105,7 @@
<%
} else {
%>
-<h1><code><%=Util.escapeXml(attribute)%></code></h1>
+<h1><code><%=XssUtil.escape(attribute)%></code></h1>
<%
}
%><br>
@@ -120,7 +120,7 @@
</select> and the
list the last <input type="text" name="maxrecords" value="<%= maxrecords %>"></input> records
<input type="hidden" name="id" value="<%=id%>">
- <input type="hidden" name="servername" value="<%=servername%>">
+ <input type="hidden" name="servername" value="<%=XssUtil.escape(servername)%>">
<input type="submit" value="submit">
</form>
<hr>
@@ -128,7 +128,7 @@
<table>
<tr>
<th>Collection Date</th>
-<th><%=Util.escapeXml(attribute) %></th>
+<th><%=XssUtil.escape(attribute) %></th>
</tr>
<%
NumberFormat nf = NumberFormat.getInstance();
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/index.jsp
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/index.jsp 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/index.jsp 2009-05-13 08:11:46 UTC (rev 26493)
@@ -7,7 +7,7 @@
org.jboss.soa.esb.monitoring.MonitoringSessionFactory,
org.jboss.soa.esb.monitoring.pojo.*,
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
- org.apache.taglibs.standard.tag.common.core.Util
+ org.jboss.soa.esb.util.XssUtil;
"%>
<html>
<head>
@@ -47,7 +47,7 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=Util.escapeXml(serverName)%></code></h1>
+ <h1><code><%=XssUtil.escape(serverName)%></code></h1>
<%
List objectNames = StatisticsHelper.getObjectNamesForServer(sess, serverName);
for (int j = 0; j < objectNames.size(); j++) {
@@ -59,7 +59,7 @@
List attributeNames = StatisticsHelper.getAttributes(sess, serverName, objectName);
for (int k = 0; k < attributeNames.size(); k++) {
JMXAttribute jmxattr = (JMXAttribute) attributeNames.get(k);
- String attributeName = Util.escapeXml(jmxattr.getAttribute());
+ String attributeName = XssUtil.escape(jmxattr.getAttribute());
%>
<li><a href="attribute.jsp?servername=<%=serverName%>&id=<%=jmxattr.getId()%>"><%=attributeName%></a></li>
<%
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/operations.jsp
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/operations.jsp 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/operations.jsp 2009-05-13 08:11:46 UTC (rev 26493)
@@ -8,7 +8,7 @@
org.jboss.soa.esb.monitoring.pojo.*,
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
org.jboss.soa.esb.monitoring.server.OperationsHelper,
- org.apache.taglibs.standard.tag.common.core.Util
+ org.jboss.soa.esb.util.XssUtil
"%>
<html>
<head>
@@ -49,13 +49,13 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=Util.escapeXml(serverName)%></code></h1>
+ <h1><code><%=XssUtil.escape(serverName)%></code></h1>
<%
List objectNames = OperationsHelper.getObjectNamesForServer(sess, serverName);
for (int j = 0; j < objectNames.size(); j++) {
String objectName= (String) objectNames.get(j);
%>
- <li><b><%=Util.escapeXml(objectName)%></b></li>
+ <li><b><%=XssUtil.escape(objectName)%></b></li>
<ul>
<%
List operations = OperationsHelper.getOperations(sess, serverName, objectName);
@@ -64,7 +64,7 @@
String operation = jmxoper.getReturntype() + " " + jmxoper.getOperation()
+ " (" + jmxoper.getDescription() + ")";
%>
- <li><a href="invoke.jsp?id=<%=jmxoper.getId()%>"><%=Util.escapeXml(operation)%></a></li>
+ <li><a href="invoke.jsp?id=<%=jmxoper.getId()%>"><%=XssUtil.escape(operation)%></a></li>
<%
}
%>
Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/results.jsp
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/results.jsp 2009-05-13 05:28:17 UTC (rev 26492)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/tools/console/management-web/src/main/webapp/results.jsp 2009-05-13 08:11:46 UTC (rev 26493)
@@ -8,7 +8,7 @@
org.jboss.soa.esb.monitoring.pojo.*,
org.jboss.soa.esb.monitoring.server.StatisticsHelper,
org.jboss.soa.esb.monitoring.server.OperationsHelper,
- org.apache.taglibs.standard.tag.common.core.Util
+ org.jboss.soa.esb.util.XssUtil
"%>
<html>
<head>
@@ -49,7 +49,7 @@
String serverName = (String) serverNames.get(i);
%>
<hr>
- <h1><code><%=Util.escapeXml(serverName)%></code></h1>
+ <h1><code><%=XssUtil.escape(serverName)%></code></h1>
<%
List results = OperationsHelper.getOperationResults(sess, serverName);
for (int j = 0; j < results.size(); j++) {
@@ -57,9 +57,9 @@
%>
<li><b><%=jmxor.getStatdate()%></b></li>
<ul>
- <li><b>Result:</b> <%=Util.escapeXml(jmxor.getResult())%>
- <li><b>Object name:</b> <%=Util.escapeXml(jmxor.getOperation().getObjectname()) %>
- <li><b>Operation:</b> <%=Util.escapeXml(jmxor.getOperation().getReturntype())%> <%=Util.escapeXml(jmxor.getOperation().getOperation()) %>
+ <li><b>Result:</b> <%=XssUtil.escape(jmxor.getResult())%>
+ <li><b>Object name:</b> <%=XssUtil.escape(jmxor.getOperation().getObjectname()) %>
+ <li><b>Operation:</b> <%=XssUtil.escape(jmxor.getOperation().getReturntype())%> <%=XssUtil.escape(jmxor.getOperation().getOperation()) %>
</ul>
<%
}
Added: labs/jbossesb/workspace/dbevenius/jbossas5/qa/junit/resources/server/ebws/META-INF/deployment.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/qa/junit/resources/server/ebws/META-INF/deployment.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/qa/junit/resources/server/ebws/META-INF/deployment.xml 2009-05-13 08:11:46 UTC (rev 26493)
@@ -0,0 +1,8 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws1</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws1_reply</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws2</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws2_reply</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws3</depends>
+ <depends>jboss.esb.qa.junit.destination:service=Queue,name=ebws3_reply</depends>
+</jbossesb-deployment>
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/testlib/jetty-6.1.15.jar (from rev 25886, labs/jbossesb/trunk/testlib/jetty-6.1.15.jar)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/dbevenius/jbossas5/testlib/jetty-util-6.1.15.jar (from rev 25886, labs/jbossesb/trunk/testlib/jetty-util-6.1.15.jar)
===================================================================
(Binary files differ)
More information about the jboss-svn-commits
mailing list