Author: andreasmyth Date: Wed Jan 31 05:47:46 2007 New Revision: 501842 URL: http://svn.apache.org/viewvc?view=rev&rev=501842 Log: Interceptors configured for application endpoint also to be used for RM endpoint.
Added: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java - copied unchanged from r501780, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyException.java - copied unchanged from r501780, incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyException.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml (with props) Removed: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistry.java incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyException.java Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?view=diff&rev=501842&r1=501841&r2=501842 ============================================================================== --- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original) +++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Wed Jan 31 05:47:46 2007 @@ -30,6 +30,7 @@ import org.apache.cxf.databinding.DataBinding; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.endpoint.EndpointException; +import org.apache.cxf.endpoint.EndpointImpl; import org.apache.cxf.jaxb.JAXBDataBinding; import org.apache.cxf.jaxws.support.JaxWsEndpointImpl; import org.apache.cxf.service.Service; @@ -230,8 +231,18 @@ // What we really should do here is on use the same interceptors on the outbound // path that would be used by the application endpoint without presuming any knowledge // of the applications endpoint's frontend. - endpoint = new JaxWsEndpointImpl(manager.getBus(), service, ei); - // endpoint = new JaxWsEndpointImpl(manager.getBus(), service, ei); + EndpointImpl e = new JaxWsEndpointImpl(manager.getBus(), service, ei); + + + // use same endpoint specific interceptor as for the application endpoint + e.setOutInterceptors(applicationEndpoint.getOutInterceptors()); + e.setOutFaultInterceptors(applicationEndpoint.getOutFaultInterceptors()); + e.setInInterceptors(applicationEndpoint.getInInterceptors()); + e.setInFaultInterceptors(applicationEndpoint.getInFaultInterceptors()); + + endpoint = e; + + } catch (EndpointException ex) { throw new RuntimeException(ex); } Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?view=diff&rev=501842&r1=501841&r2=501842 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Wed Jan 31 05:47:46 2007 @@ -69,6 +69,7 @@ private boolean doTestOnewayAnonymousAcksSequenceLength1 = testAll; private boolean doTestOnewayAnonymousAcksSupressed = testAll; private boolean doTestTwowayNonAnonymous = testAll; + private boolean doTestTwowayNonAnonymousEndpointSpecific = testAll; private boolean doTestTwowayNonAnonymousDeferred = testAll; private boolean doTestTwowayNonAnonymousMaximumSequenceLength2 = testAll; private boolean doTestOnewayMessageLoss = testAll; @@ -366,6 +367,56 @@ return; } setupGreeter("org/apache/cxf/systest/ws/rm/twoway.xml"); + + greeter.greetMe("one"); + greeter.greetMe("two"); + greeter.greetMe("three"); + + // CreateSequence and three greetMe messages + // TODO there should be partial responses to the decoupled responses! + + awaitMessages(4, 8); + + MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages()); + + + mf.verifyMessages(4, true); + String[] expectedActions = new String[] {RMConstants.getCreateSequenceAction(), + GREETME_ACTION, + GREETME_ACTION, + GREETME_ACTION}; + mf.verifyActions(expectedActions, true); + mf.verifyMessageNumbers(new String[] {null, "1", "2", "3"}, true); + mf.verifyLastMessage(new boolean[] {false, false, false, false}, true); + mf.verifyAcknowledgements(new boolean[] {false, false, true, true}, true); + + // createSequenceResponse plus 3 greetMeResponse messages plus + // one partial response for each of the four messages + // the first partial response should no include an acknowledgement, the other three should + + mf.verifyMessages(8, false); + mf.verifyPartialResponses(4, new boolean[4]); + + mf.purgePartialResponses(); + + expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(), + GREETME_RESPONSE_ACTION, + GREETME_RESPONSE_ACTION, + GREETME_RESPONSE_ACTION}; + mf.verifyActions(expectedActions, false); + mf.verifyMessageNumbers(new String[] {null, "1", "2", "3"}, false); + mf.verifyLastMessage(new boolean[4], false); + mf.verifyAcknowledgements(new boolean[] {false, true, true, true}, false); + } + + // the same as above but using endpoint specific interceptor configuration + + public void testTwowayNonAnonymousEndpointSpecific() throws Exception { + if (!doTestTwowayNonAnonymousEndpointSpecific) { + return; + } + setupGreeter("org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml"); + greeter.greetMe("one"); greeter.greetMe("two"); Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml?view=auto&rev=501842 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml (added) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml Wed Jan 31 05:47:46 2007 @@ -0,0 +1,106 @@ +<?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="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsrm-mgmt="http://cxf.apache.org/ws/rm/manager" + xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" + xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" + xsi:schemaLocation=" +http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + + <bean name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit" abstract="true"> + <property name="client"> + <value> + <http-conf:client DecoupledEndpoint="http://localhost:9991/decoupled_endpoint"/> + </value> + </property> + </bean> + + <!-- Endpoint Level Interceptors--> + <!-- Inserted From JaxWsEndpointImpl, EndpointImpl--> + <bean id="wrapperClassIn" class="org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor"/> + <bean id="wrapperClassOut" class="org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor"/> + <bean id="holderIn" class="org.apache.cxf.jaxws.interceptors.HolderInInterceptor"/> + <bean id="holderOut" class="org.apache.cxf.jaxws.interceptors.HolderOutInterceptor"/> + <bean id="clientFaultConv" class="org.apache.cxf.interceptor.ClientFaultConverter"/> + <bean id="messageSender" class="org.apache.cxf.interceptor.MessageSenderInterceptor"/> + <!-- Cannot use via config --> + <!-- + <bean id="soapHandler" class="org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor"/> + <bean id="logicalHandler" class="org.apache.cxf.jaxws.handler.LogicalHandlerInterceptor"/> + --> + + <!-- WSA Interceptors--> + <bean id="mapAggregator" class="org.apache.cxf.ws.addressing.MAPAggregator"/> + <bean id="mapCodec" class="org.apache.cxf.ws.addressing.soap.MAPCodec"/> + + <!-- WS-RM Interceptors--> + <bean id="rmLogicalOut" class="org.apache.cxf.ws.rm.RMOutInterceptor"> + <property name="bus" ref="cxf"/> + </bean> + <bean id="rmLogicalIn" class="org.apache.cxf.ws.rm.RMInInterceptor"> + <property name="bus" ref="cxf"/> + </bean> + <bean id="rmCodec" class="org.apache.cxf.ws.rm.soap.RMSoapInterceptor"/> + + <!-- Logging and Utility Interceptor--> + <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> + <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> + + <!--WS-A Interceptors not required in Fault Chain--> + <bean id="{http://cxf.apache.org/greeter_control}GreeterPort" abstract="true"> + <property name="inInterceptors"> + <list> + <ref bean="rmLogicalIn"/> + <ref bean="rmCodec"/> + <ref bean="mapAggregator"/> + <ref bean="mapCodec"/> + <ref bean="wrapperClassIn"/> + <ref bean="holderIn"/> + </list> + </property> + <property name="inFaultInterceptors"> + <list> + <ref bean="clientFaultConv"/> + </list> + </property> + <property name="outInterceptors"> + <list> + <ref bean="rmLogicalOut"/> + <ref bean="rmCodec"/> + <ref bean="mapAggregator"/> + <ref bean="mapCodec"/> + <ref bean="wrapperClassOut"/> + <ref bean="holderOut"/> + <ref bean="messageSender"/> + </list> + </property> + <property name="outFaultInterceptors"> + <list> + <ref bean="rmLogicalOut"/> + <ref bean="rmCodec"/> + <ref bean="mapAggregator"/> + <ref bean="mapCodec"/> + <ref bean="messageSender"/> + </list> + </property> + </bean> + +</beans> \ No newline at end of file Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/twoway-endpoint-specific.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml