cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject svn commit: r1137469 - in /cxf/trunk/rt/ws/rm/src: main/java/org/apache/cxf/ws/rm/ main/java/org/apache/cxf/ws/rm/soap/ main/resources/schemas/wsdl/ test/java/org/apache/cxf/ws/rm/ test/java/org/apache/cxf/ws/rm/soap/
Date Sun, 19 Jun 2011 23:51:37 GMT
Author: dsosnoski
Date: Sun Jun 19 23:51:36 2011
New Revision: 1137469

URL: http://svn.apache.org/viewvc?rev=1137469&view=rev
Log:
SequenceFault handling fixes and improvements, restoring some of the unit tests.

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10AImpl.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10Impl.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xsd
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10AImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10AImpl.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10AImpl.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10AImpl.java Sun Jun 19 23:51:36 2011
@@ -43,7 +43,6 @@ import org.apache.cxf.ws.rm.v200702.Crea
 import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
-import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
 import org.apache.cxf.ws.rm.v200702.TerminateSequenceType;
 
@@ -151,8 +150,24 @@ public final class EncoderDecoder10AImpl
         Marshaller marshaller = getContext().createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
         QName fqname = RM10Constants.SEQUENCE_FAULT_QNAME;
-        marshaller.marshal(new JAXBElement<SequenceFaultType>(fqname, SequenceFaultType.class,
-            sf.getSequenceFault()), header);
+        org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType flt =
+            new org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType();
+        flt.setFaultCode(sf.getFaultCode());
+        Object detail = sf.getDetail();
+        if (detail instanceof Element) {
+            flt.getAny().add(detail);
+        } else if (detail instanceof Identifier) {
+            marshaller.marshal(VersionTransformer.convert200502wsa15((Identifier)detail), doc);
+        } else if (detail instanceof SequenceAcknowledgement) {
+            marshaller.marshal(VersionTransformer.convert200502wsa15((SequenceAcknowledgement)detail),
+                doc);
+        }
+        Element data = doc.getDocumentElement();
+        if (data != null) {
+            flt.getAny().add(data);
+        }
+        marshaller.marshal(new JAXBElement<org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType>(fqname,
+            org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType.class, flt), header);
         return header;
     }
 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10Impl.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10Impl.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder10Impl.java Sun Jun 19 23:51:36 2011
@@ -43,7 +43,6 @@ import org.apache.cxf.ws.rm.v200702.Crea
 import org.apache.cxf.ws.rm.v200702.CreateSequenceType;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
-import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
 import org.apache.cxf.ws.rm.v200702.TerminateSequenceType;
 
@@ -151,8 +150,23 @@ public final class EncoderDecoder10Impl 
         Marshaller marshaller = getContext().createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
         QName fqname = RM10Constants.SEQUENCE_FAULT_QNAME;
-        marshaller.marshal(new JAXBElement<SequenceFaultType>(fqname, SequenceFaultType.class,
-            sf.getSequenceFault()), header);
+        org.apache.cxf.ws.rm.v200502.SequenceFaultType flt =
+            new org.apache.cxf.ws.rm.v200502.SequenceFaultType();
+        flt.setFaultCode(sf.getFaultCode());
+        Object detail = sf.getDetail();
+        if (detail instanceof Element) {
+            flt.getAny().add(detail);
+        } else if (detail instanceof Identifier) {
+            marshaller.marshal(VersionTransformer.convert200502((Identifier)detail), doc);
+        } else if (detail instanceof SequenceAcknowledgement) {
+            marshaller.marshal(VersionTransformer.convert200502((SequenceAcknowledgement)detail), doc);
+        }
+        Element data = doc.getDocumentElement();
+        if (data != null) {
+            flt.getAny().add(data);
+        }
+        marshaller.marshal(new JAXBElement<org.apache.cxf.ws.rm.v200502.SequenceFaultType>(fqname,
+            org.apache.cxf.ws.rm.v200502.SequenceFaultType.class, flt), header);
         return header;
     }
 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/EncoderDecoder11Impl.java Sun Jun 19 23:51:36 2011
@@ -149,8 +149,25 @@ public final class EncoderDecoder11Impl 
         Marshaller marshaller = getContext().createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
         QName fqname = RM11Constants.SEQUENCE_FAULT_QNAME;
-        marshaller.marshal(new JAXBElement<SequenceFaultType>(fqname, SequenceFaultType.class,
-            sf.getSequenceFault()), header);
+        SequenceFaultType flt = new SequenceFaultType();
+        flt.setFaultCode(sf.getFaultCode());
+        Object detail = sf.getDetail();
+        if (detail instanceof Element) {
+            flt.getAny().add(detail);
+        } else if (detail instanceof Identifier) {
+            marshaller.marshal(detail, doc);
+        } else if (detail instanceof SequenceAcknowledgement) {
+            marshaller.marshal(detail, doc);
+        }
+        Element data = doc.getDocumentElement();
+        if (data != null) {
+            flt.getDetail().getAny().add(data);
+        }
+        data = sf.getExtraDetail();
+        if (data != null) {
+            flt.getDetail().getAny().add(data);
+        }
+        marshaller.marshal(new JAXBElement<SequenceFaultType>(fqname, SequenceFaultType.class, flt), header);
         return header;
     }
 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFault.java Sun Jun 19 23:51:36 2011
