You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/02/07 09:09:01 UTC
svn commit: r741854 - in
/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test:
java/org/apache/servicemix/cxfbc/provider/
resources/org/apache/servicemix/cxfbc/provider/
resources/org/apache/servicemix/cxfbc/ws/security/
Author: ffang
Date: Sat Feb 7 08:09:00 2009
New Revision: 741854
URL: http://svn.apache.org/viewvc?rev=741854&view=rev
Log:
[SM-1793]test to ensure the different JMSConduit instance share share replyDest work correctly for cxf bc provider
Added:
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml (with props)
Modified:
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java
servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl
Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java?rev=741854&r1=741853&r2=741854&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java (original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java Sat Feb 7 08:09:00 2009
@@ -186,7 +186,22 @@
assertTrue(success);
}
+ public void testGreetMeProviderWithJmsTransportSpecifyReplyDest() throws Exception {
+ setUpJBI("org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml");
+ greetMeProviderJmsSpecifyReplyDest();
+ assertTrue(success);
+ }
+ private void greetMeProviderJmsSpecifyReplyDest() throws Exception {
+ ClientInvocationForJmsWithTwoProviderEndpoint thread1 = new ClientInvocationForJmsWithTwoProviderEndpoint("wait");
+ thread1.start();
+ Thread.sleep(1000);
+ ClientInvocationForJmsWithTwoProviderEndpoint thread2 = new ClientInvocationForJmsWithTwoProviderEndpoint("fang");
+ thread2.start();
+ thread1.join();
+ thread2.join();
+
+ }
private void greetMeProviderHttpTestBase() throws Exception {
ClientInvocationForHttp thread1 = new ClientInvocationForHttp("wait");
@@ -293,5 +308,71 @@
}
+
+ class ClientInvocationForJmsWithTwoProviderEndpoint extends Thread {
+ private String greeting;
+
+ public ClientInvocationForJmsWithTwoProviderEndpoint(String greeting) {
+ this.greeting = greeting;
+ }
+
+ public void run() {
+ //two cxf bc provider means two JMSConduit used, but these two conduit share same replyDest
+ //this can prove the conduit based Selector from Cxf works
+ DefaultServiceMixClient client;
+ try {
+ client = new DefaultServiceMixClient(jbi);
+ InOut io = client.createInOutExchange();
+ io.setService(new QName(
+ "http://apache.org/hello_world_soap_http",
+ "HelloWorldService"));
+ io.setInterfaceName(new QName(
+ "http://apache.org/hello_world_soap_http", "Greeter"));
+ io.setOperation(new QName(
+ "http://apache.org/hello_world_soap_http", "greetMe"));
+ // send message to proxy
+ io.getInMessage()
+ .setContent(
+ new StringSource(
+ "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
+ + greeting
+ + "</requestType></greetMe>"));
+
+ client.send(io);
+ client.receive(100000);
+ client.done(io);
+ if (io.getFault() != null) {
+ success = false;
+ }
+ client = new DefaultServiceMixClient(jbi);
+ io = client.createInOutExchange();
+ io.setService(new QName(
+ "http://apache.org/hello_world_soap_http",
+ "HelloWorldService1"));
+ io.setInterfaceName(new QName(
+ "http://apache.org/hello_world_soap_http", "Greeter"));
+ io.setOperation(new QName(
+ "http://apache.org/hello_world_soap_http", "greetMe"));
+ // send message to proxy
+ io.getInMessage()
+ .setContent(
+ new StringSource(
+ "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
+ + greeting
+ + "</requestType></greetMe>"));
+
+ client.send(io);
+ client.receive(100000);
+ client.done(io);
+ if (io.getFault() != null) {
+ success = false;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ }
}
Added: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml?rev=741854&view=auto
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml (added)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml Sat Feb 7 08:09:00 2009
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ -->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+ xmlns:test="urn:test"
+ xmlns:greeter="http://apache.org/hello_world_soap_http_provider"
+ xmlns:jmsgreeter="http://apache.org/hello_world_soap_http">
+
+
+
+ <sm:container id="jbi" embedded="true">
+ <sm:executorFactory>
+ <bean class="org.apache.servicemix.executors.impl.ExecutorFactoryImpl">
+ <property name="configs">
+ <map>
+ <entry key="flow.seda.servicemix-cxfbc">
+ <bean class="org.apache.servicemix.executors.impl.ExecutorConfig">
+ <property name="corePoolSize" value="1"/>
+ <property name="maximumPoolSize" value="1"/>
+ <property name="queueSize" value="-1"/>
+ </bean>
+ </entry>
+ </map>
+ </property>
+ </bean>
+ </sm:executorFactory>
+
+ <sm:endpoints>
+ <cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
+ service="jmsgreeter:HelloWorldService1"
+ endpoint="HelloWorldPortProxy1"
+ interfaceName="jmsgreeter:Greetr"
+ useJBIWrapper="false"
+ synchronous="false"
+ >
+ <cxfbc:inInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ </cxfbc:inInterceptors>
+ <cxfbc:outInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ <bean class="org.apache.servicemix.cxfbc.provider.TimeCompareInterceptor"/>
+ </cxfbc:outInterceptors>
+ <cxfbc:inFaultInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ </cxfbc:inFaultInterceptors>
+ <cxfbc:outFaultInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ </cxfbc:outFaultInterceptors>
+ <cxfbc:features>
+ <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
+ <property name="jmsConfig">
+ <bean class="org.apache.cxf.transport.jms.JMSConfiguration">
+ <property name="connectionFactory">
+ <ref bean="myConnectionFactory" />
+ </property>
+ <property name="targetDestination">
+ <value>test.jmstransport.text.provider</value>
+ </property>
+ <property name="replyDestination">
+ <value>test.jmstransport.text.reply</value>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </cxfbc:features>
+ </cxfbc:provider>
+
+ <cxfbc:provider wsdl="org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl"
+ service="jmsgreeter:HelloWorldService"
+ endpoint="HelloWorldPortProxy"
+ interfaceName="jmsgreeter:Greetr"
+ useJBIWrapper="false"
+ synchronous="false"
+ >
+ <cxfbc:inInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ </cxfbc:inInterceptors>
+ <cxfbc:outInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ <bean class="org.apache.servicemix.cxfbc.provider.TimeCompareInterceptor"/>
+ </cxfbc:outInterceptors>
+ <cxfbc:inFaultInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ </cxfbc:inFaultInterceptors>
+ <cxfbc:outFaultInterceptors>
+ <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ </cxfbc:outFaultInterceptors>
+ <cxfbc:features>
+ <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
+ <property name="jmsConfig">
+ <bean class="org.apache.cxf.transport.jms.JMSConfiguration">
+ <property name="connectionFactory">
+ <ref bean="myConnectionFactory" />
+ </property>
+ <property name="targetDestination">
+ <value>test.jmstransport.text.provider</value>
+ </property>
+ <property name="replyDestination">
+ <value>test.jmstransport.text.reply</value>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </cxfbc:features>
+ </cxfbc:provider>
+ </sm:endpoints>
+
+ </sm:container>
+ <bean id="myConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory102">
+ <property name="targetConnectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616" />
+ </bean>
+ </property>
+ </bean>
+
+</beans>
Propchange: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_with_reply_dest.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl?rev=741854&r1=741853&r2=741854&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl (original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/hello_world.wsdl Sat Feb 7 08:09:00 2009
@@ -57,9 +57,21 @@
<jms:server durableSubscriberName="CXF_subscriber"/>
</port>
+
</service>
-
+ <service name="HelloWorldService1">
+
+ <port binding="tns:Greeter_SOAPBinding" name="HelloWorldPortProxy1">
+ <jms:address
+ jndiConnectionFactoryName="ConnectionFactory" jndiDestinationName="dynamicQueues/test.jmstransport.text.provider"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+ <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61616"/>
+ </jms:address>
+
+ <jms:server durableSubscriberName="CXF_subscriber"/>
+ </port>
+
+ </service>
</wsdl:definitions>