cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsosno...@apache.org
Subject svn commit: r1531611 - in /cxf/trunk: rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/resources/schemas/configuration/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/ systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/
Date Sun, 13 Oct 2013 00:56:29 GMT
Author: dsosnoski
Date: Sun Oct 13 00:56:28 2013
New Revision: 1531611

URL: http://svn.apache.org/r1531611
Log:
Change default setting of wsrm-mgr:sequenceTerminationPolicy
terminateOnShutdown to true, as per email discussions
http://mail-archives.apache.org/mod_mbox/cxf-dev/201309.mbox/%3C522A76C0.9020409%40sosnoski.com%3E

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
    cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
    cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/custom-rmmanager.xml
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent-message-loss-server.xml
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent.xml

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Sun Oct 13 00:56:28
2013
@@ -299,7 +299,9 @@ public class RMManager {
             sp = new SourcePolicyType();
         }
         if (sp.getSequenceTerminationPolicy() == null) {
-            sp.setSequenceTerminationPolicy(new SequenceTerminationPolicyType());
+            SequenceTerminationPolicyType term = new SequenceTerminationPolicyType();
+            term.setTerminateOnShutdown(true);
+            sp.setSequenceTerminationPolicy(term);
         }
         sourcePolicy = sp;
     }

Modified: cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd (original)
+++ cxf/trunk/rt/ws/rm/src/main/resources/schemas/configuration/wsrm-manager-types.xsd Sun
Oct 13 00:56:28 2013
@@ -158,16 +158,16 @@
                 </xs:documentation>
             </xs:annotation>      
         </xs:attribute>
-        <xs:attribute name="terminateOnShutdown" type="xs:boolean" use ="optional" default="false">
+        <xs:attribute name="terminateOnShutdown" type="xs:boolean" use ="optional" default="true">
         <xs:annotation>
                 <xs:documentation>
                     Specifies if sequences should be terminated when the bus is shutdown.
                     If set to true, and no last message had been sent for a sequence,
-                    an out of band LastMessage will be issued (in response to which 
+                    an out of band LastMessage or CloseSequence will be issued (in response
to which 
                     a sequence acknowledgment will be sent). If a last message had already
been
                     sent, an acknowledgment is requested instead. 
                     If, after processing these acknowledgement, all messages have been acknowledged,
-                    an attempt is then made to terminates these sequences.
+                    an attempt is then made to terminate these sequences.
                 </xs:documentation>
             </xs:annotation>
         </xs:attribute>

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java Sun Oct 13 00:56:28
2013
@@ -51,6 +51,7 @@ import org.apache.cxf.ws.addressing.Attr
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.JAXWSAConstants;
 import org.apache.cxf.ws.addressing.RelatesToType;
+import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
 import org.apache.cxf.ws.rm.manager.SequenceTerminationPolicyType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
 import org.apache.cxf.ws.rm.persistence.RMMessage;
@@ -125,8 +126,46 @@ public class RMManagerTest extends Asser
         SequenceTerminationPolicyType stp = sp.getSequenceTerminationPolicy();
         assertEquals(0, stp.getMaxRanges());
         assertEquals(0, stp.getMaxUnacknowledged());
-        assertTrue(!stp.isTerminateOnShutdown());
+        assertTrue(stp.isTerminateOnShutdown());
         assertEquals(0, stp.getMaxLength());   
+        
+        DestinationPolicyType dp = manager.getDestinationPolicy();
+        assertNotNull(dp.getAcksPolicy());
+        assertEquals(dp.getAcksPolicy().getIntraMessageThreshold(), 10);
+    } 
+    
+    @Test
+    public void testCustom() {
+        Bus bus = new SpringBusFactory().createBus("org/apache/cxf/ws/rm/custom-rmmanager.xml",
false);
+        manager = bus.getExtension(RMManager.class);        
+        assertNotNull("sourcePolicy is not set.", manager.getSourcePolicy());
+        assertNotNull("destinationPolicy is not set.", manager.getDestinationPolicy());
+        
+        manager.initialise();
+        
+        RMConfiguration cfg = manager.getConfiguration();
+        assertNotNull("RMConfiguration is not set.", cfg);
+        assertNotNull("deliveryAssurance is not set.", cfg.getDeliveryAssurance());
+        
+        assertFalse(cfg.isExponentialBackoff());
+        assertEquals(10000L, cfg.getBaseRetransmissionInterval().longValue());
+        assertEquals(10000L, cfg.getAcknowledgementIntervalTime());
+        assertNull(cfg.getInactivityTimeout());   
+        
+        SourcePolicyType sp = manager.getSourcePolicy();
+        assertEquals(0L, sp.getSequenceExpiration().getTimeInMillis(new Date()));
+        assertEquals(0L, sp.getOfferedSequenceExpiration().getTimeInMillis(new Date()));
+        assertNull(sp.getAcksTo());
+        assertTrue(sp.isIncludeOffer());
+        SequenceTerminationPolicyType stp = sp.getSequenceTerminationPolicy();
+        assertEquals(0, stp.getMaxRanges());
+        assertEquals(0, stp.getMaxUnacknowledged());
+        assertFalse(stp.isTerminateOnShutdown());
+        assertEquals(0, stp.getMaxLength());
+        
+        DestinationPolicyType dp = manager.getDestinationPolicy();
+        assertNotNull(dp.getAcksPolicy());
+        assertEquals(dp.getAcksPolicy().getIntraMessageThreshold(), 0);
     } 
     
     @Test

Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/custom-rmmanager.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/custom-rmmanager.xml?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/custom-rmmanager.xml (original)
+++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/custom-rmmanager.xml Sun Oct 13
00:56:28 2013
@@ -39,17 +39,11 @@ http://www.springframework.org/schema/be
           <wsrm-policy:AcknowledgementInterval Milliseconds="10000"/>             
                                          
       </wsrm-policy:RMAssertion>
       <wsrm-mgr:sourcePolicy>
