cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r533191 [2/2] - in /incubator/cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/...
Date Fri, 27 Apr 2007 18:56:32 GMT
Added: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java?view=auto&rev=533191
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
(added)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
Fri Apr 27 11:56:29 2007
@@ -0,0 +1,181 @@
+/**
+ * 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.cxf.ws.rm.soap;
+
+import java.math.BigInteger;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapBinding;
+import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.ws.rm.Identifier;
+import org.apache.cxf.ws.rm.RMConstants;
+import org.apache.cxf.ws.rm.SequenceAcknowledgement;
+import org.apache.cxf.ws.rm.SequenceFault;
+import org.apache.cxf.ws.rm.SequenceFaultType;
+import org.easymock.classextension.EasyMock;
+import org.easymock.classextension.IMocksControl;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class SoapFaultFactoryTest extends Assert {
+
+    private IMocksControl control;
+    private SequenceFault sf;
+    
+    @Before
+    public void setUp() {
+        control = EasyMock.createNiceControl(); 
+    }
+    
+    SequenceFault setupSequenceFault(boolean isSender, QName code, Object detail) {
+        sf = control.createMock(SequenceFault.class);
+        EasyMock.expect(sf.getReason()).andReturn("reason");
+        EasyMock.expect(sf.isSender()).andReturn(isSender);
+        EasyMock.expect(sf.getSubCode()).andReturn(code);
+        if (null != detail) {
+            EasyMock.expect(sf.getDetail()).andReturn(detail);
+            SequenceFaultType sft = new SequenceFaultType();
+            sft.setFaultCode(RMConstants.getUnknownSequenceFaultCode());
+        }
+        return sf;
+    }
+    
+    @Test 
+    public void createSoap11Fault() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap11.getInstance());        
+        setupSequenceFault(false, RMConstants.getSequenceTerminatedFaultCode(), null);
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        SoapFault fault = (SoapFault)factory.createFault(sf);
+        assertEquals("reason", fault.getReason());
+        assertEquals(Soap11.getInstance().getReceiver(), fault.getFaultCode());
+        assertEquals(RMConstants.getSequenceTerminatedFaultCode(), fault.getSubCode());
+        assertNull(fault.getDetail());
+        assertSame(sf, fault.getCause());
+        control.verify();        
+    }
+    
+    @Test 
+    public void createSoap12Fault() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());        
+        Identifier id = new Identifier();
+        id.setValue("sid");
+        setupSequenceFault(true, RMConstants.getUnknownSequenceFaultCode(), id);        
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        SoapFault fault = (SoapFault)factory.createFault(sf);
+        assertEquals("reason", fault.getReason());
+        assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
+        assertEquals(RMConstants.getUnknownSequenceFaultCode(), fault.getSubCode());
+        Element elem = fault.getDetail();
+        assertEquals(RMConstants.getNamespace(), elem.getNamespaceURI());
+        assertEquals("Identifier", elem.getLocalName());
+        assertNull(fault.getCause());
+        control.verify();        
+    }
+    
+    @Test 
+    public void createSoap12FaultWithIdentifierDetail() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());        
+        Identifier id = new Identifier();
+        id.setValue("sid");
+        setupSequenceFault(true, RMConstants.getUnknownSequenceFaultCode(), id);        
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        SoapFault fault = (SoapFault)factory.createFault(sf);
+        assertEquals("reason", fault.getReason());
+        assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
+        assertEquals(RMConstants.getUnknownSequenceFaultCode(), fault.getSubCode());
+        Element elem = fault.getDetail();
+        assertEquals(RMConstants.getNamespace(), elem.getNamespaceURI());
+        assertEquals("Identifier", elem.getLocalName());
+        control.verify();        
+    }
+    
+    @Test 
+    public void createSoap12FaultWithAcknowledgementDetail() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());        
+        SequenceAcknowledgement ack = new SequenceAcknowledgement();
+        Identifier id = new Identifier();
+        id.setValue("sid");
+        ack.setIdentifier(id);
+        SequenceAcknowledgement.AcknowledgementRange range = 
+            new SequenceAcknowledgement.AcknowledgementRange();
+        range.setLower(BigInteger.ONE);
+        range.setUpper(BigInteger.TEN);
+        ack.getAcknowledgementRange().add(range);   
+        setupSequenceFault(true, RMConstants.getInvalidAcknowledgmentFaultCode(), ack); 
      
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        SoapFault fault = (SoapFault)factory.createFault(sf);
+        assertEquals("reason", fault.getReason());
+        assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
+        assertEquals(RMConstants.getInvalidAcknowledgmentFaultCode(), fault.getSubCode());
+        Element elem = fault.getDetail();
+        assertEquals(RMConstants.getNamespace(), elem.getNamespaceURI());
+        assertEquals("SequenceAcknowledgement", elem.getLocalName());
+        control.verify();        
+    }
+    
+    @Test 
+    public void createSoap12FaultWithoutDetail() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());
+        setupSequenceFault(true, RMConstants.getCreateSequenceRefusedFaultCode(), null);
       
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        SoapFault fault = (SoapFault)factory.createFault(sf);
+        assertEquals("reason", fault.getReason());
+        assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
+        assertEquals(RMConstants.getCreateSequenceRefusedFaultCode(), fault.getSubCode());
+        assertNull(fault.getDetail());
+
+        control.verify();        
+    }
+    
+    @Test
+    public void testToString() {
+        SoapBinding sb = control.createMock(SoapBinding.class);
+        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap11.getInstance());
+        SoapFault fault = control.createMock(SoapFault.class);
+        EasyMock.expect(fault.getReason()).andReturn("r");
+        EasyMock.expect(fault.getFaultCode()).andReturn(new QName("ns", "code"));
+        EasyMock.expect(fault.getSubCode()).andReturn(new QName("ns", "subcode"));
+        control.replay();
+        SoapFaultFactory factory = new SoapFaultFactory(sb);
+        assertEquals("Reason: r, code: {ns}code, subCode: {ns}subcode",
+                     factory.toString(fault));
+        control.verify();
+        
+    }
+}

Propchange: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java?view=diff&rev=533191&r1=533190&r2=533191
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
Fri Apr 27 11:56:29 2007
@@ -27,6 +27,7 @@
 
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.greeter_control.AbstractGreeterImpl;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
@@ -73,6 +74,10 @@
         
         Endpoint.publish(address, implementor);
         LOG.info("Published greeter endpoint.");
+        
+        if (implementor instanceof AbstractGreeterImpl) {
+            ((AbstractGreeterImpl)implementor).setGreeting(null);
+        }
         
         return true;        
     }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java?view=diff&rev=533191&r1=533190&r2=533191
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/MessageLossSimulator.java
Fri Apr 27 11:56:29 2007
@@ -59,7 +59,7 @@
         if (maps != null && null != maps.getAction()) {
             action = maps.getAction().getValue();
         }
-        if (!RMContextUtils.isAplicationMessage(action)) {
+        if (RMContextUtils.isRMProtocolMessage(action)) {
             return;
         }
         appMessageCount++;

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=533191&r1=533190&r2=533191
==============================================================================
--- 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
Fri Apr 27 11:56:29 2007
@@ -26,8 +26,12 @@
 import java.util.concurrent.Executors;
 import java.util.logging.Logger;
 
+import javax.xml.ws.WebServiceException;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.frontend.ClientProxy;
@@ -36,6 +40,9 @@
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.GreeterService;
 import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
 import org.apache.cxf.systest.ws.util.InMessageRecorder;
 import org.apache.cxf.systest.ws.util.MessageFlow;
 import org.apache.cxf.systest.ws.util.MessageRecorder;
@@ -44,11 +51,12 @@
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 import org.apache.cxf.ws.rm.RMConstants;
+import org.apache.cxf.ws.rm.RMContextUtils;
 import org.apache.cxf.ws.rm.RMInInterceptor;
 import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.RMOutInterceptor;
+import org.apache.cxf.ws.rm.RMProperties;
 import org.apache.cxf.ws.rm.soap.RMSoapInterceptor;
-
 import org.junit.After;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -94,6 +102,8 @@
     private boolean doTestTwowayNonAnonymousEndpointSpecific = testAll;
     private boolean doTestTwowayNonAnonymousDeferred = testAll;
     private boolean doTestTwowayNonAnonymousMaximumSequenceLength2 = testAll;
+    private boolean doTestTwowayAtMostOnce = testAll;
+    private boolean doTestInvalidSequence = testAll;
     private boolean doTestOnewayMessageLoss = testAll;
     private boolean doTestOnewayMessageLossAsyncExecutor = testAll;
     private boolean doTestTwowayMessageLoss = testAll;
@@ -103,13 +113,6 @@
 
     @BeforeClass
     public static void startServers() throws Exception {
-        /*
-        // special case handling for WS-Addressing system test to avoid
-        // UUID related issue when server is run as separate process
-        // via maven on Win2k
-        boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
-        assertTrue("server did not launch correctly", launchServer(Server.class, inProcess));
-        */
         assertTrue("server did not launch correctly", launchServer(Server.class));
     }
             