@@ -21,33 +21,24 @@ package org.apache.cxf.ws.rm;
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
+import org.w3c.dom.Element;
+
+import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
 
 /**
- * 
+ * Holder for SequenceFault information.
  */
-
 public class SequenceFault extends Exception {
     
-    private SequenceFaultType sequenceFault;
     private boolean sender;
+    private QName faultCode;
     private Object detail;
+    private Element extraDetail;
 
     public SequenceFault(String message) {
         super(message);
     }
-
-    public SequenceFault(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    public SequenceFaultType getSequenceFault() {
-        return sequenceFault;
-    }
-    
-    public void setSequenceFault(SequenceFaultType sf) {
-        sequenceFault = sf;
-    }
     
     public boolean isSender() {
         return sender;
@@ -57,19 +48,70 @@ public class SequenceFault extends Excep
         sender = s;
     }
     
-    public QName getSubCode() {
-        return sequenceFault.getFaultCode();
-    }
-    
     public String getReason() {
         return getMessage();
     }
     
-    public void setDetail(Object d) {
+    public QName getFaultCode() {
+        return faultCode;
+    }
+
+    public void setFaultCode(QName faultCode) {
+        this.faultCode = faultCode;
+    }
+
+    /**
+     * Set detail content as arbitrary element.
+     * 
+     * @param d (<code>null</code> if none)
+     */
+    public void setDetail(Element d) {
+        detail = d;
+    }
+
+    /**
+     * Set detail content as Identifier.
+     * 
+     * @param d (<code>null</code> if none)
+     */
+    public void setDetail(Identifier d) {
+        detail = d;
+    }
+
+    /**
+     * Set detail content as SequenceAcknowledgement.
+     * 
+     * @param d (<code>null</code> if none)
+     */
+    public void setDetail(SequenceAcknowledgement d) {
         detail = d;
     }
     
+    /**
+     * Get Fault detail object, which may be an {@link Element}, an {@link Identifier}, or a
+     * {@link SequenceAcknowledgement}.
+     * 
+     * @return detail object (<code>null</code> if none)
+     */
     public Object getDetail() {
         return detail;
     }
+
+    /**
+     * Get extra element appended to main fault detail.
+     * 
+     * @return element (<code>null</code> if none)
+     */
+    public Element getExtraDetail() {
+        return extraDetail;
+    }
+
+    /**
+     * Set extra element appended to main fault detail.
+     * 
+     * @param ex (<code>null</code> if none)
+     */
+    public void setExtraDetail(Element ex) {
+        extraDetail = ex;
+    }
 }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SequenceFaultFactory.java Sun Jun 19 23:51:36 2011
@@ -25,11 +25,10 @@ import org.apache.cxf.common.i18n.Bundle
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
-import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
+
 /**
  * Utility class to construct SequenceFaults.
  */
-
 class SequenceFaultFactory {
 
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(SequenceFaultFactory.class);
@@ -41,58 +40,46 @@ class SequenceFaultFactory {
     }
     
     SequenceFault createUnknownSequenceFault(Identifier sid) {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(constants.getUnknownSequenceFaultCode());
         Message msg = new Message("UNKNOWN_SEQ_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
         fault.setDetail(sid);
         fault.setSender(true);
+        fault.setFaultCode(constants.getUnknownSequenceFaultCode());
         return fault;
     } 
     
     SequenceFault createSequenceTerminatedFault(Identifier sid, boolean sender) {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(constants.getSequenceTerminatedFaultCode());
         Message msg = new Message("SEQ_TERMINATED_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
         fault.setDetail(sid);
         fault.setSender(sender);
+        fault.setFaultCode(constants.getSequenceTerminatedFaultCode());
         return fault;
     }
     
     SequenceFault createInvalidAcknowledgementFault(SequenceAcknowledgement ack) {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(constants.getInvalidAcknowledgmentFaultCode());
         Message msg = new Message("INVALID_ACK_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
         fault.setDetail(ack);
         fault.setSender(true);
+        fault.setFaultCode(constants.getInvalidAcknowledgmentFaultCode());
         return fault;
     }
     
     SequenceFault createMessageNumberRolloverFault(Identifier sid) {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(constants.getMessageNumberRolloverFaultCode());
         Message msg = new Message("MESSAGE_NR_ROLLOVER_EXC", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
         fault.setDetail(sid);
         fault.setSender(true);
+        fault.setFaultCode(constants.getMessageNumberRolloverFaultCode());
         return fault;
     }
     
     SequenceFault createCreateSequenceRefusedFault() {
-        SequenceFaultType sf = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sf.setFaultCode(constants.getCreateSequenceRefusedFaultCode());
         Message msg = new Message("CREATE_SEQ_REFUSED", BUNDLE);
         SequenceFault fault = new SequenceFault(msg.toString());
-        fault.setSequenceFault(sf);
         fault.setSender(true);
+        fault.setFaultCode(constants.getCreateSequenceRefusedFaultCode());
         return fault;
     }
-    
-    
 }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java Sun Jun 19 23:51:36 2011
@@ -193,15 +193,12 @@ public class RMSoapInterceptor extends A
     }
     
     /**
-     * Encode the SeuqnceFault in protocol-specific header.
+     * Encode the SequenceFault in protocol-specific header.
      *
      * @param message the SOAP message.
      * @param sf the SequenceFault.
      */
     public static void encodeFault(SoapMessage message, SequenceFault sf) {
-        if (null == sf.getSequenceFault()) {
-            return;
-        }
         LOG.log(Level.FINE, "Encoding SequenceFault in SOAP header");
         try {
             List<Header> headers = message.getHeaders();
@@ -277,11 +274,16 @@ public class RMSoapInterceptor extends A
                     }
                     if (rmUri != null && rmUri.equals(ns)) {
                         if (codec == null) {
-                            AddressingProperties maps =
-                                RMContextUtils.retrieveMAPs(message, false, false);
-                            codec = VersionTransformer.getEncoderDecoder(rmUri, maps.getNamespaceURI());
+                            String wsauri = null;
+                            AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
+                            if (maps == null) {
+                                wsauri = getManager(message).getRMAddressingNamespace();
+                            } else {
+                                wsauri = maps.getNamespaceURI();
+                            }
+                            codec = VersionTransformer.getEncoderDecoder(rmUri, wsauri);
                             if (codec == null) {
-                                LOG.log(Level.WARNING, "NAMESPACE_ERROR_MSG", maps.getNamespaceURI()); 
+                                LOG.log(Level.WARNING, "NAMESPACE_ERROR_MSG", wsauri); 
                                 break;
                             }
                         }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java Sun Jun 19 23:51:36 2011
@@ -71,7 +71,7 @@ public class SoapFaultFactory implements
     Fault createSoap11Fault(SequenceFault sf) {
         SoapFault fault = new SoapFault(sf.getReason(),
             sf.isSender() ? version.getSender() : version.getReceiver());
-        fault.setSubCode(sf.getSubCode());
+        fault.setSubCode(sf.getFaultCode());
         return fault;
     }
     

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xsd?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xsd (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/wsdl/wsrm-1.1.xsd Sun Jun 19 23:51:36 2011
@@ -106,7 +106,9 @@
   </xs:complexType>
   <xs:complexType name="DetailType">
     <xs:sequence>
-      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+      <!-- modified schema to more-closely match the specification, changing the
+        namespace to ##any -->
+      <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:anyAttribute namespace="##other" processContents="lax"/>
   </xs:complexType>

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/DestinationTest.java Sun Jun 19 23:51:36 2011
@@ -122,7 +122,7 @@ public class DestinationTest extends Ass
             destination.acknowledge(message);   
             fail("Expected SequenceFault not thrown.");
         } catch (SequenceFault ex) {
-            assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, ex.getSequenceFault().getFaultCode());
+            assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, ex.getFaultCode());
         }
     }
     

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java Sun Jun 19 23:51:36 2011
@@ -84,7 +84,7 @@ public class ProxyTest extends Assert {
     public void testOfferedIdentifier() { 
         OfferType offer = control.createMock(OfferType.class);        
         Identifier id = control.createMock(Identifier.class);
-        EasyMock.expect(offer.getIdentifier()).andReturn(id);
+        EasyMock.expect(offer.getIdentifier()).andReturn(id).anyTimes();
         control.replay();
         Proxy proxy = new Proxy(rme);
         assertNull(proxy.getOfferedIdentifier());
@@ -96,11 +96,11 @@ public class ProxyTest extends Assert {
     public void testAcknowledgeNotSupported() throws RMException {
         DestinationSequence ds = control.createMock(DestinationSequence.class);
         EndpointReferenceType acksToEPR = control.createMock(EndpointReferenceType.class);
-        EasyMock.expect(ds.getAcksTo()).andReturn(acksToEPR);
+        EasyMock.expect(ds.getAcksTo()).andReturn(acksToEPR).anyTimes();
         AttributedURIType acksToURI = control.createMock(AttributedURIType.class);
-        EasyMock.expect(acksToEPR.getAddress()).andReturn(acksToURI);
+        EasyMock.expect(acksToEPR.getAddress()).andReturn(acksToURI).anyTimes();
         String acksToAddress = Names.WSA_ANONYMOUS_ADDRESS;
-        EasyMock.expect(acksToURI.getValue()).andReturn(acksToAddress);
+        EasyMock.expect(acksToURI.getValue()).andReturn(acksToAddress).anyTimes();
         control.replay();
         Proxy proxy = new Proxy(rme);
         proxy.acknowledge(ds);        
@@ -112,24 +112,24 @@ public class ProxyTest extends Assert {
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
         DestinationSequence ds = control.createMock(DestinationSequence.class);
         EndpointReferenceType acksToEPR = control.createMock(EndpointReferenceType.class);
-        EasyMock.expect(ds.getAcksTo()).andReturn(acksToEPR);
+        EasyMock.expect(ds.getAcksTo()).andReturn(acksToEPR).anyTimes();
         AttributedURIType acksToURI = control.createMock(AttributedURIType.class);
-        EasyMock.expect(acksToEPR.getAddress()).andReturn(acksToURI);
+        EasyMock.expect(acksToEPR.getAddress()).andReturn(acksToURI).anyTimes();
         String acksToAddress = "acksTo";
-        EasyMock.expect(acksToURI.getValue()).andReturn(acksToAddress);
+        EasyMock.expect(acksToURI.getValue()).andReturn(acksToAddress).anyTimes();
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         EndpointInfo epi = control.createMock(EndpointInfo.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(epi.getService()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
-        EasyMock.expect(si.getInterface()).andReturn(ii);
+        EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
         OperationInfo oi = control.createMock(OperationInfo.class);
-        EasyMock.expect(ii.getOperation(RM10Constants.SEQUENCE_ACK_QNAME)).andReturn(oi);
+        EasyMock.expect(ii.getOperation(RM11Constants.SEQUENCE_ACK_QNAME)).andReturn(oi).anyTimes();
         expectInvoke(proxy, oi, null);
         control.replay();
         
@@ -143,7 +143,7 @@ public class ProxyTest extends Assert {
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
         SourceSequence ss = control.createMock(SourceSequence.class);
-        EasyMock.expect(ss.getTarget()).andReturn(null);
+        EasyMock.expect(ss.getTarget()).andReturn(null).anyTimes();
         control.replay();
         proxy.lastMessage(ss);
         control.verify();
@@ -151,26 +151,26 @@ public class ProxyTest extends Assert {
         control.reset();
         org.apache.cxf.ws.addressing.EndpointReferenceType target
             = RMUtils.createAnonymousReference();
-        EasyMock.expect(ss.getTarget()).andReturn(target);
+        EasyMock.expect(ss.getTarget()).andReturn(target).anyTimes();
         control.replay();
         proxy.lastMessage(ss);
         control.verify();
         
         control.reset();
         target = RMUtils.createReference("http://localhost:9000/greeterPort");
-        EasyMock.expect(ss.getTarget()).andReturn(target);
+        EasyMock.expect(ss.getTarget()).andReturn(target).anyTimes();
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         EndpointInfo epi = control.createMock(EndpointInfo.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(epi.getService()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
-        EasyMock.expect(si.getInterface()).andReturn(ii);
+        EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
         OperationInfo oi = control.createMock(OperationInfo.class);
-        EasyMock.expect(ii.getOperation(RM10Constants.CLOSE_SEQUENCE_QNAME)).andReturn(oi);
+        EasyMock.expect(ii.getOperation(RM11Constants.CLOSE_SEQUENCE_QNAME)).andReturn(oi).anyTimes();
         expectInvokeWithContext(proxy, oi, null);
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
         control.replay();
         
         proxy.lastMessage(ss);
@@ -183,20 +183,20 @@ public class ProxyTest extends Assert {
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);        
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         EndpointInfo epi = control.createMock(EndpointInfo.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(epi.getService()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
-        EasyMock.expect(si.getInterface()).andReturn(ii);
+        EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
         OperationInfo oi = control.createMock(OperationInfo.class);
-        EasyMock.expect(ii.getOperation(RM10Constants.TERMINATE_SEQUENCE_QNAME)).andReturn(oi);
+        EasyMock.expect(ii.getOperation(RM11Constants.TERMINATE_SEQUENCE_QNAME)).andReturn(oi).anyTimes();
         SourceSequence ss = control.createMock(SourceSequence.class);
         Identifier id = control.createMock(Identifier.class);
-        EasyMock.expect(ss.getIdentifier()).andReturn(id);
+        EasyMock.expect(ss.getIdentifier()).andReturn(id).anyTimes();
         expectInvoke(proxy, oi, null);
         control.replay();
         proxy.terminate(ss);
@@ -208,28 +208,28 @@ public class ProxyTest extends Assert {
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         EndpointInfo epi = control.createMock(EndpointInfo.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(epi.getService()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
-        EasyMock.expect(si.getInterface()).andReturn(ii);
+        EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
         OperationInfo oi = control.createMock(OperationInfo.class);
-        EasyMock.expect(ii.getOperation(RM10Constants.CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME))
-            .andReturn(oi);
+        EasyMock.expect(ii.getOperation(RM11Constants.CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME))
+            .andReturn(oi).anyTimes();
         CreateSequenceResponseType csr = control.createMock(CreateSequenceResponseType.class);
         expectInvoke(proxy, oi, null);
         control.replay();
         proxy.createSequenceResponse(csr);
     }
     
-/*    @Test
+    @Test
     public void testCreateSequenceOnClient() throws NoSuchMethodException, RMException {
         testCreateSequence(false); 
-    }   */
+    }
     
     @Test
     public void testCreateSequenceOnServer() throws NoSuchMethodException, RMException {
@@ -243,32 +243,32 @@ public class ProxyTest extends Assert {
                          org.apache.cxf.ws.addressing.EndpointReferenceType.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
 
         RMManager manager = control.createMock(RMManager.class);
-        EasyMock.expect(rme.getManager()).andReturn(manager);
+        EasyMock.expect(rme.getManager()).andReturn(manager).anyTimes();
         Bus bus = control.createMock(Bus.class);
-        EasyMock.expect(manager.getBus()).andReturn(bus);
+        EasyMock.expect(manager.getBus()).andReturn(bus).anyTimes();
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         BindingInfo bi = control.createMock(BindingInfo.class);
-        EasyMock.expect(rme.getBindingInfo()).andReturn(bi);
+        EasyMock.expect(rme.getBindingInfo()).andReturn(bi).anyTimes();
 
         Conduit conduit = control.createMock(Conduit.class);
-        EasyMock.expect(rme.getConduit()).andReturn(conduit);
+        EasyMock.expect(rme.getConduit()).andReturn(conduit).anyTimes();
         org.apache.cxf.ws.addressing.EndpointReferenceType replyTo 
             = control.createMock(org.apache.cxf.ws.addressing.EndpointReferenceType.class);
-        EasyMock.expect(rme.getReplyTo()).andReturn(replyTo);
+        EasyMock.expect(rme.getReplyTo()).andReturn(replyTo).anyTimes();
         
         OperationInfo oi = control.createMock(OperationInfo.class);
         BindingOperationInfo boi = control.createMock(BindingOperationInfo.class);
-        EasyMock.expect(bi.getOperation(oi)).andReturn(boi);
+        EasyMock.expect(bi.getOperation(oi)).andReturn(boi).anyTimes();
         Client client = control.createMock(Client.class);
-        EasyMock.expect(proxy.createClient(bus, endpoint, conduit, replyTo)).andReturn(client);  
+        EasyMock.expect(proxy.createClient(bus, endpoint, conduit, replyTo)).andReturn(client).anyTimes();  
         Object[] args = new Object[] {};
         Map<String, Object> context = new HashMap<String, Object>();
         Object[] results = new Object[] {"a", "b", "c"};
-        EasyMock.expect(client.invoke(boi, args, context)).andReturn(results);        
+        EasyMock.expect(client.invoke(boi, args, context)).andReturn(results).anyTimes();        
         
         control.replay();
         assertEquals("a", proxy.invoke(oi, args, context));
@@ -293,7 +293,7 @@ public class ProxyTest extends Assert {
         Endpoint endpoint = control.createMock(Endpoint.class);
         Conduit conduit = control.createMock(Conduit.class);
         ConduitSelector cs = control.createMock(ConduitSelector.class);
-        EasyMock.expect(cs.selectConduit(EasyMock.isA(Message.class))).andReturn(conduit);
+        EasyMock.expect(cs.selectConduit(EasyMock.isA(Message.class))).andReturn(conduit).anyTimes();
         control.replay();
         Proxy.RMClient client = proxy.new RMClient(bus, endpoint, cs);
         assertSame(conduit, client.getConduit());    
@@ -306,51 +306,49 @@ public class ProxyTest extends Assert {
             new Class[] {OperationInfo.class, Object[].class, Map.class});
         Proxy proxy = control.createMock(Proxy.class, new Method[] {m});
         proxy.setReliableEndpoint(rme);
-        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder10Impl.INSTANCE).anyTimes();
+        EasyMock.expect(rme.getEncoderDecoder()).andReturn(EncoderDecoder11Impl.INSTANCE).anyTimes();
         
         RMManager manager = control.createMock(RMManager.class);
-        EasyMock.expect(rme.getManager()).andReturn(manager);
+        EasyMock.expect(rme.getManager()).andReturn(manager).anyTimes();
         SourcePolicyType sp = control.createMock(SourcePolicyType.class);
-        EasyMock.expect(manager.getSourcePolicy()).andReturn(sp);
-        EasyMock.expect(sp.getAcksTo()).andReturn(null);
+        EasyMock.expect(manager.getSourcePolicy()).andReturn(sp).anyTimes();
+        EasyMock.expect(sp.getAcksTo()).andReturn(null).anyTimes();
         Duration d = DatatypeFactory.createDuration("PT12H");
-        EasyMock.expect(sp.getSequenceExpiration()).andReturn(d);
-        EasyMock.expect(sp.isIncludeOffer()).andReturn(true);
+        EasyMock.expect(sp.getSequenceExpiration()).andReturn(d).anyTimes();
+        EasyMock.expect(sp.isIncludeOffer()).andReturn(true).anyTimes();
         Duration dOffered = DatatypeFactory.createDuration("PT24H");
-        EasyMock.expect(sp.getOfferedSequenceExpiration()).andReturn(dOffered);
+        EasyMock.expect(sp.getOfferedSequenceExpiration()).andReturn(dOffered).anyTimes();
         Source source = control.createMock(Source.class);
-        EasyMock.expect(rme.getSource()).andReturn(source);
+        EasyMock.expect(rme.getSource()).andReturn(source).anyTimes();
         Identifier offeredId = control.createMock(Identifier.class);
-        EasyMock.expect(source.generateSequenceIdentifier()).andReturn(offeredId);
+        EasyMock.expect(source.generateSequenceIdentifier()).andReturn(offeredId).anyTimes();
              
         Endpoint endpoint = control.createMock(Endpoint.class);
-        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint);
+        EasyMock.expect(rme.getEndpoint()).andReturn(endpoint).anyTimes();
         EndpointInfo epi = control.createMock(EndpointInfo.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
+        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi).anyTimes();
         ServiceInfo si = control.createMock(ServiceInfo.class);
-        EasyMock.expect(epi.getService()).andReturn(si);
+        EasyMock.expect(epi.getService()).andReturn(si).anyTimes();
         InterfaceInfo ii = control.createMock(InterfaceInfo.class);
-        EasyMock.expect(si.getInterface()).andReturn(ii);
+        EasyMock.expect(si.getInterface()).andReturn(ii).anyTimes();
         OperationInfo oi = control.createMock(OperationInfo.class);
         CreateSequenceResponseType csr = new CreateSequenceResponseType();
         if (isServer) {
-            EasyMock.expect(ii.getOperation(RM10Constants.CREATE_SEQUENCE_ONEWAY_QNAME))
-                .andReturn(oi);
+            EasyMock.expect(ii.getOperation(RM11Constants.CREATE_SEQUENCE_ONEWAY_QNAME))
+                .andReturn(oi).anyTimes();
             Endpoint ae = control.createMock(Endpoint.class);
-            EasyMock.expect(rme.getApplicationEndpoint()).andReturn(ae);
-            EasyMock.expect(ae.getExecutor()).andReturn(SynchronousExecutor.getInstance());
+            EasyMock.expect(rme.getApplicationEndpoint()).andReturn(ae).anyTimes();
+            EasyMock.expect(ae.getExecutor()).andReturn(SynchronousExecutor.getInstance()).anyTimes();
             expectInvoke(proxy, oi, null);
         } else {
-            EasyMock.expect(ii.getOperation(RM10Constants.CREATE_SEQUENCE_QNAME)).andReturn(oi);
-            org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType exposed =
-                new org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType();
-            expectInvoke(proxy, oi, exposed);
+            EasyMock.expect(ii.getOperation(RM11Constants.CREATE_SEQUENCE_QNAME)).andReturn(oi).anyTimes();
+            expectInvoke(proxy, oi, csr);
         }
         
         EndpointReferenceType defaultAcksTo = control.createMock(EndpointReferenceType.class);
         AttributedURIType aut = control.createMock(AttributedURIType.class);
-        EasyMock.expect(aut.getValue()).andReturn("here");
-        EasyMock.expect(defaultAcksTo.getAddress()).andReturn(aut);
+        EasyMock.expect(aut.getValue()).andReturn("here").anyTimes();
+        EasyMock.expect(defaultAcksTo.getAddress()).andReturn(aut).anyTimes();
         RelatesToType relatesTo = control.createMock(RelatesToType.class);
         control.replay();
         if (isServer) {
@@ -363,13 +361,13 @@ public class ProxyTest extends Assert {
     @SuppressWarnings("unchecked")
     private void expectInvoke(Proxy proxy, OperationInfo oi, Object expectedReturn) throws RMException {
         EasyMock.expect(proxy.invoke(EasyMock.same(oi), EasyMock.isA(Object[].class), 
-            (Map)EasyMock.isNull())).andReturn(expectedReturn);
+            (Map)EasyMock.isNull())).andReturn(expectedReturn).anyTimes();
     }
     
     @SuppressWarnings("unchecked")
     private void expectInvokeWithContext(Proxy proxy, OperationInfo oi, Object expectedReturn) 
         throws RMException {
         EasyMock.expect(proxy.invoke(EasyMock.same(oi), EasyMock.isA(Object[].class), 
-            EasyMock.isA(Map.class))).andReturn(expectedReturn);
+            EasyMock.isA(Map.class))).andReturn(expectedReturn).anyTimes();
     }
 }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Sun Jun 19 23:51:36 2011
@@ -26,7 +26,7 @@ import java.util.Collections;
 import java.util.List;
 
 import javax.wsdl.extensions.ExtensibilityElement;
-//import javax.xml.namespace.QName;
+import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.Soap11;
@@ -39,10 +39,11 @@ import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
-//import org.apache.cxf.service.model.InterfaceInfo;
-//import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.policy.EffectivePolicy;
 import org.apache.cxf.ws.policy.EndpointPolicy;
@@ -145,8 +146,7 @@ public class RMEndpointTest extends Asse
         rme.setPolicies();
         EasyMock.expectLastCall();
         Conduit c = control.createMock(Conduit.class);
-        org.apache.cxf.ws.addressing.EndpointReferenceType epr = control
-            .createMock(org.apache.cxf.ws.addressing.EndpointReferenceType.class);
+        EndpointReferenceType epr = control.createMock(EndpointReferenceType.class);
         control.replay();
         rme.initialise(c, epr, null);
         assertSame(c, rme.getConduit());
@@ -164,7 +164,7 @@ public class RMEndpointTest extends Asse
         WrappedService ws = (WrappedService)s;
         assertSame(as, ws.getWrappedService());
         assertSame(rme.getServant(), s.getInvoker());
-//        verifyService();
+        verifyService();
     }
 
     @Test
@@ -173,7 +173,7 @@ public class RMEndpointTest extends Asse
         rme = control.createMock(RMEndpoint.class, new Method[] {m});
         rme.setAplicationEndpoint(ae);
         rme.setManager(manager);
-        rme.setEncoderDecoder(EncoderDecoder10Impl.INSTANCE);
+        rme.setEncoderDecoder(EncoderDecoder11Impl.INSTANCE);
         Service as = control.createMock(Service.class);
         EasyMock.expect(ae.getService()).andReturn(as);
         EndpointInfo aei = control.createMock(EndpointInfo.class);
@@ -197,7 +197,7 @@ public class RMEndpointTest extends Asse
         assertSame(ae, we.getWrappedEndpoint());
         Service s = rme.getService();
         assertEquals(1, s.getEndpoints().size());
-        assertSame(e, s.getEndpoints().get(RM10Constants.PORT_NAME));
+        assertSame(e, s.getEndpoints().get(RM11Constants.PORT_NAME));
     }
 
     @Test
@@ -356,7 +356,7 @@ public class RMEndpointTest extends Asse
         assertSame(p, effective.getPolicy());
     }
 
-/*    private void verifyService() {
+    private void verifyService() {
         Service service = rme.getService();
         ServiceInfo si = service.getServiceInfos().get(0);
         assertNotNull("service info is null", si);
@@ -365,7 +365,7 @@ public class RMEndpointTest extends Asse
 
         assertEquals(7, intf.getOperations().size());
 
-        String ns = RM10Constants.NAMESPACE_URI;
+        String ns = RM11Constants.NAMESPACE_URI;
         OperationInfo oi = intf.getOperation(new QName(ns, "CreateSequence"));
         assertNotNull("No operation info.", oi);
         assertTrue("Operation is oneway.", !oi.isOneWay());
@@ -396,5 +396,5 @@ public class RMEndpointTest extends Asse
         oi = intf.getOperation(new QName(ns, "CreateSequenceResponseOneway"));
         assertNotNull("No operation info.", oi);
         assertTrue("Operation is toway.", oi.isOneWay());
-    }   */
+    }
 }
\ No newline at end of file

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMInInterceptorTest.java Sun Jun 19 23:51:36 2011
@@ -252,7 +252,7 @@ public class RMInInterceptorTest extends
             interceptor.processAcknowledgments(rme, rmps);
             fail("Expected SequenceFault not thrown");
         } catch (SequenceFault sf) {
-            assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, sf.getSequenceFault().getFaultCode());
+            assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, sf.getFaultCode());
         }
     }
     

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMOutInterceptorTest.java Sun Jun 19 23:51:36 2011
@@ -24,17 +24,18 @@ import java.util.Iterator;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.cxf.interceptor.InterceptorChain;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.FaultMode;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-//import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
-//import org.apache.cxf.ws.addressing.AttributedURIType;
-//import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.JAXWSAConstants;
 import org.apache.cxf.ws.addressing.MAPAggregator;
-//import org.apache.cxf.ws.rm.v200702.Identifier;
+import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
@@ -74,7 +75,7 @@ public class RMOutInterceptorTest extend
         };
         RMOutInterceptor interceptor = control.createMock(RMOutInterceptor.class, mocked);
         Message message = control.createMock(Message.class);        
-        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(true);
+        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(true).anyTimes();
         control.replay();
         interceptor.handle(message);
         control.verify();
@@ -87,16 +88,16 @@ public class RMOutInterceptorTest extend
         };
         RMOutInterceptor interceptor = control.createMock(RMOutInterceptor.class, mocked);
         Message message = control.createMock(Message.class);        
-        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(false);
+        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(false).anyTimes();
         EasyMock.expect(message.get(Message.REQUESTOR_ROLE)).andReturn(Boolean.FALSE).anyTimes();        
         EasyMock.expect(message.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND))
-            .andReturn(null);
+            .andReturn(null).anyTimes();
         control.replay();
         interceptor.handle(message);
         control.verify();
     }
     
-/*    @Test
+    @Test
     public void testHandleApplicationMessage() throws NoSuchMethodException, SequenceFault, RMException {
         AddressingPropertiesImpl maps = createMAPs("greetMe", "localhost:9000/GreeterPort", 
             org.apache.cxf.ws.addressing.Names.WSA_NONE_ADDRESS);
@@ -109,44 +110,45 @@ public class RMOutInterceptorTest extend
         };
         RMOutInterceptor interceptor = control.createMock(RMOutInterceptor.class, mocked);         
         RMManager manager = control.createMock(RMManager.class);
-        EasyMock.expect(interceptor.getManager()).andReturn(manager).times(5);
+        EasyMock.expect(interceptor.getManager()).andReturn(manager).anyTimes();
         
         Message message = control.createMock(Message.class);
-        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(false);
+        EasyMock.expect(interceptor.isRuntimeFault(message)).andReturn(false).anyTimes();
         Exchange ex = control.createMock(Exchange.class);
         EasyMock.expect(message.getExchange()).andReturn(ex).anyTimes();
-        EasyMock.expect(ex.getOutMessage()).andReturn(message).times(1);
-        EasyMock.expect(ex.put("defer.uncorrelated.message.abort", Boolean.TRUE)).andReturn(null);       
+        EasyMock.expect(ex.getOutMessage()).andReturn(message).anyTimes();
+        EasyMock.expect(ex.put("defer.uncorrelated.message.abort", Boolean.TRUE)).andReturn(null).anyTimes();
         EasyMock.expect(message.get(Message.REQUESTOR_ROLE)).andReturn(Boolean.TRUE).anyTimes();        
         EasyMock.expect(message.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND))
             .andReturn(maps).anyTimes();
         RMProperties rmpsOut = new RMProperties();
-        EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_OUTBOUND)).andReturn(rmpsOut);
+        EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_OUTBOUND)).
+            andReturn(rmpsOut).anyTimes();
         InterceptorChain chain = control.createMock(InterceptorChain.class);
-        EasyMock.expect(message.getInterceptorChain()).andReturn(chain);
+        EasyMock.expect(message.getInterceptorChain()).andReturn(chain).anyTimes();
         chain.add(EasyMock.isA(RetransmissionInterceptor.class));
         EasyMock.expectLastCall();
         RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
-        EasyMock.expect(manager.getRetransmissionQueue()).andReturn(queue);
+        EasyMock.expect(manager.getRetransmissionQueue()).andReturn(queue).anyTimes();
         queue.start();
         EasyMock.expectLastCall();
                 
         Source source = control.createMock(Source.class);
-        EasyMock.expect(manager.getSource(message)).andReturn(source);
+        EasyMock.expect(manager.getSource(message)).andReturn(source).anyTimes();
         Destination destination = control.createMock(Destination.class);
-        EasyMock.expect(manager.getDestination(message)).andReturn(destination);
+        EasyMock.expect(manager.getDestination(message)).andReturn(destination).anyTimes();
         SourceSequence sseq = control.createMock(SourceSequence.class);
         EasyMock.expect(manager.getSequence((Identifier)EasyMock.isNull(), EasyMock.same(message), 
-                                        EasyMock.same(maps))).andReturn(sseq);
+                                        EasyMock.same(maps))).andReturn(sseq).anyTimes();
         EasyMock.expect(sseq.nextMessageNumber((Identifier)EasyMock.isNull(), 
-            (Long)EasyMock.eq(0L), EasyMock.eq(false))).andReturn(new Long(10));
-        EasyMock.expect(sseq.isLastMessage()).andReturn(false);
+            (Long)EasyMock.eq(0L), EasyMock.eq(false))).andReturn(new Long(10)).anyTimes();
+        EasyMock.expect(sseq.isLastMessage()).andReturn(false).anyTimes();
         interceptor.addAcknowledgements(EasyMock.same(destination), EasyMock.same(rmpsOut), 
             (Identifier)EasyMock.isNull(), EasyMock.isA(AttributedURIType.class));
         EasyMock.expectLastCall();
         Identifier sid = control.createMock(Identifier.class);
-        EasyMock.expect(sseq.getIdentifier()).andReturn(sid);
-        EasyMock.expect(sseq.getCurrentMessageNr()).andReturn(new Long(10));
+        EasyMock.expect(sseq.getIdentifier()).andReturn(sid).anyTimes();
+        EasyMock.expect(sseq.getCurrentMessageNr()).andReturn(new Long(10)).anyTimes();
 
         
         control.replay();
@@ -154,33 +156,33 @@ public class RMOutInterceptorTest extend
         assertSame(sid, rmpsOut.getSequence().getIdentifier());        
         assertEquals(new Long(10), rmpsOut.getSequence().getMessageNumber());
         control.verify();
-    }   */
+    }
     
     @Test
     public void testIsRuntimeFault() {
         Message message = control.createMock(Message.class);
         Exchange exchange = control.createMock(Exchange.class);
-        EasyMock.expect(message.getExchange()).andReturn(exchange).times(2);
-        EasyMock.expect(exchange.getOutFaultMessage()).andReturn(message);
-        EasyMock.expect(message.get(FaultMode.class)).andReturn(FaultMode.RUNTIME_FAULT);
+        EasyMock.expect(message.getExchange()).andReturn(exchange).anyTimes();
+        EasyMock.expect(exchange.getOutFaultMessage()).andReturn(message).anyTimes();
+        EasyMock.expect(message.get(FaultMode.class)).andReturn(FaultMode.RUNTIME_FAULT).anyTimes();
         control.replay();
         RMOutInterceptor rmi = new RMOutInterceptor();
         assertTrue(rmi.isRuntimeFault(message));
         control.verify();
         control.reset();
-        EasyMock.expect(message.getExchange()).andReturn(exchange).times(2);
-        EasyMock.expect(exchange.getOutFaultMessage()).andReturn(null);
+        EasyMock.expect(message.getExchange()).andReturn(exchange).anyTimes();
+        EasyMock.expect(exchange.getOutFaultMessage()).andReturn(null).anyTimes();
         control.replay();
         assertTrue(!rmi.isRuntimeFault(message));
         control.verify();
     }
     
-/*    private AddressingPropertiesImpl createMAPs(String action, String to, String replyTo) {
+    private AddressingPropertiesImpl createMAPs(String action, String to, String replyTo) {
         AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
         maps.setTo(RMUtils.createReference(to));
         EndpointReferenceType epr = RMUtils.createReference(replyTo);
         maps.setReplyTo(epr);
         return maps;
            
-    }   */
+    }
 }

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java Sun Jun 19 23:51:36 2011
@@ -58,7 +58,6 @@ import org.apache.cxf.ws.rm.v200702.AckR
 import org.apache.cxf.ws.rm.v200702.Identifier;
 import org.apache.cxf.ws.rm.v200702.ObjectFactory;
 import org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement;
