cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject [1/2] git commit: [CXF-5726] Eliminate Offer in CreateSequence for oneway endpoint.
Date Fri, 02 May 2014 00:22:11 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 021646df4 -> 93febc0d4


[CXF-5726] Eliminate Offer in CreateSequence for oneway endpoint.

Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/93febc0d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/93febc0d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/93febc0d

Branch: refs/heads/master
Commit: 93febc0d4a3a108dc834d280e0fc51e9ad5afd0c
Parents: 95d6cfc
Author: dsosnoski <dsosnoski@apache.org>
Authored: Fri May 2 12:12:06 2014 +1200
Committer: dsosnoski <dsosnoski@apache.org>
Committed: Fri May 2 12:13:21 2014 +1200

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/ws/rm/Proxy.java   |  5 +--
 .../java/org/apache/cxf/ws/rm/RMManager.java    |  3 +-
 .../java/org/apache/cxf/ws/rm/ProxyTest.java    |  4 +--
 .../org/apache/cxf/ws/rm/RMManagerTest.java     |  1 +
 .../ws/rm/AbstractClientPersistenceTest.java    | 22 +++++---------
 .../cxf/systest/ws/rm/ManagedEndpointsTest.java | 32 +++++---------------
 6 files changed, 23 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
index 7646c54..61caa69 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
@@ -129,7 +129,8 @@ public class Proxy {
     }
 
     public CreateSequenceResponseType createSequence(EndpointReferenceType defaultAcksTo,
RelatesToType relatesTo, 
-             boolean isServer, final ProtocolVariation protocol, final Exchange exchange)
throws RMException {
+        boolean isServer, boolean oneWay, final ProtocolVariation protocol, final Exchange
exchange)
+        throws RMException {
         
         SourcePolicyType sp = reliableEndpoint.getManager().getSourcePolicy();
         CreateSequenceType create = new CreateSequenceType();        
@@ -150,7 +151,7 @@ public class Proxy {
             create.setExpires(expires);
         }
         
-        if (sp.isIncludeOffer()) {
+        if (!oneWay && sp.isIncludeOffer()) {
             OfferType offer = new OfferType();
             d = sp.getOfferedSequenceExpiration();
             if (null != d) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
index 37a2460..172aa3d 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
@@ -457,11 +457,12 @@ public class RMManager {
                 LOG.log(Level.INFO, msg.toString());
                 throw new RMException(msg);
             }
+            boolean oneWay = message.getExchange().isOneWay();
             Proxy proxy = source.getReliableEndpoint().getProxy();
             ProtocolVariation protocol = config.getProtocolVariation();
             Exchange exchange = new ExchangeImpl();
             CreateSequenceResponseType createResponse = 
-                proxy.createSequence(acksTo, relatesTo, isServer, protocol, exchange);
+                proxy.createSequence(acksTo, relatesTo, isServer, oneWay, protocol, exchange);
             if (!isServer) {
                 Servant servant = source.getReliableEndpoint().getServant();
                 servant.createSequenceResponse(createResponse, protocol);

http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
index fe3e087..1afcc79 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ProxyTest.java
@@ -365,10 +365,10 @@ public class ProxyTest extends Assert {
         RelatesToType relatesTo = control.createMock(RelatesToType.class);
         control.replay();
         if (isServer) {
-            assertNull(proxy.createSequence(defaultAcksTo, relatesTo, isServer, 
+            assertNull(proxy.createSequence(defaultAcksTo, relatesTo, isServer, false,
                                             ProtocolVariation.RM10WSA200408, exchange));
         } else {
-            assertNotNull(proxy.createSequence(defaultAcksTo, relatesTo, isServer, 
+            assertNotNull(proxy.createSequence(defaultAcksTo, relatesTo, isServer, false,
                                                ProtocolVariation.RM10WSA200408, exchange));
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
index ba01bd2..88261c5 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
@@ -415,6 +415,7 @@ public class RMManagerTest extends Assert {
         proxy.createSequence(EasyMock.isA(EndpointReferenceType.class),
                              (RelatesToType)EasyMock.isNull(),
                              EasyMock.eq(false),
+                             EasyMock.eq(false),
                              EasyMock.isA(ProtocolVariation.class),
                              EasyMock.isA(Exchange.class));
         EasyMock.expectLastCall().andReturn(createResponse);

http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
index 091fbae..7d31fa4 100644
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/AbstractClientPersistenceTest.java
@@ -204,20 +204,16 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
         Client client = ClientProxy.getClient(greeter);
         String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
         
-        Collection<DestinationSequence> dss =
-            store.getDestinationSequences(id);
-        assertEquals(1, dss.size());
+        Collection<DestinationSequence> dss = store.getDestinationSequences(id);
+        assertEquals(0, dss.size());
         
-        Collection<SourceSequence> sss =
-            store.getSourceSequences(id);
+        Collection<SourceSequence> sss = store.getSourceSequences(id);
         assertEquals(1, sss.size());
         
-        Collection<RMMessage> msgs = 
-            store.getMessages(sss.iterator().next().getIdentifier(), true);
+        Collection<RMMessage> msgs = store.getMessages(sss.iterator().next().getIdentifier(),
true);
         assertEquals(2, msgs.size());  
         
-        msgs = 
-            store.getMessages(sss.iterator().next().getIdentifier(), false);
+        msgs = store.getMessages(sss.iterator().next().getIdentifier(), false);
         assertEquals(0, msgs.size());  
     }
     
@@ -290,12 +286,10 @@ public abstract class AbstractClientPersistenceTest extends AbstractBusClientSer
         Client client = ClientProxy.getClient(greeter);
         String id = RMUtils.getEndpointIdentifier(client.getEndpoint());
         
-        Collection<DestinationSequence> dss =
-            store.getDestinationSequences(id);
-        assertEquals(1, dss.size());
+        Collection<DestinationSequence> dss = store.getDestinationSequences(id);
+        assertEquals(0, dss.size());
         
-        Collection<SourceSequence> sss =
-            store.getSourceSequences(id);
+        Collection<SourceSequence> sss = store.getSourceSequences(id);
         assertEquals(1, sss.size());
         
         int i = 0;

http://git-wip-us.apache.org/repos/asf/cxf/blob/93febc0d/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
index 00aada4..bd4966a 100755
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
@@ -61,7 +61,6 @@ public class ManagedEndpointsTest extends AbstractClientServerTestBase {
 
     public static final String PORT = allocatePort(ManagedEndpointsTest.class);
 
-    private static final String[] EMPTY_SIGNATURE = new String[0];
     private static final String[] ONESTRING_SIGNATURE = new String[]{"java.lang.String"};
     private static final String[] ONEBOOLEAN_SIGNATURE = new String[]{"boolean"};
     
@@ -159,20 +158,14 @@ public class ManagedEndpointsTest extends AbstractClientServerTestBase
{
         o = mbs.invoke(serverEndpointName, "getDestinationSequenceIds", null, null);
         verifyArray("Expected sequence identifier", o, new String[]{sseqId}, false); 
         
-        String dseqId = getSingleDestinationSequenceId(mbs, clientEndpointName);
+        verifyNoDestinationSequence(mbs, clientEndpointName);
 
-        testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId, dseqId);
+        testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId);
         
         mbs.invoke(clientEndpointName, "terminateSourceSequence", new Object[]{sseqId}, ONESTRING_SIGNATURE);
         o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", 
             new Object[]{true}, ONEBOOLEAN_SIGNATURE);
         assertTrue("Source sequence terminated", o instanceof String[] && 0 == ((String[])o).length);
-        
-        mbs.invoke(clientEndpointName, "terminateDestinationSequence", new Object[]{dseqId},
ONESTRING_SIGNATURE);
-        o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", 
-            new Object[]{}, EMPTY_SIGNATURE);
-        assertTrue("Destination sequence terminated", o instanceof String[] && 0
== ((String[])o).length);
-        
     }
 
     @Test
@@ -220,9 +213,9 @@ public class ManagedEndpointsTest extends AbstractClientServerTestBase
{
         o = mbs.invoke(serverEndpointName, "getDestinationSequenceIds", null, null);
         verifyArray("Expected sequence identifier", o, new String[]{sseqId}, false); 
         
-        String dseqId = getSingleDestinationSequenceId(mbs, clientEndpointName);
+        verifyNoDestinationSequence(mbs, clientEndpointName);
     
-        testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId, dseqId);
+        testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId);
         
         mbs.invoke(clientEndpointName, "closeSourceSequence", new Object[]{sseqId}, ONESTRING_SIGNATURE);
         o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", 
@@ -233,24 +226,14 @@ public class ManagedEndpointsTest extends AbstractClientServerTestBase
{
         o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", 
             new Object[]{true}, ONEBOOLEAN_SIGNATURE);
         assertTrue("Source sequence terminated", o instanceof String[] && 0 == ((String[])o).length);
-       
-        mbs.invoke(clientEndpointName, "terminateDestinationSequence", new Object[]{dseqId},
ONESTRING_SIGNATURE);
-        o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", 
-            new Object[]{}, EMPTY_SIGNATURE);
-        assertTrue("Destination sequence terminated", o instanceof String[] && 0
== ((String[])o).length);
-        
     }
 
     private void testOperation(MBeanServer mbs, final Greeter greeter, ObjectName clientEndpointName,
-        ObjectName serverEndpointName, String sseqId, String dseqId) throws ReflectionException,
+        ObjectName serverEndpointName, String sseqId) throws ReflectionException,
         InstanceNotFoundException, MBeanException, InterruptedException {
         AcknowledgementListener listener = new AcknowledgementListener();
         mbs.addNotificationListener(clientEndpointName, listener, null, null);
         Object o;
-        o = mbs.invoke(serverEndpointName, "getSourceSequenceIds", 
-                       new Object[]{true}, ONEBOOLEAN_SIGNATURE);
-        verifyArray("Expected sequence identifier", o, new String[]{dseqId}, false); 
-        
         o = mbs.invoke(clientEndpointName, "getQueuedMessageTotalCount", 
                        new Object[]{true}, ONEBOOLEAN_SIGNATURE);
         assertTrue("No queued message", o instanceof Integer && 0 == ((Integer)o).intValue());
@@ -321,12 +304,11 @@ public class ManagedEndpointsTest extends AbstractClientServerTestBase
{
         assertTrue("No unacknowledged message", o instanceof Long[] && 0 == ((Long[])o).length);
     }
 
-    private String getSingleDestinationSequenceId(MBeanServer mbs, ObjectName clientEndpointName)
+    private void verifyNoDestinationSequence(MBeanServer mbs, ObjectName clientEndpointName)
         throws ReflectionException, InstanceNotFoundException, MBeanException {
         Object o;
         o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", null, null);
-        assertTrue("One sequence expected", o instanceof String[] && 1 == ((String[])o).length);
-        return ((String[])o)[0];
+        assertTrue("No sequence expected", o instanceof String[] && 0 == ((String[])o).length);
     }
 
     private String getSingleSourceSequenceId(MBeanServer mbs, ObjectName clientEndpointName)


Mime
View raw message