-          <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="true"/>        
           
+          <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="false"/>       
            
       </wsrm-mgr:sourcePolicy>
       <wsrm-mgr:destinationPolicy>
           <wsrm-mgr:acksPolicy intraMessageThreshold="0"/>                    
       </wsrm-mgr:destinationPolicy>
-      <!--property name="store" ref="txStore"/-->  
-      <property name="store">
-          <bean class="org.apache.cxf.ws.rm.RMManagerConfigurationTest$TestStore">
-              <property name="location" value="here"/>
-          </bean>
-      </property>
     </wsrm-mgr:rmManager>
     
 </beans>

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent-message-loss-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent-message-loss-server.xml?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent-message-loss-server.xml
(original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent-message-loss-server.xml
Sun Oct 13 00:56:28 2013
@@ -43,6 +43,9 @@ http://www.springframework.org/schema/be
                 <wsrm-policy:RMAssertion>
                     <wsrm-policy:BaseRetransmissionInterval Milliseconds="60000" />
                 </wsrm-policy:RMAssertion>
+                <wsrm-mgr:sourcePolicy>
+                    <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="false"/>
                   
+                </wsrm-mgr:sourcePolicy>
                 <wsrm-mgr:store>
                    <wsrm-mgr:jdbcStore url="jdbc:derby:${db.name};create=true"/>
                 </wsrm-mgr:store>

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent.xml?rev=1531611&r1=1531610&r2=1531611&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent.xml (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/persistent.xml Sun
Oct 13 00:56:28 2013
@@ -33,6 +33,9 @@ http://www.springframework.org/schema/be
         <cxf:features>
             <wsa:addressing/>
             <wsrm-mgr:reliableMessaging>
+                <wsrm-mgr:sourcePolicy>
+                    <wsrm-mgr:sequenceTerminationPolicy terminateOnShutdown="false"/>
                   
+                </wsrm-mgr:sourcePolicy>
                 <wsrm-mgr:store>
                    <ref bean="testStore"/>
                 </wsrm-mgr:store>



Mime
View raw message