Commit in servicemix/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/impl on MAIN
ActiveMQNotificationBrokerTest.java+16-141.1 -> 1.2
StubNotificationConsumer.java+4-21.1 -> 1.2
+20-16
2 modified files
fixed failing test case

servicemix/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/impl
ActiveMQNotificationBrokerTest.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ActiveMQNotificationBrokerTest.java	24 Aug 2005 14:51:20 -0000	1.1
+++ ActiveMQNotificationBrokerTest.java	24 Aug 2005 15:07:09 -0000	1.2
@@ -24,6 +24,7 @@
 import org.servicemix.wspojo.notification.NotificationConsumer;
 import org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType;
 
+import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
@@ -31,7 +32,7 @@
 import java.util.List;
 
 /**
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  */
 public class ActiveMQNotificationBrokerTest extends TestSupport {
 
@@ -78,12 +79,8 @@
 
     public void testSubscribe() throws Exception {
 
-        final Slot result = new Slot();
-        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker() {
-            protected NotificationConsumer createNotificationConsumer(EndpointReferenceType consumerReference) {
-                return new StubNotificationConsumer(result);
-            }
-        };
+        Slot result = new Slot();
+        ActiveMQNotificationBroker broker = createBroker(result);
 
         addSubscription(broker);
         sendNotification(broker);
@@ -94,15 +91,10 @@
         assertValidMessage(notifyMessages);
     }
 
-
     public void testSubscriptionPauseResume() throws Exception {
 
-        final Slot result = new Slot();
-        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker() {
-            protected NotificationConsumer createNotificationConsumer(EndpointReferenceType consumerReference) {
-                return new StubNotificationConsumer(result);
-            }
-        };
+        Slot result = new Slot();
+        ActiveMQNotificationBroker broker = createBroker(result);
 
         EndpointReferenceType subRef = addSubscription(broker);
 
@@ -127,5 +119,15 @@
         // We should now get the message that was previously sent since the sub is now running.
         subNotifyDoc = (List<NotificationMessageHolderType>) result.poll(2000);
         assertNotNull(subNotifyDoc);
+    }
+
+
+    protected ActiveMQNotificationBroker createBroker(final Slot result) throws JMSException {
+        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker() {
+            protected NotificationConsumer createNotificationConsumer(final ActiveMQSubscription consumerReference) {
+                return new StubNotificationConsumer(result);
+            }
+        };
+        return broker;
     }
 }

servicemix/ws/jaxws/wsnotification/src/test/java/org/servicemix/ws/notification/impl
StubNotificationConsumer.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- StubNotificationConsumer.java	24 Aug 2005 14:51:20 -0000	1.1
+++ StubNotificationConsumer.java	24 Aug 2005 15:07:09 -0000	1.2
@@ -32,7 +32,7 @@
 /**
  * A simple NotificationConsumer used for unit testing.
  *
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  */
 public class StubNotificationConsumer implements NotificationConsumer {
     private static final transient Log log = LogFactory.getLog(StubNotificationConsumer.class);
@@ -54,8 +54,10 @@
     public void notify(
             @WebParam(name = "NotificationMessage", targetNamespace = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd")
             List<NotificationMessageHolderType> list) {
+
+        System.out.println("#### Received inbound notification: " + list);
         try {
-            timeout = 1000;
+            timeout = 5000;
             result.offer(list, timeout);
         }
         catch (InterruptedException e) {
CVSspam 0.2.8



Reply via email to