cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r719216 - in /cxf/trunk: rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/ systests/src/test/java/org/apache/cxf/systest/jms/continuations/
Date Thu, 20 Nov 2008 12:42:43 GMT
Author: sergeyb
Date: Thu Nov 20 04:42:43 2008
New Revision: 719216

URL: http://svn.apache.org/viewvc?rev=719216&view=rev
Log:
CXF-1912: ensuring isResumed is not set when timer elapses

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=719216&r1=719215&r2=719216&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Thu Nov 20 04:42:43 2008
@@ -78,16 +78,15 @@
     }
 
     public void resume() {
+        if (isResumed || !isPending) {
+            return;
+        }
+        isResumed = true;
         cancelTimerTask();
         doResume();
     }
     
     protected void doResume() {
-        if (isResumed || !isPending) {
-            return;
-        }
-
-        isResumed = true;
         continuations.remove(this);
         
         BusFactory.setThreadDefaultBus(bus);

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java?rev=719216&r1=719215&r2=719216&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/GreeterImplWithContinuationsJMS.java
Thu Nov 20 04:42:43 2008
@@ -69,6 +69,9 @@
                 if (!suspended) {
                     throw new RuntimeException("Was not suspended yet");
                 }
+                if (continuation.isResumed()) {
+                    throw new RuntimeException("It must be a timeout");
+                }
                 StringBuilder sb = new StringBuilder();
                 sb.append(name);
                 

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java?rev=719216&r1=719215&r2=719216&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/continuations/HelloWorldWithContinuationsJMS.java
Thu Nov 20 04:42:43 2008
@@ -64,6 +64,9 @@
                 continuation.setObject(userObject);
                 suspendInvocation(firstName, continuation);
             } else {
+                if (!continuation.isResumed()) {
+                    throw new RuntimeException("No timeout expected");
+                }
                 StringBuilder sb = new StringBuilder();
                 sb.append(firstName);
                 



Mime
View raw message