Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-07-24 04:02:08 -0400
committerrbrooks2010-07-24 04:02:08 -0400
commit4ed8bddc791fda93940f238c5135556a07041dc0 (patch)
tree64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.framework.messaging.test
parent542cc7344d3f129d64e47f547384297c8e1b1f43 (diff)
downloadorg.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.framework.messaging.test')
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/.project56
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/README_JUNIT.txt16
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/build.properties8
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/DefaultNodeInfos.java56
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/IntegrationSuite.java30
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/MessageStatusTest.java144
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/TestMessages.java122
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/BasicListener.java78
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java514
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServicesMultipleConsumers.java204
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/ObjectFactory.java120
-rw-r--r--plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/TestMessage.java194
12 files changed, 771 insertions, 771 deletions
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/.project b/plugins/org.eclipse.osee.framework.messaging.test/.project
index d3ff2b3c04..bac3a4c859 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/.project
+++ b/plugins/org.eclipse.osee.framework.messaging.test/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.osee.framework.messaging.test</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.framework.messaging.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/README_JUNIT.txt b/plugins/org.eclipse.osee.framework.messaging.test/README_JUNIT.txt
index ffdb0c462e..90e1e03a4d 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/README_JUNIT.txt
+++ b/plugins/org.eclipse.osee.framework.messaging.test/README_JUNIT.txt
@@ -1,9 +1,9 @@
-The tests in this package require the following bundles to be INSTALLED.
-
-jms.activemq.launch
-jms.libraries
-
-They can be checked out from svn then exported and put into the '<eclipse_install>/dropins' folder.
-
-These bundles allow us to easily start and stop a message broker using an eclipse application.
+The tests in this package require the following bundles to be INSTALLED.
+
+jms.activemq.launch
+jms.libraries
+
+They can be checked out from svn then exported and put into the '<eclipse_install>/dropins' folder.
+
+These bundles allow us to easily start and stop a message broker using an eclipse application.
This is required to run several of our tests. \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/build.properties b/plugins/org.eclipse.osee.framework.messaging.test/build.properties
index 41eb6ade2b..34d2e4d2da 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/build.properties
+++ b/plugins/org.eclipse.osee.framework.messaging.test/build.properties
@@ -1,4 +1,4 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/DefaultNodeInfos.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/DefaultNodeInfos.java
index 5bf0af7d6a..07314c4786 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/DefaultNodeInfos.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/DefaultNodeInfos.java
@@ -8,31 +8,31 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.internal;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.messaging.NodeInfo;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public class DefaultNodeInfos {
-
- public static String OSEE_JMS_DEFAULT_PORT = "61616";
- public static NodeInfo OSEE_JMS_DEFAULT;
- public static NodeInfo OSEE_VM;
-
- static{
- try {
- OSEE_JMS_DEFAULT = new NodeInfo("osee-jms", new URI("tcp://localhost:" + OSEE_JMS_DEFAULT_PORT));
- OSEE_VM = new NodeInfo("osee-vm", new URI("vm://localhost?broker.persistent=false"));
- } catch (URISyntaxException ex) {
- OseeLog.log(DefaultNodeInfos.class, Level.SEVERE, ex);
- }
- }
-
-}
+package org.eclipse.osee.framework.messaging.internal;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.logging.Level;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.messaging.NodeInfo;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class DefaultNodeInfos {
+
+ public static String OSEE_JMS_DEFAULT_PORT = "61616";
+ public static NodeInfo OSEE_JMS_DEFAULT;
+ public static NodeInfo OSEE_VM;
+
+ static{
+ try {
+ OSEE_JMS_DEFAULT = new NodeInfo("osee-jms", new URI("tcp://localhost:" + OSEE_JMS_DEFAULT_PORT));
+ OSEE_VM = new NodeInfo("osee-vm", new URI("vm://localhost?broker.persistent=false"));
+ } catch (URISyntaxException ex) {
+ OseeLog.log(DefaultNodeInfos.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/IntegrationSuite.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/IntegrationSuite.java
index be9870632e..506a15a0d1 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/IntegrationSuite.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/IntegrationSuite.java
@@ -8,18 +8,18 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.internal;
-
-import org.eclipse.osee.framework.messaging.services.internal.TestMessageServices;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TestSendingAndRecieving.class,
- TestBrokerServiceInterruptions.class,
- TestMessageServices.class
-})
-public class IntegrationSuite {
-}
-
+package org.eclipse.osee.framework.messaging.internal;
+
+import org.eclipse.osee.framework.messaging.services.internal.TestMessageServices;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ TestSendingAndRecieving.class,
+ TestBrokerServiceInterruptions.class,
+ TestMessageServices.class
+})
+public class IntegrationSuite {
+}
+
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/MessageStatusTest.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/MessageStatusTest.java
index 39baaffb3e..771cb7d02f 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/MessageStatusTest.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/MessageStatusTest.java
@@ -8,75 +8,75 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.internal;
-
-import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public class MessageStatusTest implements OseeMessagingStatusCallback {
-
- private volatile boolean isDone = false;
- private volatile boolean timedOut = false;
- private volatile boolean waitedOnStatus = false;
- private boolean shouldPass;
-
- public MessageStatusTest(boolean shouldPass){
- this.shouldPass = shouldPass;
- }
-
- @Override
- public void fail(Throwable th) {
- if(waitedOnStatus){
- return;
- }
-
- if(timedOut){
- return;
- }
- if(shouldPass){
- org.junit.Assert.fail(th.getMessage());
- } else {
- org.junit.Assert.assertTrue(true);
- }
- isDone = true;
- }
-
- @Override
- public void success() {
- if(waitedOnStatus){
- return;
- }
-
- if(timedOut){
- return;
- }
- if(shouldPass){
- org.junit.Assert.assertTrue(true);
- } else {
- org.junit.Assert.fail("We had a status of 'success'");
- }
- isDone = true;
- }
-
- public void waitForStatus(int time) {
- long timeout = System.currentTimeMillis() + time;
- while (!isDone && System.currentTimeMillis() < timeout) {
- try {
- Thread.sleep(200);
- } catch (InterruptedException ex) {
- }
- }
- if (!isDone) {
- timedOut = true;
- if(shouldPass){
- org.junit.Assert.fail("We timed out waiting for status.");
- } else {
- org.junit.Assert.assertTrue(true);
- }
- }
- waitedOnStatus = true;
- }
-}
+package org.eclipse.osee.framework.messaging.internal;
+
+import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class MessageStatusTest implements OseeMessagingStatusCallback {
+
+ private volatile boolean isDone = false;
+ private volatile boolean timedOut = false;
+ private volatile boolean waitedOnStatus = false;
+ private boolean shouldPass;
+
+ public MessageStatusTest(boolean shouldPass){
+ this.shouldPass = shouldPass;
+ }
+
+ @Override
+ public void fail(Throwable th) {
+ if(waitedOnStatus){
+ return;
+ }
+
+ if(timedOut){
+ return;
+ }
+ if(shouldPass){
+ org.junit.Assert.fail(th.getMessage());
+ } else {
+ org.junit.Assert.assertTrue(true);
+ }
+ isDone = true;
+ }
+
+ @Override
+ public void success() {
+ if(waitedOnStatus){
+ return;
+ }
+
+ if(timedOut){
+ return;
+ }
+ if(shouldPass){
+ org.junit.Assert.assertTrue(true);
+ } else {
+ org.junit.Assert.fail("We had a status of 'success'");
+ }
+ isDone = true;
+ }
+
+ public void waitForStatus(int time) {
+ long timeout = System.currentTimeMillis() + time;
+ while (!isDone && System.currentTimeMillis() < timeout) {
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException ex) {
+ }
+ }
+ if (!isDone) {
+ timedOut = true;
+ if(shouldPass){
+ org.junit.Assert.fail("We timed out waiting for status.");
+ } else {
+ org.junit.Assert.assertTrue(true);
+ }
+ }
+ waitedOnStatus = true;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/TestMessages.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/TestMessages.java
index 6f2b808f3b..068ec41bba 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/TestMessages.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/internal/TestMessages.java
@@ -8,64 +8,64 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.internal;
-
-import org.eclipse.osee.framework.messaging.MessageID;
-import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public enum TestMessages implements MessageID {
- TestTopic(true, "ABVlXX3B9UaWogL++MgA", "topic:someTopic", null),
- JMS_TOPIC(true, "ABWApt8OtWlAnz5CJXQA", "topic:test.topic.Mynewthing.removeme", TestMessage.class),
- VM_TOPIC(true, "ABWHSTHuTlQb5xWueMAA", "topic:inThisJVM", TestMessage.class),
- test(true, "ABWoNNdp0RnrO5T5bWwA", "test", null),
- test2(true, "ABWpvHZTpBTR+PhVrwgA","test2", null),
- replyTopic(true, "ABWswvHPoR6RpnW9oGAA","topic:someTopicThatNeedsAReply", null, true);
-
- private String name;
- private Class<?> clazz;
- boolean isReplyRequired;
- private String guid;
-
- TestMessages(boolean isTopic, String guid, String name, Class<?> clazz, boolean isReplyRequired){
- this.guid = guid;
- this.name = name;
- this.clazz = clazz;
- this.isReplyRequired = isReplyRequired;
- }
-
- TestMessages(boolean isTopic, String guid,String name, Class<?> clazz){
- this.name = name;
- this.clazz = clazz;
- this.isReplyRequired = false;
- this.guid = guid;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public Class<?> getSerializationClass() {
- return clazz;
- }
-
- @Override
- public boolean isReplyRequired() {
- return isReplyRequired;
- }
-
- @Override
- public String getId() {
- return guid;
- }
-
- @Override
- public boolean isTopic() {
- return true;
- }
-}
+package org.eclipse.osee.framework.messaging.internal;
+
+import org.eclipse.osee.framework.messaging.MessageID;
+import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public enum TestMessages implements MessageID {
+ TestTopic(true, "ABVlXX3B9UaWogL++MgA", "topic:someTopic", null),
+ JMS_TOPIC(true, "ABWApt8OtWlAnz5CJXQA", "topic:test.topic.Mynewthing.removeme", TestMessage.class),
+ VM_TOPIC(true, "ABWHSTHuTlQb5xWueMAA", "topic:inThisJVM", TestMessage.class),
+ test(true, "ABWoNNdp0RnrO5T5bWwA", "test", null),
+ test2(true, "ABWpvHZTpBTR+PhVrwgA","test2", null),
+ replyTopic(true, "ABWswvHPoR6RpnW9oGAA","topic:someTopicThatNeedsAReply", null, true);
+
+ private String name;
+ private Class<?> clazz;
+ boolean isReplyRequired;
+ private String guid;
+
+ TestMessages(boolean isTopic, String guid, String name, Class<?> clazz, boolean isReplyRequired){
+ this.guid = guid;
+ this.name = name;
+ this.clazz = clazz;
+ this.isReplyRequired = isReplyRequired;
+ }
+
+ TestMessages(boolean isTopic, String guid,String name, Class<?> clazz){
+ this.name = name;
+ this.clazz = clazz;
+ this.isReplyRequired = false;
+ this.guid = guid;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public Class<?> getSerializationClass() {
+ return clazz;
+ }
+
+ @Override
+ public boolean isReplyRequired() {
+ return isReplyRequired;
+ }
+
+ @Override
+ public String getId() {
+ return guid;
+ }
+
+ @Override
+ public boolean isTopic() {
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/BasicListener.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/BasicListener.java
index 8889d6c828..9539f210cf 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/BasicListener.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/BasicListener.java
@@ -8,42 +8,42 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.services.internal;
-
-import java.util.Map;
-import org.eclipse.osee.framework.messaging.OseeMessagingListener;
-import org.eclipse.osee.framework.messaging.ReplyConnection;
-import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public class BasicListener extends OseeMessagingListener {
-
- private int id;
- private boolean received = false;
-
- public BasicListener(int id) {
- this.id = id;
- }
-
- @Override
- public Class<?> getClazz() {
- return TestMessage.class;
- }
-
- @Override
- public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) {
- System.out.println(message + " - " + id);
- received = true;
- }
-
- public boolean isReceived(){
- return received;
- }
-
- public String toString(){
- return "BasicListener " + id;
- }
-}
+package org.eclipse.osee.framework.messaging.services.internal;
+
+import java.util.Map;
+import org.eclipse.osee.framework.messaging.OseeMessagingListener;
+import org.eclipse.osee.framework.messaging.ReplyConnection;
+import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class BasicListener extends OseeMessagingListener {
+
+ private int id;
+ private boolean received = false;
+
+ public BasicListener(int id) {
+ this.id = id;
+ }
+
+ @Override
+ public Class<?> getClazz() {
+ return TestMessage.class;
+ }
+
+ @Override
+ public void process(Object message, Map<String, Object> headers, ReplyConnection replyConnection) {
+ System.out.println(message + " - " + id);
+ received = true;
+ }
+
+ public boolean isReceived(){
+ return received;
+ }
+
+ public String toString(){
+ return "BasicListener " + id;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
index e6205f2ef3..edc8b5efdb 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServices.java
@@ -8,260 +8,260 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.services.internal;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.logging.Level;
-import junit.framework.Assert;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.messaging.ConnectionNode;
-import org.eclipse.osee.framework.messaging.NodeInfo;
-import org.eclipse.osee.framework.messaging.OseeMessagingListener;
-import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
-import org.eclipse.osee.framework.messaging.ReplyConnection;
-import org.eclipse.osee.framework.messaging.internal.BaseBrokerTesting;
-import org.eclipse.osee.framework.messaging.internal.TestMessages;
-import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup;
-import org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar;
-import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator;
-import org.eclipse.osee.framework.messaging.services.ServiceNotification;
-import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair;
-import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public class TestMessageServices extends BaseBrokerTesting {
-
- private static String BROKER_URI_SERVER = "tcp://localhost:61616";
- private static String BROKER_URI = "tcp://localhost:61616";
-
- @org.junit.Before
- public void startBroker(){
- try {
- startEmbeddedBroker("testBroker", BROKER_URI_SERVER);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @org.junit.After
- public void stopBroker(){
- try {
- stopEmbeddedBroker("testBroker", BROKER_URI_SERVER);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
-// @Ignore
- @org.junit.Test
- public void testServiceUpClientComesUp() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
- Assert.assertNotNull(connection);
- ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
-
- RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
- RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
- registrar.start();
- lookup.start();
-
- registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 30);
-
- TestNotification testNotification = new TestNotification();
- lookup.register("testService", "1002", testNotification);
-
- testWait(3000);
- Assert.assertTrue(testNotification.getServiceUpdates() >= 1);
- int currentNumberOfUpdates = testNotification.getServiceUpdates();
- testWait(35000);
-
- Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
- Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
-
- testWait(1000);
-
- Assert.assertEquals(1, testNotification.getServiceAway());//message from unregister
-
- testWait(90000);
-
- Assert.assertEquals(2, testNotification.getServiceAway());//service renewal timout
- Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
- Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
-
- registrar.stop();
- lookup.stop();
- testWait(2000);
- }
-
-// @Ignore
- @org.junit.Test
- public void testClientUpServiceComesUp() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
- Assert.assertNotNull(connection);
- ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
- RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
- registrar.start();
-
- RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
- lookup.start();
-
- TestNotification testNotification = new TestNotification();
- lookup.register("testService", "1002", testNotification);
-
- registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 30);
- testWait(3000);
-
- Assert.assertTrue(testNotification.getServiceUpdates() >= 1);
- int currentNumberOfUpdates = testNotification.getServiceUpdates();
-
- testWait(35000);
-
- Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
- Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
-
- testWait(1000);
-
- Assert.assertEquals(1, testNotification.getServiceAway());//message from unregister
-
- testWait(90000);
-
- Assert.assertEquals(2, testNotification.getServiceAway());//service renewal timout
-
- Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
- Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
-
- lookup.stop();
- registrar.stop();
- testWait(2000);
- }
-
-// @Ignore
- @org.junit.Test
- public void testServiceComesUpClientGetsReply() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
- Assert.assertNotNull(connection);
- ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
-
- RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
- registrar.start();
- registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 50000);
-
-
- testWait(2000);
- RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
- lookup.start();
- TestNotification testNotification = new TestNotification();
- lookup.register("testService", "1002", testNotification);
- testWait(1000);
-
- Assert.assertEquals(1, testNotification.getServiceUpdates());
-
- Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
- Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
-
- registrar.stop();
- lookup.stop();
- testWait(2000);
- }
-
-// @Ignore
- @org.junit.Test
- public void testReply() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
- TestReplyListener service = new TestReplyListener();
- TestReplyListener replyReciever = new TestReplyListener();
- connection.subscribe(TestMessages.replyTopic, service, new OseeMessagingStatusImpl("failed to subscribe", TestMessageServices.class));
- connection.subscribeToReply(TestMessages.replyTopic, replyReciever);
- testWait(1000);
- System.out.println(System.currentTimeMillis());
- connection.send(TestMessages.replyTopic, "test", new BasicOseeMessagingStatus());
- System.out.println(System.currentTimeMillis());
- testWait(5000);
- System.out.println(System.currentTimeMillis());
- Assert.assertEquals(1, service.sentReply);
- Assert.assertEquals(1, replyReciever.receivedReply);
- connection.unsubscribe(TestMessages.replyTopic, service, new OseeMessagingStatusImpl("failed to subscribe", TestMessageServices.class));
- }
-
- private class TestReplyListener extends OseeMessagingListener {
- int sentReply;
- int receivedReply;
- String msg = "back at ya";
- @Override
- public void process(Object message, Map<String, Object> headers,
- ReplyConnection replyConnection) {
- if(replyConnection.isReplyRequested()){
- try {
- System.out.println(System.currentTimeMillis());
- System.out.println(System.currentTimeMillis() +" reply requested - " + msg);
- replyConnection.send(msg, null, new BasicOseeMessagingStatus());
- sentReply++;
- } catch (OseeCoreException ex) {
- ex.printStackTrace();
- }
- } else {
- System.out.println(System.currentTimeMillis() +" got a reply - " + message);
- if(message.toString().equals(msg)){
- receivedReply++;
- }
- }
- }
- }
-
- private class BasicOseeMessagingStatus implements OseeMessagingStatusCallback {
- @Override
- public void fail(Throwable th) {
- th.printStackTrace();
- OseeLog.log(BasicOseeMessagingStatus.class, Level.SEVERE, th);
- }
- @Override
- public void success() {
- }
- }
-
- private class TestPopulator implements ServiceInfoPopulator {
-
- @Override
- public void updateServiceInfo(
- List<ServiceDescriptionPair> serviceDescription) {
- ServiceDescriptionPair pair1 = new ServiceDescriptionPair();
- pair1.setName("test");
- pair1.setValue("one");
- serviceDescription.add(pair1);
- }
-
- }
-
- private class TestNotification implements ServiceNotification {
-
- private int serviceUpdates = 0;
- private int serviceAway = 0;
-
- public int getServiceUpdates() {
- return serviceUpdates;
- }
- public int getServiceAway(){
- return serviceAway;
- }
-
- @Override
- public void onServiceGone(ServiceHealth serviceHealth) {
- serviceAway++;
- System.out.println("serviceAway " + serviceAway);
- }
-
- @Override
- public void onServiceUpdate(ServiceHealth serviceHealth) {
- serviceUpdates++;
- System.out.println("healthUpdates " + serviceUpdates);
- }
-
- }
-}
+package org.eclipse.osee.framework.messaging.services.internal;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.logging.Level;
+import junit.framework.Assert;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.messaging.ConnectionNode;
+import org.eclipse.osee.framework.messaging.NodeInfo;
+import org.eclipse.osee.framework.messaging.OseeMessagingListener;
+import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
+import org.eclipse.osee.framework.messaging.ReplyConnection;
+import org.eclipse.osee.framework.messaging.internal.BaseBrokerTesting;
+import org.eclipse.osee.framework.messaging.internal.TestMessages;
+import org.eclipse.osee.framework.messaging.services.RemoteServiceLookup;
+import org.eclipse.osee.framework.messaging.services.RemoteServiceRegistrar;
+import org.eclipse.osee.framework.messaging.services.ServiceInfoPopulator;
+import org.eclipse.osee.framework.messaging.services.ServiceNotification;
+import org.eclipse.osee.framework.messaging.services.messages.ServiceDescriptionPair;
+import org.eclipse.osee.framework.messaging.services.messages.ServiceHealth;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class TestMessageServices extends BaseBrokerTesting {
+
+ private static String BROKER_URI_SERVER = "tcp://localhost:61616";
+ private static String BROKER_URI = "tcp://localhost:61616";
+
+ @org.junit.Before
+ public void startBroker(){
+ try {
+ startEmbeddedBroker("testBroker", BROKER_URI_SERVER);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @org.junit.After
+ public void stopBroker(){
+ try {
+ stopEmbeddedBroker("testBroker", BROKER_URI_SERVER);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+// @Ignore
+ @org.junit.Test
+ public void testServiceUpClientComesUp() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+ Assert.assertNotNull(connection);
+ ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
+
+ RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
+ RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
+ registrar.start();
+ lookup.start();
+
+ registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 30);
+
+ TestNotification testNotification = new TestNotification();
+ lookup.register("testService", "1002", testNotification);
+
+ testWait(3000);
+ Assert.assertTrue(testNotification.getServiceUpdates() >= 1);
+ int currentNumberOfUpdates = testNotification.getServiceUpdates();
+ testWait(35000);
+
+ Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
+ Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
+
+ testWait(1000);
+
+ Assert.assertEquals(1, testNotification.getServiceAway());//message from unregister
+
+ testWait(90000);
+
+ Assert.assertEquals(2, testNotification.getServiceAway());//service renewal timout
+ Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
+ Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
+
+ registrar.stop();
+ lookup.stop();
+ testWait(2000);
+ }
+
+// @Ignore
+ @org.junit.Test
+ public void testClientUpServiceComesUp() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+ Assert.assertNotNull(connection);
+ ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
+ RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
+ registrar.start();
+
+ RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
+ lookup.start();
+
+ TestNotification testNotification = new TestNotification();
+ lookup.register("testService", "1002", testNotification);
+
+ registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 30);
+ testWait(3000);
+
+ Assert.assertTrue(testNotification.getServiceUpdates() >= 1);
+ int currentNumberOfUpdates = testNotification.getServiceUpdates();
+
+ testWait(35000);
+
+ Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
+ Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
+
+ testWait(1000);
+
+ Assert.assertEquals(1, testNotification.getServiceAway());//message from unregister
+
+ testWait(90000);
+
+ Assert.assertEquals(2, testNotification.getServiceAway());//service renewal timout
+
+ Assert.assertEquals(currentNumberOfUpdates + 1, testNotification.getServiceUpdates());
+ Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
+
+ lookup.stop();
+ registrar.stop();
+ testWait(2000);
+ }
+
+// @Ignore
+ @org.junit.Test
+ public void testServiceComesUpClientGetsReply() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+ Assert.assertNotNull(connection);
+ ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
+
+ RemoteServiceRegistrar registrar = new RemoteServiceRegistrarImpl(connection, executor);
+ registrar.start();
+ registrar.registerService("testService", "1002", "some.service.id", new URI("tcp://localhost:666"), new TestPopulator(), 50000);
+
+
+ testWait(2000);
+ RemoteServiceLookup lookup = new RemoteServiceLookupImpl(connection, executor);
+ lookup.start();
+ TestNotification testNotification = new TestNotification();
+ lookup.register("testService", "1002", testNotification);
+ testWait(1000);
+
+ Assert.assertEquals(1, testNotification.getServiceUpdates());
+
+ Assert.assertTrue(lookup.unregister("testService", "1002", testNotification));
+ Assert.assertTrue(registrar.unregisterService("testService", "1002", "some.service.id"));
+
+ registrar.stop();
+ lookup.stop();
+ testWait(2000);
+ }
+
+// @Ignore
+ @org.junit.Test
+ public void testReply() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+ TestReplyListener service = new TestReplyListener();
+ TestReplyListener replyReciever = new TestReplyListener();
+ connection.subscribe(TestMessages.replyTopic, service, new OseeMessagingStatusImpl("failed to subscribe", TestMessageServices.class));
+ connection.subscribeToReply(TestMessages.replyTopic, replyReciever);
+ testWait(1000);
+ System.out.println(System.currentTimeMillis());
+ connection.send(TestMessages.replyTopic, "test", new BasicOseeMessagingStatus());
+ System.out.println(System.currentTimeMillis());
+ testWait(5000);
+ System.out.println(System.currentTimeMillis());
+ Assert.assertEquals(1, service.sentReply);
+ Assert.assertEquals(1, replyReciever.receivedReply);
+ connection.unsubscribe(TestMessages.replyTopic, service, new OseeMessagingStatusImpl("failed to subscribe", TestMessageServices.class));
+ }
+
+ private class TestReplyListener extends OseeMessagingListener {
+ int sentReply;
+ int receivedReply;
+ String msg = "back at ya";
+ @Override
+ public void process(Object message, Map<String, Object> headers,
+ ReplyConnection replyConnection) {
+ if(replyConnection.isReplyRequested()){
+ try {
+ System.out.println(System.currentTimeMillis());
+ System.out.println(System.currentTimeMillis() +" reply requested - " + msg);
+ replyConnection.send(msg, null, new BasicOseeMessagingStatus());
+ sentReply++;
+ } catch (OseeCoreException ex) {
+ ex.printStackTrace();
+ }
+ } else {
+ System.out.println(System.currentTimeMillis() +" got a reply - " + message);
+ if(message.toString().equals(msg)){
+ receivedReply++;
+ }
+ }
+ }
+ }
+
+ private class BasicOseeMessagingStatus implements OseeMessagingStatusCallback {
+ @Override
+ public void fail(Throwable th) {
+ th.printStackTrace();
+ OseeLog.log(BasicOseeMessagingStatus.class, Level.SEVERE, th);
+ }
+ @Override
+ public void success() {
+ }
+ }
+
+ private class TestPopulator implements ServiceInfoPopulator {
+
+ @Override
+ public void updateServiceInfo(
+ List<ServiceDescriptionPair> serviceDescription) {
+ ServiceDescriptionPair pair1 = new ServiceDescriptionPair();
+ pair1.setName("test");
+ pair1.setValue("one");
+ serviceDescription.add(pair1);
+ }
+
+ }
+
+ private class TestNotification implements ServiceNotification {
+
+ private int serviceUpdates = 0;
+ private int serviceAway = 0;
+
+ public int getServiceUpdates() {
+ return serviceUpdates;
+ }
+ public int getServiceAway(){
+ return serviceAway;
+ }
+
+ @Override
+ public void onServiceGone(ServiceHealth serviceHealth) {
+ serviceAway++;
+ System.out.println("serviceAway " + serviceAway);
+ }
+
+ @Override
+ public void onServiceUpdate(ServiceHealth serviceHealth) {
+ serviceUpdates++;
+ System.out.println("healthUpdates " + serviceUpdates);
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServicesMultipleConsumers.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServicesMultipleConsumers.java
index 9caeafcce3..e4f83983cf 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServicesMultipleConsumers.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/services/internal/TestMessageServicesMultipleConsumers.java
@@ -8,105 +8,105 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.messaging.services.internal;
-
-import static org.junit.Assert.assertTrue;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import org.eclipse.osee.framework.messaging.ConnectionNode;
-import org.eclipse.osee.framework.messaging.NodeInfo;
-import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
-import org.eclipse.osee.framework.messaging.internal.BaseBrokerTesting;
-import org.eclipse.osee.framework.messaging.internal.TestMessages;
-import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
-
-/**
- * @author Andrew M. Finkbeiner
- *
- */
-public class TestMessageServicesMultipleConsumers extends BaseBrokerTesting implements OseeMessagingStatusCallback {
-
- private static String BROKER_URI_SERVER = "tcp://localhost:61616";
- private static String BROKER_URI = "tcp://localhost:61616";
-
- @org.junit.Before
- public void startBroker(){
- try {
- startEmbeddedBroker("testBroker", BROKER_URI_SERVER);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @org.junit.After
- public void stopBroker(){
- try {
- stopEmbeddedBroker("testBroker", BROKER_URI_SERVER);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @org.junit.Test
- public void testMultipleConsumers() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
-
- List<BasicListener> listeners = new ArrayList<BasicListener>();
- for(int i = 0; i < 20; i++){
- BasicListener listener = new BasicListener(i);
- listeners.add(listener);
- connection.subscribe(TestMessages.JMS_TOPIC, listener, this);
- }
-
- TestMessage message = new TestMessage();
- message.setMessage("TestMessage 1");
- connection.send(TestMessages.JMS_TOPIC, message, this);
-
- testWait(500);
-
- for(BasicListener listener:listeners){
- assertTrue(listener.toString(), listener.isReceived());
- }
- }
-
- @org.junit.Test
- public void testMultipleConsumersWithSelector() throws Exception{
- ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
-
- List<BasicListener> listeners = new ArrayList<BasicListener>();
- for(int i = 0; i < 20; i++){
- BasicListener listener = new BasicListener(i);
- listeners.add(listener);
- connection.subscribe(TestMessages.JMS_TOPIC, listener, String.format("id = %d", i), this);
- }
-
- TestMessage message = new TestMessage();
- message.setMessage("TestMessage 1");
- Properties properties = new Properties();
- properties.put("id", 1);
- connection.send(TestMessages.JMS_TOPIC, message, properties, this);
-
- testWait(500);
-
- int receivedCount = 0;
- for(BasicListener listener:listeners){
- if(listener.isReceived()){
- receivedCount++;
- }
- }
-
- assertTrue(String.format("received %d messages", receivedCount), receivedCount == 1);
- }
-
- @Override
- public void fail(Throwable th) {
- assertTrue(th.getMessage(), false);
- }
-
- @Override
- public void success() {
- }
-
-}
+package org.eclipse.osee.framework.messaging.services.internal;
+
+import static org.junit.Assert.assertTrue;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import org.eclipse.osee.framework.messaging.ConnectionNode;
+import org.eclipse.osee.framework.messaging.NodeInfo;
+import org.eclipse.osee.framework.messaging.OseeMessagingStatusCallback;
+import org.eclipse.osee.framework.messaging.internal.BaseBrokerTesting;
+import org.eclipse.osee.framework.messaging.internal.TestMessages;
+import org.eclipse.osee.framework.messaging.test.msg.TestMessage;
+
+/**
+ * @author Andrew M. Finkbeiner
+ *
+ */
+public class TestMessageServicesMultipleConsumers extends BaseBrokerTesting implements OseeMessagingStatusCallback {
+
+ private static String BROKER_URI_SERVER = "tcp://localhost:61616";
+ private static String BROKER_URI = "tcp://localhost:61616";
+
+ @org.junit.Before
+ public void startBroker(){
+ try {
+ startEmbeddedBroker("testBroker", BROKER_URI_SERVER);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @org.junit.After
+ public void stopBroker(){
+ try {
+ stopEmbeddedBroker("testBroker", BROKER_URI_SERVER);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @org.junit.Test
+ public void testMultipleConsumers() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+
+ List<BasicListener> listeners = new ArrayList<BasicListener>();
+ for(int i = 0; i < 20; i++){
+ BasicListener listener = new BasicListener(i);
+ listeners.add(listener);
+ connection.subscribe(TestMessages.JMS_TOPIC, listener, this);
+ }
+
+ TestMessage message = new TestMessage();
+ message.setMessage("TestMessage 1");
+ connection.send(TestMessages.JMS_TOPIC, message, this);
+
+ testWait(500);
+
+ for(BasicListener listener:listeners){
+ assertTrue(listener.toString(), listener.isReceived());
+ }
+ }
+
+ @org.junit.Test
+ public void testMultipleConsumersWithSelector() throws Exception{
+ ConnectionNode connection = getMessaging().get(new NodeInfo("osee-jms", new URI(BROKER_URI)));
+
+ List<BasicListener> listeners = new ArrayList<BasicListener>();
+ for(int i = 0; i < 20; i++){
+ BasicListener listener = new BasicListener(i);
+ listeners.add(listener);
+ connection.subscribe(TestMessages.JMS_TOPIC, listener, String.format("id = %d", i), this);
+ }
+
+ TestMessage message = new TestMessage();
+ message.setMessage("TestMessage 1");
+ Properties properties = new Properties();
+ properties.put("id", 1);
+ connection.send(TestMessages.JMS_TOPIC, message, properties, this);
+
+ testWait(500);
+
+ int receivedCount = 0;
+ for(BasicListener listener:listeners){
+ if(listener.isReceived()){
+ receivedCount++;
+ }
+ }
+
+ assertTrue(String.format("received %d messages", receivedCount), receivedCount == 1);
+ }
+
+ @Override
+ public void fail(Throwable th) {
+ assertTrue(th.getMessage(), false);
+ }
+
+ @Override
+ public void success() {
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/ObjectFactory.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/ObjectFactory.java
index 18ff904d25..649b066570 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/ObjectFactory.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/ObjectFactory.java
@@ -1,60 +1,60 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.01.24 at 05:48:12 PM MST
-//
-
-
-package org.eclipse.osee.framework.messaging.test.msg;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.eclipse.osee.framework.messaging.test.msg package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _TestMessage_QNAME = new QName("", "TestMessage");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.eclipse.osee.framework.messaging.test.msg
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link TestMessage }
- *
- */
- public TestMessage createTestMessage() {
- return new TestMessage();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link TestMessage }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "", name = "TestMessage")
- public JAXBElement<TestMessage> createTestMessage(TestMessage value) {
- return new JAXBElement<TestMessage>(_TestMessage_QNAME, TestMessage.class, null, value);
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.01.24 at 05:48:12 PM MST
+//
+
+
+package org.eclipse.osee.framework.messaging.test.msg;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.eclipse.osee.framework.messaging.test.msg package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _TestMessage_QNAME = new QName("", "TestMessage");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.eclipse.osee.framework.messaging.test.msg
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link TestMessage }
+ *
+ */
+ public TestMessage createTestMessage() {
+ return new TestMessage();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link TestMessage }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "TestMessage")
+ public JAXBElement<TestMessage> createTestMessage(TestMessage value) {
+ return new JAXBElement<TestMessage>(_TestMessage_QNAME, TestMessage.class, null, value);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/TestMessage.java b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/TestMessage.java
index bcb99017dd..138ff33c41 100644
--- a/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/TestMessage.java
+++ b/plugins/org.eclipse.osee.framework.messaging.test/src/org/eclipse/osee/framework/messaging/test/msg/TestMessage.java
@@ -1,97 +1,97 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2010.01.24 at 05:48:12 PM MST
-//
-
-
-package org.eclipse.osee.framework.messaging.test.msg;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for TestMessage complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="TestMessage">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;element name="anotherMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "TestMessage", propOrder = {
- "message",
- "anotherMessage"
-})
-public class TestMessage {
-
- @XmlElement(required = true)
- protected String message;
- @XmlElement(required = true)
- protected String anotherMessage;
-
- /**
- * Gets the value of the message property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMessage(String value) {
- this.message = value;
- }
-
- /**
- * Gets the value of the anotherMessage property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getAnotherMessage() {
- return anotherMessage;
- }
-
- /**
- * Sets the value of the anotherMessage property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setAnotherMessage(String value) {
- this.anotherMessage = value;
- }
-
-}
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.01.24 at 05:48:12 PM MST
+//
+
+
+package org.eclipse.osee.framework.messaging.test.msg;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for TestMessage complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * &lt;complexType name="TestMessage">
+ * &lt;complexContent>
+ * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * &lt;sequence>
+ * &lt;element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;element name="anotherMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * &lt;/sequence>
+ * &lt;/restriction>
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TestMessage", propOrder = {
+ "message",
+ "anotherMessage"
+})
+public class TestMessage {
+
+ @XmlElement(required = true)
+ protected String message;
+ @XmlElement(required = true)
+ protected String anotherMessage;
+
+ /**
+ * Gets the value of the message property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the value of the message property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMessage(String value) {
+ this.message = value;
+ }
+
+ /**
+ * Gets the value of the anotherMessage property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAnotherMessage() {
+ return anotherMessage;
+ }
+
+ /**
+ * Sets the value of the anotherMessage property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAnotherMessage(String value) {
+ this.anotherMessage = value;
+ }
+
+}

Back to the top