-import org.apache.cxf.ws.rm.v200702.SequenceFaultType;
 import org.apache.cxf.ws.rm.v200702.SequenceType;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -234,17 +233,15 @@ public class RMSoapInterceptorTest exten
         // fault is a SoapFault and has a SequenceFault cause
         
         message = setupOutboundFaultMessage();
-        SequenceFaultType sft = RMUtils.getWSRMFactory().createSequenceFaultType();
-        sft.setFaultCode(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME);
         SequenceFault sf = new SequenceFault("REASON");
-        sf.setSequenceFault(sft);
+        sf.setFaultCode(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME);
         Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
         sid.setValue("SID");
         sf.setSender(true);
         f.initCause(sf);
         message.setContent(Exception.class, f);      
         codec.encode(message);
-//        verifyHeaders(message, new String[] {RMConstants.SEQUENCE_FAULT_NAME});
+        verifyHeaders(message, new String[] {RMConstants.SEQUENCE_FAULT_NAME});
 
     }
 

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java?rev=1137469&r1=1137468&r2=1137469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/SoapFaultFactoryTest.java Sun Jun 19 23:51:36 2011
@@ -62,7 +62,7 @@ public class SoapFaultFactoryTest extend
         sf = control.createMock(SequenceFault.class);
         EasyMock.expect(sf.getReason()).andReturn("reason");
         EasyMock.expect(sf.isSender()).andReturn(isSender);
-        EasyMock.expect(sf.getSubCode()).andReturn(code);
+        EasyMock.expect(sf.getFaultCode()).andReturn(code);
         if (null != detail) {
             EasyMock.expect(sf.getDetail()).andReturn(detail);
             SequenceFaultType sft = new SequenceFaultType();



Mime
View raw message