@@ -623,6 +626,114 @@
         expected[1] = true;
         expected[5] = true;
         mf.verifyAcknowledgements(expected, false);
+    }
+    
+    @Test
+    public void testTwowayAtMostOnce() throws Exception {
+        if (!doTestTwowayAtMostOnce) {
+            return;
+        }
+        
+        setupGreeter("org/apache/cxf/systest/ws/rm/atmostonce.xml");
+        
+        class MessageNumberInterceptor extends AbstractPhaseInterceptor {
+            public MessageNumberInterceptor() {
+                setPhase(Phase.USER_LOGICAL);
+            }
+            
+            public void handleMessage(Message m) {
+                RMProperties rmps = RMContextUtils.retrieveRMProperties(m, true);
+                if (null != rmps && null != rmps.getSequence()) {
+                    rmps.getSequence().setMessageNumber(BigInteger.ONE);
+                }
+            }
+        }
+        greeterBus.getOutInterceptors().add(new MessageNumberInterceptor());
+        RMManager manager = greeterBus.getExtension(RMManager.class);
+        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
+        
+        assertEquals("ONE", greeter.greetMe("one"));
+        try {
+            greeter.greetMe("two");
+            fail("Expected fault.");
+        } catch (WebServiceException ex) {
+            SoapFault sf = (SoapFault)ex.getCause();
+            assertEquals("Unexpected fault code.", Soap11.getInstance().getReceiver(), sf.getFaultCode());
+            assertNull("Unexpected sub code.", sf.getSubCode());
+            assertTrue("Unexpected reason.", sf.getReason().endsWith("has already been delivered."));
+        }
+        
+        // wait for resend to occur 
+        
+        awaitMessages(3, 3, 5000);
+         
+        MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages());
+
+        // Expected outbound:
+        // CreateSequence 
+        // + two requests
+       
+        String[] expectedActions = new String[3];
+        expectedActions[0] = RMConstants.getCreateSequenceAction();        
+        for (int i = 1; i < expectedActions.length; i++) {
+            expectedActions[i] = GREETME_ACTION;
+        }
+        mf.verifyActions(expectedActions, true);
+        mf.verifyMessageNumbers(new String[] {null, "1", "1"}, true);
+        mf.verifyLastMessage(new boolean[3], true);
+        mf.verifyAcknowledgements(new boolean[3], true);
+ 
+        // Expected inbound:
+        // createSequenceResponse
+        // + 1 response without acknowledgement
+        // + 1 fault
+        
+        mf.verifyMessages(3, false);
+        expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
+                                        null, null};
+        mf.verifyActions(expectedActions, false);
+        mf.verifyMessageNumbers(new String[] {null, "1", null}, false);
+        mf.verifyAcknowledgements(new boolean[3] , false);
+        
+    }
+    
+    @Test
+    public void testInvalidSequence() throws Exception {
+        if (!doTestInvalidSequence) {
+            return;
+        }
+        
+        setupGreeter("org/apache/cxf/systest/ws/rm/rminterceptors.xml");
+        
+        class SequenceIdInterceptor extends AbstractPhaseInterceptor {
+            public SequenceIdInterceptor() {
+                setPhase(Phase.USER_LOGICAL);
+            }
+            
+            public void handleMessage(Message m) {
+                RMProperties rmps = RMContextUtils.retrieveRMProperties(m, true);
+                if (null != rmps && null != rmps.getSequence()) {
+                    rmps.getSequence().getIdentifier().setValue("UNKNOWN");
+                }
+            }
+        }
+        greeterBus.getOutInterceptors().add(new SequenceIdInterceptor());
+        RMManager manager = greeterBus.getExtension(RMManager.class);
+        manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new BigInteger("2000"));
+       
+        try {
+            greeter.greetMe("one");
+            fail("Expected fault.");
+        } catch (WebServiceException ex) {
+            SoapFault sf = (SoapFault)ex.getCause();
+            assertEquals("Unexpected fault code.", Soap11.getInstance().getSender(), sf.getFaultCode());
+            assertNull("Unexpected sub code.", sf.getSubCode());
+            assertTrue("Unexpected reason.", sf.getReason().endsWith("is not a known Sequence
identifier."));
+        }   
+        
+        // the third inbound message has a SequenceFault header
+        MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages());
+        mf.verifySequenceFault(RMConstants.getUnknownSequenceFaultCode(), false, 1);
     }
 
     @Test    

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml?view=auto&rev=533191
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
Fri Apr 27 11:56:29 2007
@@ -0,0 +1,57 @@
+<?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"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    
+    <import resource="rminterceptors.xml"/>
+    
+    <bean id="org.apache.cxf.ws.rm.RMManager" class="org.apache.cxf.ws.rm.RMManager">
+        <property name="bus" ref="cxf"/>  
+        <property name="destinationPolicy">
+            <value>
+                <wsrm-mgmt:destinationPolicy>
+                    <wsrm-mgmt:acksPolicy intraMessageThreshold="0"/>             
      
