[jboss-svn-commits] JBL Code SVN: r12006 - in labs/jbossesb/trunk/product: core/listeners/src/org/jboss/soa/esb/actions and 5 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon May 21 07:22:15 EDT 2007
Author: tfennelly
Date: 2007-05-21 07:22:15 -0400 (Mon, 21 May 2007)
New Revision: 12006
Added:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
Modified:
labs/jbossesb/trunk/product/build.xml
labs/jbossesb/trunk/product/services/build.xml
labs/jbossesb/trunk/product/services/soapui-client/build.xml
labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_02.xml
labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_03.xml
Log:
tests and fixes
Modified: labs/jbossesb/trunk/product/build.xml
===================================================================
--- labs/jbossesb/trunk/product/build.xml 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/build.xml 2007-05-21 11:22:15 UTC (rev 12006)
@@ -361,7 +361,8 @@
<echo message="Cleaning core"/>
<ant dir="core" target="clean"/>
<ant dir="${console.dir}" target="clean"/>
-
+ <ant dir="services" target="clean"/>
+
<delete dir="${org.jboss.esb.internal.dest}"/>
<delete dir="${org.jboss.esb.internal.dest.root}"/>
<delete dir="${org.jboss.esb.internal.javadocs.dest}"/>
Added: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java (rev 0)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java 2007-05-21 11:22:15 UTC (rev 12006)
@@ -0,0 +1,50 @@
+package org.jboss.soa.esb.actions.templating;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.antlr.stringtemplate.StringTemplate;
+import org.antlr.stringtemplate.StringTemplateGroup;
+
+import java.util.Map;
+
+/**
+ * <a href="http://www.stringtemplate.org">StringTemplate</a> Processor.
+ * <p/>
+ * Code supplied by the <a href="http://milyn.codehaus.org/Smooks">Milyn Smooks</a> project.
+ *
+ * @author
+ */
+public class StringTemplateProcessor extends AbstractActionPipelineProcessor {
+
+ private StringTemplate template;
+
+ public StringTemplateProcessor(ConfigTree config) {
+ String path = config.getAttribute("template");
+ String encoding = config.getAttribute("encoding", "UTF-8");
+
+ if(path.charAt(0) == '/') {
+ path = path.substring(1);
+ }
+ if(path.endsWith(".st")) {
+ path = path.substring(0, path.length() - 3);
+ }
+
+ StringTemplateGroup templateGroup = new StringTemplateGroup(path);
+ templateGroup.setFileCharEncoding(encoding);
+ template = templateGroup.getInstanceOf(path);
+ }
+
+ public Message process(final Message message) throws ActionProcessingException {
+ // First thing we do is clone the template for this message...
+ StringTemplate thisTransTemplate = template.getInstanceOf();
+ Map beans = (Map) message.getBody().get();
+
+ // Set the document data beans on the template and apply it...
+ thisTransTemplate.setAttributes(beans);
+ message.getBody().add(thisTransTemplate.toString());
+
+ return message;
+ }
+}
Property changes on: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/trunk/product/services/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/build.xml 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/services/build.xml 2007-05-21 11:22:15 UTC (rev 12006)
@@ -5,8 +5,15 @@
<target name="esb">
<ant dir="jbpm" target="dist"/>
<ant dir="jbossesb" target="dist"/>
+ <ant dir="soapui-client" target="sar"/>
</target>
-
+
+ <target name="clean">
+ <ant dir="jbpm" target="clean"/>
+ <ant dir="jbossesb" target="clean"/>
+ <ant dir="soapui-client" target="clean"/>
+ </target>
+
<target name="test">
<ant dir="jbpm" target="test"/>
<ant dir="jbossesb" target="test"/>
Modified: labs/jbossesb/trunk/product/services/soapui-client/build.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/build.xml 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/services/soapui-client/build.xml 2007-05-21 11:22:15 UTC (rev 12006)
@@ -3,30 +3,19 @@
-->
<project name="soapui-client" default="sar" basedir=".">
- <property file="${user.home}/.m2/maven.properties"/>
<property name="maven.build.output" value="target/classes"/>
<property name="maven.build.directory" value="target"/>
<property name="maven.build.final.name" value="soapui-client"/>
<property name="maven.test.reports" value="${maven.build.directory}/test-reports"/>
<property name="maven.test.output" value="target/test-classes"/>
- <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
<path id="build.classpath">
- <!-- fileset dir="${maven.repo.local}">
- <include name="eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar"/>
- <include name="commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"/>
- <include name="xmlbeans/xbean/2.2.0/xbean-2.2.0.jar"/>
- <include name="commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
- <include name="eviware/soapui/1.7/soapui-1.7.jar"/>
- <include name="com/jgoodies/looks/2.1.2/looks-2.1.2.jar"/>
- <include name="commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"/>
- </fileset -->
<fileset dir="src/lib" includes="*.jar" />
- <fileset dir="../../../../lib/ext" includes="*.jar" />
+ <fileset dir="../../lib/ext" includes="*.jar" />
</path>
<target name="clean" description="Clean the output directory">
<delete dir="${maven.build.directory}"/>
</target>
- <target name="compile" depends="get-deps" description="Compile the code">
+ <target name="compile" description="Compile the code">
<mkdir dir="${maven.build.output}"/>
<javac destdir="${maven.build.output}" excludes="**/package.html" debug="true" deprecation="true"
optimize="false">
@@ -61,6 +50,7 @@
</copy>
<jar jarfile="${maven.build.directory}/${maven.build.final.name}.sar" basedir="${maven.build.directory}/sar" />
+ <copy file="${maven.build.directory}/${maven.build.final.name}.sar" todir="../../build/services" />
</target>
<target name="compile-tests" depends="junit-present, compile" description="Compile the test code"
if="junit.present">
@@ -111,71 +101,4 @@
<echo>Junit isn't present in your $ANT_HOME/lib directory. Tests not executed.</echo>
<echo>==========================================================================</echo>
</target>
- <target name="test-offline">
- <condition property="maven.mode.offline">
- <equals arg1="${build.sysclasspath}" arg2="only"/>
- </condition>
- </target>
- <target name="get-deps" depends="test-offline" description="Download all dependencies" unless="maven.mode.offline">
- <mkdir dir="${maven.repo.local}"/>
- <!--
- <get src="http://repository.jboss.com/maven2//eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui-xmlbeans/1.7/soapui-xmlbeans-1.7.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- dest="${maven.repo.local}/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- usetimestamp="true" ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- dest="${maven.repo.local}/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- dest="${maven.repo.local}/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"
- usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//xmlbeans/xbean/2.2.0/xbean-2.2.0.jar"
- dest="${maven.repo.local}/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//xmlbeans/xbean/2.2.0/xbean-2.2.0.jar"
- dest="${maven.repo.local}/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar"
- dest="${maven.repo.local}/xmlbeans/xbean/2.2.0/xbean-2.2.0.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//commons-codec/commons-codec/1.2/commons-codec-1.2.jar"
- dest="${maven.repo.local}/commons-codec/commons-codec/1.2/commons-codec-1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//commons-codec/commons-codec/1.2/commons-codec-1.2.jar"
- dest="${maven.repo.local}/commons-codec/commons-codec/1.2/commons-codec-1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"
- dest="${maven.repo.local}/commons-codec/commons-codec/1.2/commons-codec-1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//eviware/soapui/1.7/soapui-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui/1.7/soapui-1.7.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//eviware/soapui/1.7/soapui-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui/1.7/soapui-1.7.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/eviware/soapui/1.7/soapui-1.7.jar"
- dest="${maven.repo.local}/eviware/soapui/1.7/soapui-1.7.jar" usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//com/jgoodies/looks/2.1.2/looks-2.1.2.jar"
- dest="${maven.repo.local}/com/jgoodies/looks/2.1.2/looks-2.1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//com/jgoodies/looks/2.1.2/looks-2.1.2.jar"
- dest="${maven.repo.local}/com/jgoodies/looks/2.1.2/looks-2.1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/com/jgoodies/looks/2.1.2/looks-2.1.2.jar"
- dest="${maven.repo.local}/com/jgoodies/looks/2.1.2/looks-2.1.2.jar" usetimestamp="true"
- ignoreerrors="true"/>
- <get src="http://repository.jboss.com/maven2//commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- dest="${maven.repo.local}/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- usetimestamp="true" ignoreerrors="true"/>
- <get src="http://www.eviware.com/repository/maven2//commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- dest="${maven.repo.local}/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- usetimestamp="true" ignoreerrors="true"/>
- <get src="http://repo1.maven.org/maven2/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- dest="${maven.repo.local}/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"
- usetimestamp="true" ignoreerrors="true"/>
- -->
- </target>
</project>
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java 2007-05-21 11:22:15 UTC (rev 12006)
@@ -36,6 +36,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerFactory;
import ognl.OgnlException;
import ognl.Ognl;
@@ -49,7 +50,7 @@
private static final String SOAPUICL_NS = "http://jbossesb.jboss.org/soapui-client";
private static final String SOAPUICL_NS_PREFIX = "soapui:";
- private static final String IS_CLONE_ATTRIB = "is-cloneCollectionTemplateElement";
+ private static final String IS_CLONE_ATTRIB = "is-clone";
private static final String OGNL_ATTRIB = "ognl";
private static Logger logger = Logger.getLogger(SoapUIClientService.class);
private Map<String, WsdlInterface[]> wsdls = new HashMap<String, WsdlInterface[]>();
@@ -163,7 +164,7 @@
*/
private void expandMessage(Element element, Map params) {
- // If this element is not a cloneCollectionTemplateElement, check does it need to be cloned...
+ // If this element is not a cloned element, check does it need to be cloned...
if(!element.hasAttributeNS(SOAPUICL_NS, IS_CLONE_ATTRIB)) {
String ognl = getOGNLExpression(element);
Object param;
Modified: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_02.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_02.xml 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_02.xml 2007-05-21 11:22:15 UTC (rev 12006)
@@ -3,48 +3,48 @@
<soapenv:Body>
<cus:customerOrder>
<cus:header>
- <cus:customerNumber></cus:customerNumber>
- <cus:poNumber></cus:poNumber>
- <cus:orderDate></cus:orderDate>
- <cus:orderTotal></cus:orderTotal>
+ <cus:customerNumber/>
+ <cus:poNumber/>
+ <cus:orderDate/>
+ <cus:orderTotal/>
<cus:billTo>
- <stan:company></stan:company>
+ <stan:company/>
<stan:contact>
- <stan:name></stan:name>
- <stan:phone></stan:phone>
- <stan:fax></stan:fax>
- <stan:email></stan:email>
+ <stan:name/>
+ <stan:phone/>
+ <stan:fax/>
+ <stan:email/>
</stan:contact>
<stan:address>
- <stan:street1></stan:street1>
+ <stan:street1/>
<!--Optional:-->
- <stan:street2></stan:street2>
- <stan:city></stan:city>
- <stan:state></stan:state>
- <stan:zip></stan:zip>
+ <stan:street2/>
+ <stan:city/>
+ <stan:state/>
+ <stan:zip/>
</stan:address>
</cus:billTo>
<cus:shipTo>
- <stan:company></stan:company>
+ <stan:company/>
<stan:contact>
- <stan:name></stan:name>
- <stan:phone></stan:phone>
- <stan:fax></stan:fax>
- <stan:email></stan:email>
+ <stan:name/>
+ <stan:phone/>
+ <stan:fax/>
+ <stan:email/>
</stan:contact>
<stan:address>
- <stan:street1></stan:street1>
+ <stan:street1/>
<!--Optional:-->
- <stan:street2></stan:street2>
- <stan:city></stan:city>
- <stan:state></stan:state>
- <stan:zip></stan:zip>
+ <stan:street2/>
+ <stan:city/>
+ <stan:state/>
+ <stan:zip/>
</stan:address>
</cus:shipTo>
<!--Optional:-->
- <cus:billTerms></cus:billTerms>
+ <cus:billTerms/>
<!--Optional:-->
- <cus:shipTerms></cus:shipTerms>
+ <cus:shipTerms/>
</cus:header>
<cus:items>
<!--1 or more repetitions:-->
Modified: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_03.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_03.xml 2007-05-21 08:49:11 UTC (rev 12005)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/expected_03.xml 2007-05-21 11:22:15 UTC (rev 12006)
@@ -2,50 +2,50 @@
<soapenv:Header/>
<soapenv:Body>
<cus:customerOrder>
- <cus:header>
- <cus:customerNumber></cus:customerNumber>
- <cus:poNumber></cus:poNumber>
- <cus:orderDate></cus:orderDate>
- <cus:orderTotal></cus:orderTotal>
- <cus:billTo>
- <stan:company></stan:company>
- <stan:contact>
- <stan:name></stan:name>
- <stan:phone></stan:phone>
- <stan:fax></stan:fax>
- <stan:email></stan:email>
- </stan:contact>
- <stan:address>
- <stan:street1></stan:street1>
- <!--Optional:-->
- <stan:street2></stan:street2>
- <stan:city></stan:city>
- <stan:state></stan:state>
- <stan:zip></stan:zip>
- </stan:address>
- </cus:billTo>
- <cus:shipTo>
- <stan:company></stan:company>
- <stan:contact>
- <stan:name></stan:name>
- <stan:phone></stan:phone>
- <stan:fax></stan:fax>
- <stan:email></stan:email>
- </stan:contact>
- <stan:address>
- <stan:street1></stan:street1>
- <!--Optional:-->
- <stan:street2></stan:street2>
- <stan:city></stan:city>
- <stan:state></stan:state>
- <stan:zip></stan:zip>
- </stan:address>
- </cus:shipTo>
- <!--Optional:-->
- <cus:billTerms></cus:billTerms>
- <!--Optional:-->
- <cus:shipTerms></cus:shipTerms>
- </cus:header>
+ <cus:header>
+ <cus:customerNumber/>
+ <cus:poNumber/>
+ <cus:orderDate/>
+ <cus:orderTotal/>
+ <cus:billTo>
+ <stan:company/>
+ <stan:contact>
+ <stan:name/>
+ <stan:phone/>
+ <stan:fax/>
+ <stan:email/>
+ </stan:contact>
+ <stan:address>
+ <stan:street1/>
+ <!--Optional:-->
+ <stan:street2/>
+ <stan:city/>
+ <stan:state/>
+ <stan:zip/>
+ </stan:address>
+ </cus:billTo>
+ <cus:shipTo>
+ <stan:company/>
+ <stan:contact>
+ <stan:name/>
+ <stan:phone/>
+ <stan:fax/>
+ <stan:email/>
+ </stan:contact>
+ <stan:address>
+ <stan:street1/>
+ <!--Optional:-->
+ <stan:street2/>
+ <stan:city/>
+ <stan:state/>
+ <stan:zip/>
+ </stan:address>
+ </cus:shipTo>
+ <!--Optional:-->
+ <cus:billTerms/>
+ <!--Optional:-->
+ <cus:shipTerms/>
+ </cus:header>
<cus:items>
<!--1 or more repetitions:-->
<cus:item>
More information about the jboss-svn-commits
mailing list