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 2008/10/30 05:05:22 UTC
svn commit: r709084 - in
/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src:
main/java/org/apache/servicemix/cxfbc/
test/java/org/apache/servicemix/cxfbc/provider/
test/resources/org/apache/servicemix/cxfbc/pro...
Author: ffang
Date: Wed Oct 29 21:05:22 2008
New Revision: 709084
URL: http://svn.apache.org/viewvc?rev=709084&view=rev
Log:
[SM-1600]test to guarantee conduit is created for each cxf bc provider endpoint but not per request
Added:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java (with props)
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml (with props)
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=709084&r1=709083&r2=709084&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java Wed Oct 29 21:05:22 2008
@@ -152,6 +152,7 @@
Message message = ep.getBinding().createMessage();
message.put(MessageExchange.class, exchange);
Exchange cxfExchange = new ExchangeImpl();
+ cxfExchange.setConduit(conduit);
cxfExchange.setSynchronous(isSynchronous());
cxfExchange.put(MessageExchange.class, exchange);
Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java?rev=709084&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java Wed Oct 29 21:05:22 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.cxfbc.provider;
+
+import org.apache.cxf.binding.jbi.JBIFault;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.transport.Conduit;
+
+public class ConduitCompareInterceptor extends AbstractPhaseInterceptor {
+
+ private Conduit preConduit;
+ private boolean firstInvocation = true;
+
+ public ConduitCompareInterceptor() {
+ super(Phase.PRE_STREAM);
+ }
+
+ public void handleMessage(Message message) throws Fault {
+ if (firstInvocation) {
+ firstInvocation = false;
+ preConduit = message.getExchange().getConduit(message);
+ } else {
+ if (preConduit != message.getExchange().getConduit(message)) {
+ throw new JBIFault("not use the same conduit between different invocation");
+ }
+ preConduit = message.getExchange().getConduit(message);
+ }
+
+ }
+
+}
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/ConduitCompareInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java?rev=709084&r1=709083&r2=709084&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/provider/CxfBCSEProviderAsyncSystemTest.java Wed Oct 29 21:05:22 2008
@@ -110,6 +110,7 @@
}
public void setUpJBI(String beanFile) throws Exception {
+ success = true;
if (context != null) {
context.refresh();
}
@@ -181,6 +182,12 @@
greetMeProviderJmsTestBase();
assertTrue(success);
}
+
+ public void testSameConduit() throws Exception {
+ setUpJBI("org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml");
+ greetMeProviderJmsTestBase();
+ assertTrue(success);
+ }
private void greetMeProviderHttpTestBase() throws Exception {
ClientInvocationForHttp thread1 = new ClientInvocationForHttp("wait");
@@ -250,9 +257,7 @@
client.done(io);
if (io.getFault() != null) {
success = false;
- } else {
- success = true;
- }
+ }
} catch (Exception e) {
e.printStackTrace();
}
@@ -293,9 +298,7 @@
client.done(io);
if (io.getFault() != null) {
success = false;
- } else {
- success = true;
- }
+ }
} catch (Exception e) {
e.printStackTrace();
}
Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml?rev=709084&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml Wed Oct 29 21:05:22 2008
@@ -0,0 +1,58 @@
+<?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:endpoints>
+
+
+ <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.ConduitCompareInterceptor"/>
+ </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:provider>
+ </sm:endpoints>
+
+ </sm:container>
+
+</beans>
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean_provider_conduit.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml