You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/06/13 21:54:12 UTC
svn commit: r413969 - in
/incubator/servicemix/trunk/servicemix-itests/src/test:
java/org/apache/servicemix/itests/EIPAndXsltTest.java
resources/org/apache/servicemix/itests/eipxslt.xml
resources/org/apache/servicemix/itests/transform.xslt
Author: gnodet
Date: Tue Jun 13 12:54:11 2006
New Revision: 413969
URL: http://svn.apache.org/viewvc?rev=413969&view=rev
Log:
Add test for saaj + xslt component
Added:
incubator/servicemix/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/EIPAndXsltTest.java
incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/eipxslt.xml
incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/transform.xslt
Added: incubator/servicemix/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/EIPAndXsltTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/EIPAndXsltTest.java?rev=413969&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/EIPAndXsltTest.java (added)
+++ incubator/servicemix/trunk/servicemix-itests/src/test/java/org/apache/servicemix/itests/EIPAndXsltTest.java Tue Jun 13 12:54:11 2006
@@ -0,0 +1,31 @@
+package org.apache.servicemix.itests;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.client.ServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class EIPAndXsltTest extends SpringTestSupport {
+
+ @Override
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("org/apache/servicemix/itests/eipxslt.xml");
+ }
+
+ public void test() throws Exception {
+ ServiceMixClient client = new DefaultServiceMixClient(jbi);
+ InOut me = client.createInOutExchange();
+ me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
+ me.setService(new QName("http://servicemix.org/test/", "routingSlip"));
+ client.sendSync(me, 5000);
+ assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
+ client.done(me);
+ }
+
+}
Added: incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/eipxslt.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/eipxslt.xml?rev=413969&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/eipxslt.xml (added)
+++ incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/eipxslt.xml Tue Jun 13 12:54:11 2006
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:eip="http://servicemix.apache.org/eip/1.0"
+ xmlns:http="http://servicemix.apache.org/http/1.0"
+ xmlns:test="http://servicemix.org/test/">
+
+ <sm:container id="jbi" embedded="true">
+ <sm:activationSpecs>
+
+ <sm:activationSpec id="eip-routing-slip">
+ <sm:component>
+ <eip:component>
+ <eip:endpoints>
+ <eip:static-routing-slip
+ service="test:routingSlip"
+ endpoint="endpoint">
+ <eip:targets>
+ <eip:exchange-target
+ service="test:addIt2" />
+ <eip:exchange-target
+ service="test:transformer" />
+ <eip:exchange-target
+ service="test:divideIt" />
+ <eip:exchange-target
+ service="test:echo" />
+ </eip:targets>
+ </eip:static-routing-slip>
+ </eip:endpoints>
+ </eip:component>
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec id="echo" service="test:echo"
+ endpoint="endpoint">
+ <sm:component>
+ <bean
+ class="org.apache.servicemix.components.util.EchoComponent" />
+ </sm:component>
+ </sm:activationSpec>
+
+ <!-- This just invokes another service -->
+ <sm:activationSpec componentName="divideIt"
+ service="test:divideIt" endpoint="divideIt">
+ <sm:component>
+ <bean
+ class="org.apache.servicemix.components.saaj.SaajBinding">
+ <property name="soapEndpoint">
+ <bean
+ class="javax.xml.messaging.URLEndpoint">
+ <constructor-arg
+ value="http://localhost:8192/test" />
+ </bean>
+ </property>
+ </bean>
+ </sm:component>
+ </sm:activationSpec>
+
+
+ <sm:activationSpec componentName="addIt2"
+ service="test:addIt2" endpoint="addIt2">
+ <sm:component>
+ <bean
+ class="org.apache.servicemix.components.saaj.SaajBinding">
+ <property name="soapEndpoint">
+ <bean
+ class="javax.xml.messaging.URLEndpoint">
+ <constructor-arg
+ value="http://localhost:8192/test" />
+ </bean>
+ </property>
+ </bean>
+ </sm:component>
+ </sm:activationSpec>
+
+
+ <sm:activationSpec componentName="transformer"
+ service="test:transformer">
+ <sm:component>
+ <bean
+ class="org.apache.servicemix.components.xslt.XsltComponent">
+ <property name="xsltResource"
+ value="classpath:org/apache/servicemix/itests/transform.xslt" />
+ </bean>
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec>
+ <sm:component>
+ <http:component>
+ <http:endpoints>
+ <http:endpoint service="test:Hello"
+ endpoint="testService" role="consumer"
+ targetService="test:echo"
+ defaultOperation="echo"
+ locationURI="http://localhost:8192/test"
+ defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
+ soap="true" />
+ </http:endpoints>
+ </http:component>
+ </sm:component>
+ </sm:activationSpec>
+
+ </sm:activationSpecs>
+ </sm:container>
+</beans>
Added: incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/transform.xslt
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/transform.xslt?rev=413969&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/transform.xslt (added)
+++ incubator/servicemix/trunk/servicemix-itests/src/test/resources/org/apache/servicemix/itests/transform.xslt Tue Jun 13 12:54:11 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:jbi="xalan://org.servicemix.components.xslt.XalanExtension"
+ extension-element-prefixes="jbi"
+ xmlns:my="http://servicemix.org/demo/" version="1.0">
+ <xsl:template match="/">
+ <ser:simpleMethod xmlns:ser="http://server.simpleexample/">
+ <arg0>20</arg0>
+ <arg1>2</arg1>
+ </ser:simpleMethod>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file