+                </wsrm-mgmt:destinationPolicy>
+            </value>
+        </property>
+        
+        <property name="deliveryAssurance">
+            <value>
+                <wsrm-mgmt:deliveryAssurance>
+                    <wsrm-mgmt:AtMostOnce/>                    
+                </wsrm-mgmt:deliveryAssurance>
+            </value>
+        </property>
+        
+        <property name="RMAssertion">
+            <value>
+                <wsrm-policy:RMAssertion>         
+                    <wsrm-policy:BaseRetransmissionInterval Milliseconds="60000"/>
          
+                    <wsrm-policy:AcknowledgementInterval Milliseconds="10000"/>   
                                                    
+                </wsrm-policy:RMAssertion>
+            </value>
+        </property>   
+    </bean>   
+    
+</beans>
\ No newline at end of file

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/atmostonce.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/util/MessageFlow.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/util/MessageFlow.java?view=diff&rev=533191&r1=533190&r2=533191
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/util/MessageFlow.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/util/MessageFlow.java
Fri Apr 27 11:56:29 2007
@@ -310,6 +310,11 @@
         }
         assertTrue("expected AckRequested", found);
     }
+    
+    public void verifySequenceFault(QName code, boolean outbound, int index) throws Exception
{
+        Document d = outbound ? outboundMessages.get(index) : inboundMessages.get(index);
+        assert null != getRMHeaderElement(d, RMConstants.getSequenceFaultName());
+    }
    
     protected String getAction(Document document) throws Exception {
         Element e = getHeaderElement(document, RMConstants.getAddressingNamespace(), "Action");
@@ -362,6 +367,9 @@
                 headerElement = (Element)nd;
                 break;
             }
+        }
+        if (null == headerElement) {
+            return null;
         }
         for (Node nd = headerElement.getFirstChild(); nd != null; nd = nd.getNextSibling())
{ 
             if (Node.ELEMENT_NODE != nd.getNodeType()) {

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java?view=diff&rev=533191&r1=533190&r2=533191
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
Fri Apr 27 11:56:29 2007
@@ -38,7 +38,7 @@
 
     private static final Logger LOG = Logger.getLogger(AbstractGreeterImpl.class.getName());
     private long delay;
-    private String lastOnewayArg;
+    private String greeting;
     private boolean throwAlways;
     private int pingMeCount;
      
@@ -50,6 +50,10 @@
         delay = d;
     }
 
+    public void setGreeting(String g) {
+        greeting = g;
+    }
+
     public void setThrowAlways(boolean t) {
         throwAlways = t;
     }
@@ -65,7 +69,7 @@
         }
         String result = null;
         synchronized (this) {
-            result = null == lastOnewayArg ? arg0.toUpperCase() : lastOnewayArg;
+            result = null == greeting ? arg0.toUpperCase() : greeting;
         }
         LOG.fine("returning: " + result);
         return result;
@@ -83,7 +87,7 @@
 
     public void greetMeOneWay(String arg0) {
         synchronized (this) {
-            lastOnewayArg = arg0;
+            greeting = arg0;
         }
         LOG.fine("Executing operation greetMeOneWay with parameter: " + arg0);
     }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/ControlImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/ControlImpl.java?view=diff&rev=533191&r1=533190&r2=533191
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/ControlImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/greeter_control/ControlImpl.java
Fri Apr 27 11:56:29 2007
@@ -86,6 +86,10 @@
                 System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, cfgResource);
             }
         }
+        if (implementor instanceof AbstractGreeterImpl) {
+            ((AbstractGreeterImpl)implementor).setGreeting(null);
+        }
+        
         return null != greeterBus; 
     }
 



Mime
View raw message