You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2011/10/27 21:41:44 UTC
svn commit: r1189967 [1/2] - in /incubator/airavata/trunk/modules:
commons/workflow-tracking/
commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/
commons/workflow-tracking/src/test/resources/ test-suite/src/test/java/or...
Author: lahiru
Date: Thu Oct 27 19:41:43 2011
New Revision: 1189967
URL: http://svn.apache.org/viewvc?rev=1189967&view=rev
Log:
moving tests in to test-suite.
Added:
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadCallbackHandlerTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadNotificationManagerTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/MultipleSubscriptionTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/RenewSubscriptionTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/ThreadMessagePassingCallback.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/Test.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/TestWSMPublisher.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MessagePullerTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/RenewSubscriptionTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/SubscriberThread.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxClientRestartTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxCreateThread.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleTest.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleWorkflowExecution.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/WorkflowNotificationListener.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/util/
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/util/CommonUtils.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/util/SubscriberThread.java
incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/util/TestConfigKeys.java
incubator/airavata/trunk/modules/test-suite/src/test/resources/unit_test.properties
- copied unchanged from r1189936, incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/resources/unit_test.properties
Removed:
incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/
incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/resources/unit_test.properties
Modified:
incubator/airavata/trunk/modules/commons/workflow-tracking/pom.xml
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/pom.xml?rev=1189967&r1=1189966&r2=1189967&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/pom.xml (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/pom.xml Thu Oct 27 19:41:43 2011
@@ -86,7 +86,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <skipTests>true</skipTests>
+ <skipTests>false</skipTests>
</configuration>
</plugin>
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadCallbackHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadCallbackHandlerTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadCallbackHandlerTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadCallbackHandlerTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,173 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.CommonUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMElement;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.*;
+
+public class LeadCallbackHandlerTest extends TestCase {
+
+ Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ String AXIS_REPO;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ AXIS_REPO = configs.getProperty(TestConfigKeys.AXIS2_REPO);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ boolean wait = false;
+ int repetition = 3;
+ private Subscription subscription;
+
+ class TestMsgCallback implements Callback {
+
+ public TestMsgCallback(int reps) {
+ repititions = reps;
+ }
+
+ BlockingQueue<Boolean> msgQueue = new LinkedBlockingQueue<Boolean>();
+ int count = 0;
+ int repititions;
+
+ public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+
+ count++;
+ System.out.println("Subscription received " + count + "th notification of type:");
+ if (repititions <= count) {
+ msgQueue.add(new Boolean(true));
+ }
+
+ }
+
+ public BlockingQueue<Boolean> getQueue() {
+ return msgQueue;
+ }
+
+ }
+
+ @Test
+ public void testRoundTrip() throws Exception {
+ wait = true;
+
+ TestMsgCallback c1 = new TestMsgCallback(repetition);
+ TestMsgCallback c2 = new TestMsgCallback(repetition);
+
+ subscription = LeadNotificationManager.createSubscription(BROKER_URL, "topic", c1, consumerPort);
+ Thread.sleep(100);
+ Subscription subscription2 = LeadNotificationManager.createSubscription(BROKER_URL, "topic", c2,
+ consumerPort + 1);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+ client.setTimeoutInMilliSeconds(20000L);
+
+ OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+ for (int i = 0; i < repetition; i++) {
+ client.publish("topic", msg);
+ Thread.sleep(100);
+ }
+
+ Boolean b1 = c1.getQueue().take();
+ Boolean b2 = c2.getQueue().take();
+
+ System.out.println(b1);
+ System.out.println(b2);
+
+ subscription.destroy();
+ subscription2.destroy();
+
+ }
+
+ @Test
+ public void testRoundTripWithDifferentTopics() throws Exception {
+ wait = true;
+
+ TestMsgCallback c1 = new TestMsgCallback(repetition);
+ TestMsgCallback c2 = new TestMsgCallback(repetition);
+
+ subscription = LeadNotificationManager.createSubscription(BROKER_URL, "topic10", c1, consumerPort);
+ Subscription subscription2 = LeadNotificationManager.createSubscription(BROKER_URL, "topic20", c2,
+ consumerPort + 1);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+ for (int i = 0; i < repetition; i++) {
+ client.publish("topic10", msg);
+ Thread.sleep(100);
+ }
+
+ for (int i = 0; i < repetition; i++) {
+ client.publish("topic20", msg);
+ Thread.sleep(100);
+ }
+
+ Boolean b1 = c1.getQueue().take();
+ Boolean b2 = c2.getQueue().take();
+
+ System.out.println(b1);
+ System.out.println(b2);
+
+ subscription2.destroy();
+ subscription.destroy();
+ }
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadNotificationManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadNotificationManagerTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadNotificationManagerTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/LeadNotificationManagerTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests;
+
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class LeadNotificationManagerTest {
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public final void testGetBrokerPublishEPR() {
+
+ String endpointRefAsStr = LeadNotificationManager.getBrokerPublishEPR("http://brokerurl", "testtopic");
+
+ System.out.println(endpointRefAsStr);
+
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/MultipleSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/MultipleSubscriptionTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/MultipleSubscriptionTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/MultipleSubscriptionTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.test.suite.workflowtracking.tests.util.CommonUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.SubscriberThread;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+public class MultipleSubscriptionTest extends TestCase implements ThreadMessagePassingCallback {
+
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final int NOTIFICATIONS_PUBLISHED = 4;
+ public static final int NUMBER_OF_SUBSCRIBERS = 4;
+ private int succesfulclients = 0;
+ String AXIS_REPO;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ AXIS_REPO = configs.getProperty(TestConfigKeys.AXIS2_REPO);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ public void testMultipleSubscribers() throws Exception {
+
+ SubscriberThread[] subscribers = new SubscriberThread[NUMBER_OF_SUBSCRIBERS];
+ for (int i = 0; i < NUMBER_OF_SUBSCRIBERS; ++i) {
+ subscribers[i] = new SubscriberThread(this, BROKER_URL, "topic" + i, consumerPort + i);
+ subscribers[i].start();
+
+ }
+
+ Thread.sleep(5000);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ for (int j = 0; j < NUMBER_OF_SUBSCRIBERS; j++) {
+ for (int i = 0; i < NOTIFICATIONS_PUBLISHED; i++) {
+
+ client.publish("topic" + j, CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION);
+
+ Thread.sleep(100);
+ }
+ }
+
+ while (succesfulclients < NUMBER_OF_SUBSCRIBERS) {
+ Thread.sleep(1000);
+ }
+
+ }
+
+ public void done() {
+ System.out.println("Done Multiple subscription test");
+ succesfulclients++;
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/RenewSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/RenewSubscriptionTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/RenewSubscriptionTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/RenewSubscriptionTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,155 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests;
+
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.MsgBrokerClientException;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.*;
+
+public class RenewSubscriptionTest extends TestCase implements Callback {
+
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final String TOPIC = "testTopic";
+ private static final String MESSAGE_BOX_ID = "929799u028887273u9899400999999";
+ public static int count = 0;
+ public int messages = 10;
+ public static Object mutex = new Object();
+ Subscription sub;
+ String AXIS_REPO;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ // AXIS_REPO=configs.getProperty(TestConfigKeys.AXIS2_REPO);
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRenewSubscriptionTest() throws Exception {
+
+ String brokerPublishEPR = null;
+
+ sub = LeadNotificationManager
+ .createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TOPIC, null, this, false);
+
+ brokerPublishEPR = sub.getBrokerURL();
+ System.out.println(brokerPublishEPR);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(brokerPublishEPR);
+
+ OMElement msg = OMAbstractFactory.getOMFactory().createOMElement("testMessage", null);
+ msg.setText("some message");
+ client.publish(TOPIC, msg);
+
+ Thread.sleep(10000);
+ for (int i = 0; i < messages; ++i) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ try {
+ sub = LeadNotificationManager.renewMessageboxSubscription(BROKER_URL, sub.getMessageBoxEPR(),
+ sub.getSubscriptionID(), TOPIC, null, false);
+ } catch (AxisFault e) {
+ e.printStackTrace();
+ }
+ }
+
+ Thread.sleep(10000);
+
+ for (int i = 0; i < messages; ++i) {
+ client.publish(TOPIC, msg);
+
+ Thread.sleep(100);
+
+ }
+
+ while (true) {
+
+ Thread.sleep(1000);
+
+ }
+ }
+
+ public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+ System.out.println(messageObj.toString());
+ System.out.println("A message received by handler correctly");
+ synchronized (mutex) {
+ count++;
+ }
+ if (count == messages + 1) {
+ try {
+ sub.destroy();
+ } catch (RemoteException e1) {
+ e1.printStackTrace();
+ }
+ System.out.println("Destroyed");
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+ try {
+ client.publish(TOPIC, "some message");
+ } catch (MsgBrokerClientException e) {
+ e.printStackTrace();
+ }
+ }
+
+ System.out.println(count + " <=" + (messages + 1));
+
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/ThreadMessagePassingCallback.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/ThreadMessagePassingCallback.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/ThreadMessagePassingCallback.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/ThreadMessagePassingCallback.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,27 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests;
+
+public interface ThreadMessagePassingCallback {
+
+ public void done();
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/Test.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/Test.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/Test.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/Test.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.impl.publish;
+
+import org.apache.airavata.workflow.tracking.types.BaseNotificationType;
+import org.apache.airavata.workflow.tracking.types.WorkflowInitializedDocument;
+import org.apache.xmlbeans.XmlCursor;
+
+public class Test {
+ public static void main(String[] args) {
+ WorkflowInitializedDocument activity = WorkflowInitializedDocument.Factory.newInstance();
+ BaseNotificationType activityType = activity.addNewWorkflowInitialized();
+
+ XmlCursor c = activity.newCursor();
+ c.toNextToken();
+
+ System.out.println(c.getObject().getClass());
+
+ System.out.println(((BaseNotificationType) c.getObject()).getDescription());
+ }
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/TestWSMPublisher.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/TestWSMPublisher.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/TestWSMPublisher.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/impl/publish/TestWSMPublisher.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,119 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.impl.publish;
+
+import java.io.IOException;
+
+import org.apache.airavata.workflow.tracking.impl.publish.WSMPublisher;
+import org.apache.axis2.addressing.EndpointReference;
+import org.junit.*;
+
+public class TestWSMPublisher {
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @org.junit.Test
+ public final void testWSMPublisherConstructor1() {
+
+ EndpointReference brokerEpr = new EndpointReference("http://invalid/broker/address");
+ WSMPublisher publisher = new WSMPublisher(10, false, brokerEpr);
+
+ }
+
+ @org.junit.Test
+ public final void testWSMPublisherConstructor2() {
+
+ try {
+ WSMPublisher publisher = new WSMPublisher(10, false, "http://invalid/broker/address", "TestTopic1");
+
+ } catch (IOException e) {
+ // fail("Test failed");
+ }
+
+ }
+
+ @org.junit.Test
+ public final void testWSMPublisherConstructor3() {
+ try {
+
+ EndpointReference epr = new EndpointReference("http://invalid/broker/address");
+
+ WSMPublisher publisher = new WSMPublisher(10, false, epr.getAddress());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ // fail();
+ }
+ }
+
+ @org.junit.Test
+ public final void testWSMPublisherConstructor4() {
+ try {
+
+ EndpointReference epr = new EndpointReference("http://invalid/broker/address");
+
+ // According to addressing format.
+ String eprFormat = "<BrokerEPR><wsa:Address xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">%s</wsa:Address></BrokerEPR>";
+
+ String str = String.format(eprFormat, "http://invalid/broker/address");
+
+ WSMPublisher publisher = new WSMPublisher(10, false, str, true);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ // fail();
+ }
+ }
+
+ @org.junit.Test
+ public final void testWSMPublisherConstructor5() {
+ // try {
+ //
+ // EndpointReference epr = new EndpointReference(
+ // "http://invalid/broker/address");
+ //
+ // AnnotationProps annotationProps = AnnotationProps.newProps(
+ // AnnotationConsts.ExperimentID, "TestexperId1");
+ // annotationProps.set(AnnotationConsts.ServiceLocation,
+ // "testServiceAddress");
+ //
+ // ConstructorProps props = ConstructorProps.newProps();
+ // props.set(ConstructorConsts.BROKER_EPR, epr.getAddress());
+ // props.set(ConstructorConsts.ENABLE_ASYNC_PUBLISH, "false");
+ // props.set(ConstructorConsts.ENABLE_BATCH_PROVENANCE, "false");
+ // props.set(ConstructorConsts.ANNOTATIONS, annotationProps);
+ //
+ // Notifier notifier = NotifierFactory.createGenericNotifier();
+ //
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // fail();
+ // }
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MessagePullerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MessagePullerTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MessagePullerTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MessagePullerTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.CommonUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MessagePullerTest extends TestCase {
+
+ private static final Logger logger = LoggerFactory.getLogger(MessagePullerTest.class);
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+ private static final String MESSAGE_BOX_ID = UUID.randomUUID().toString();
+ public static int count = 0;
+ public int messages = 10;
+ public static Object mutex = new Object();
+
+ Subscription sub;
+ String AXIS_REPO;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ private boolean wait = true;
+
+ public void testMessagePulling() throws Exception {
+ Subscription subscription = null;
+
+ Callback testCallback1 = new Callback() {
+ public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+ System.out.println("Notification Received, notification of type:" + type);
+ // assertEquals(type, NotificationType.WorkflowInitialized);
+ wait = false;
+ }
+ };
+
+ subscription = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC,
+ null, testCallback1);
+
+ System.out.println(subscription.getMessageBoxEPR());
+ System.out.println(subscription.getSubscriptionID());
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+ client.publish(TEST_TOPIC, msg);
+
+ EndpointReference MSG_BOX_EPR = subscription.getMessageBoxEPR();
+ System.out.println(MSG_BOX_EPR);
+ String subscriptionID = subscription.getSubscriptionID();
+ Callback testCallback2 = new Callback() {
+
+ public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+ System.out.println("Notification Received, notification of type:" + type);
+ // This assertion is wrong because type and NotificationType.WorkflowInitialized are two different types
+ // assertEquals(type, NotificationType.WorkflowInitialized);
+ wait = false;
+
+ }
+ };
+ subscription = LeadNotificationManager.startListeningToSavedSubscription(BROKER_URL, MSG_BOX_EPR,
+ subscriptionID, TEST_TOPIC, null, testCallback2, true);
+
+ System.out.println(subscription.getMessageBoxEPR());
+
+ while (wait) {
+
+ Thread.sleep(1000);
+
+ }
+
+ System.out.println("MessagePuller test completed");
+ subscription.destroy();
+ }
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/MultipleSubscriptionForMessageBoxTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.ThreadMessagePassingCallback;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.CommonUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMElement;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MultipleSubscriptionForMessageBoxTest extends TestCase implements ThreadMessagePassingCallback {
+
+ private static final Logger logger = LoggerFactory.getLogger(MultipleSubscriptionForMessageBoxTest.class);
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+ public static final int NOTIFICATIONS_PUBLISHED = 10;
+ public static final int NUMBER_OF_SUBSCRIBERS = 1;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ private int succesfulclients = 0;
+
+ @Test
+ public void testMultipleSubscribers() throws Exception {
+
+ SubscriberThread[] subscribers = new SubscriberThread[NUMBER_OF_SUBSCRIBERS];
+ for (int i = 0; i < NUMBER_OF_SUBSCRIBERS; ++i) {
+ subscribers[i] = new SubscriberThread(MESSAGEBOX_URL, BROKER_URL, TEST_TOPIC, this, "MytestId331234"
+ + Integer.toString(i));
+ subscribers[i].start();
+
+ }
+
+ Thread.sleep(100);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+ for (int j = 0; j < NUMBER_OF_SUBSCRIBERS; j++) {
+ for (int i = 0; i < NOTIFICATIONS_PUBLISHED; i++) {
+
+ client.publish(TEST_TOPIC, msg);
+
+ Thread.sleep(100);
+ }
+ }
+
+ while (succesfulclients < NUMBER_OF_SUBSCRIBERS - 1) {
+ Thread.sleep(1000);
+ }
+ Thread.sleep(5000);
+ System.out.println("All successful");
+ System.exit(0);
+
+ }
+
+ public void done() {
+ succesfulclients++;
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/RenewSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/RenewSubscriptionTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/RenewSubscriptionTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/RenewSubscriptionTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,109 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.*;
+
+public class RenewSubscriptionTest extends TestCase implements Callback {
+
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final String TEST_TOPIC = "3a9c7b20-0475-11db-ba88-b61b57d3be03";
+ public static int count = 0;
+ public int messages = 10;
+ public static Object mutex = new Object();
+ Subscription sub;
+ private static String TOPIC = "RENEW_TOPIC" + Math.random();
+ private static int counter = 0;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRenewSubscription() throws Exception {
+ Subscription sub = LeadNotificationManager.createMessageBoxSubscription(MESSAGEBOX_URL, BROKER_URL, TOPIC,
+ null, this, false);
+
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ OMElement msg = OMAbstractFactory.getOMFactory().createOMElement("test", null);
+ msg.setText("mustwork");
+ client.publish(TOPIC, msg);
+ // sub.destroy();
+
+ msg.setText("destroyed");
+ client.publish(TOPIC, msg);
+ Subscription sub2 = LeadNotificationManager.renewMessageboxSubscription(BROKER_URL, sub.getMessageBoxEPR(),
+ sub.getSubscriptionID(), TOPIC, null, false);
+
+ msg.setText("mustworkagain");
+ client.publish(TOPIC, msg);
+
+ System.out.println(sub2.getSubscriptionID());
+ while (counter < 2) {
+ Thread.sleep(1000);
+ }
+ Thread.sleep(10000);
+ }
+
+ public void deliverMessage(String topic, NotificationType notificationType, XmlObject messageObj) {
+ System.out.println("Callbacked");
+ System.out.println(messageObj.toString());
+ counter++;
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/SubscriberThread.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/SubscriberThread.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/SubscriberThread.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/SubscriberThread.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,96 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox;
+
+import java.rmi.RemoteException;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.ThreadMessagePassingCallback;
+import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SubscriberThread extends Thread {
+
+ private static final Logger logger = LoggerFactory.getLogger(SubscriberThread.class);
+ private ThreadMessagePassingCallback callback;
+
+ private int subCount = 0;
+ private Subscription subscription;
+ private String brokerURL;
+ private String topic;
+ private String messageboxUrl;
+ private String msgBoxId;
+
+ public SubscriberThread(String messageboxUrl, String brokerURL, String topic,
+ ThreadMessagePassingCallback callback, String msgBoxId) {
+ super();
+ this.msgBoxId = msgBoxId;
+ this.callback = callback;
+ this.brokerURL = brokerURL;
+ this.topic = topic;
+ this.messageboxUrl = messageboxUrl;
+ }
+
+ @Override
+ public void run() {
+ try {
+ subscription = LeadNotificationManager.createMessageBoxSubscription(messageboxUrl, brokerURL, topic, null,
+ new Callback() {
+
+ public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+ subCount++;
+ System.out.println("Subscription received " + subCount + "th notification of type:" + type);
+ assert (type == NotificationType.WorkflowInitialized);
+ System.out.println("subcount=" + subCount + " =="
+ + MultipleSubscriptionForMessageBoxTest.NOTIFICATIONS_PUBLISHED);
+ if (subCount == MultipleSubscriptionForMessageBoxTest.NOTIFICATIONS_PUBLISHED) {
+ System.out.println("subscription destroyed");
+ try {
+ subscription.destroy();
+ } catch (RemoteException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ callback.done();
+ }
+ }
+ }, true);
+ } catch (Exception e) {
+ logger.error("exception in suscriber thread :" + e);
+ e.printStackTrace();
+ }
+ while (true) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ logger.error("exception in suscriber thread sleep: " + e);
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxClientRestartTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxClientRestartTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxClientRestartTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxClientRestartTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox.restart;
+
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.airavata.commons.WorkFlowUtils;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.CommonUtils;
+import org.apache.airavata.test.suite.workflowtracking.tests.util.TestConfigKeys;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.impl.tool.XSTCTester.TestCase;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MessageBoxClientRestartTest extends TestCase {
+
+ private static final Logger logger = LoggerFactory.getLogger(MessageBoxClientRestartTest.class);
+ private static final String TOPIC = "RestartclientTopic2";
+ private boolean wait = true;
+ static Properties configs = new Properties();
+ String BROKER_URL;
+ String MESSAGEBOX_URL;
+ int consumerPort;
+ public static final int NOTIFICATIONS_PUBLISHED = 4;
+ public static final int NUMBER_OF_SUBSCRIBERS = 4;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ URL configURL = ClassLoader.getSystemResource(TestConfigKeys.CONFIG_FILE_NAME);
+ configs.load(configURL.openStream());
+ BROKER_URL = configs.getProperty(TestConfigKeys.BROKER_EVENTING_SERVICE_EPR);
+ MESSAGEBOX_URL = configs.getProperty(TestConfigKeys.MSGBOX_SERVICE_EPR);
+ consumerPort = Integer.parseInt(configs.getProperty(TestConfigKeys.CONSUMER_PORT));
+
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRestart() throws Exception {
+ Subscription subscription = null;
+
+ MessageBoxCreateThread thread = new MessageBoxCreateThread(BROKER_URL, MESSAGEBOX_URL, TOPIC);
+ thread.start();
+
+ Thread.sleep(100);
+ thread.stop();
+
+ Thread.sleep(5000);
+
+ System.out.println("bringing down the Puller\n Publishing Messages");
+ WseMsgBrokerClient client = new WseMsgBrokerClient();
+ client.init(BROKER_URL);
+
+ OMElement msg = WorkFlowUtils.reader2OMElement(new StringReader(CommonUtils.WORKFLOW_INITIALIZED_NOTIFICATION));
+
+ client.publish(TOPIC, msg);
+
+ System.out.println("Messages published");
+ System.out.println("Creating another puller");
+ EndpointReference epr = thread.getWsaEndpointReference();
+ String subscriptionID = thread.getSubscriptionID();
+ String topic = thread.getTopic();
+ System.out.println(epr);
+ System.out.println(subscriptionID);
+
+ subscription = LeadNotificationManager.startListeningToSavedSubscription(BROKER_URL, epr, subscriptionID,
+ topic, null, new Callback() {
+
+ public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+ System.out.println("Notification Received, notification of type:" + type);
+ System.out.println("Topic[" + topic + "]");
+ // assertEquals(type, NotificationType.WorkflowInitialized);
+ wait = false;
+
+ }
+ }, false);
+
+ System.out.println(subscription.getMessageBoxEPR());
+
+ while (wait) {
+ Thread.sleep(1000);
+
+ }
+ }
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxCreateThread.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxCreateThread.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxCreateThread.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/messagebox/restart/MessageBoxCreateThread.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,83 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.messagebox.restart;
+
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.LeadNotificationManager;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+import org.apache.airavata.workflow.tracking.client.Subscription;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MessageBoxCreateThread extends Thread {
+
+ private static final Logger logger = LoggerFactory.getLogger(MessageBoxCreateThread.class);
+ private String brokerLocation;
+ private String messageboxLocation;
+ private String topic;
+ private Subscription subscription;
+
+ public MessageBoxCreateThread(String brokerLocation, String messageboxLocation, String topic) {
+ super();
+ this.brokerLocation = brokerLocation;
+ this.messageboxLocation = messageboxLocation;
+ this.topic = topic;
+
+ }
+
+ @Override
+ public void run() {
+ Subscription subscription = null;
+ try {
+ subscription = LeadNotificationManager.createMessageBoxSubscription(this.messageboxLocation,
+ this.brokerLocation, this.topic, null, new Callback() {
+
+ public void deliverMessage(String topic, NotificationType type, XmlObject messageObj) {
+
+ throw new RuntimeException("This piece of code probably shouldnt have been called");
+
+ }
+ }, true);
+
+ System.out.println("Created messageBox");
+ } catch (Exception e1) {
+ logger.error("error in message box creat thread :" + e1);
+ e1.printStackTrace();
+ }
+ this.subscription = subscription;
+ }
+
+ public String getSubscriptionID() {
+ return this.subscription.getSubscriptionID();
+ }
+
+ public EndpointReference getWsaEndpointReference() {
+ return this.subscription.getMessageBoxEPR();
+ }
+
+ public String getTopic() {
+ return this.subscription.getTopic();
+ }
+
+}
Added: incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleTest.java?rev=1189967&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleTest.java (added)
+++ incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/workflowtracking/tests/samples/workflow/SimpleTest.java Thu Oct 27 19:41:43 2011
@@ -0,0 +1,243 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.test.suite.workflowtracking.tests.samples.workflow;
+
+/**
+ * Simple test that generates notifications from the perspective of an application (e.g. Jython script or web service)
+ * or a Workflow engine. The following 1 service workflow is simulated:
+ *
+ * <pre>
+ * ................ ________
+ * ........001 --->| |---> XXXX
+ * ................| FuBar1 |
+ * ........002 --->|________|---> YYYY
+ * </pre>
+ *
+ */
+public class SimpleTest {
+
+ // public static long runWorkflowEngine(Notifier notifier, int count) throws Exception {
+ //
+ // Timer t = Timer.initAndStart("wfEngine");
+ // for (int i=0; i < count; i++) {
+ //
+ // // start running the workflow
+ // notifier.workflowInvoked(
+ // // optional input param names to workflow
+ // new String[]{"dataFileID", "confFileURL"},
+ // // optional input param values to workflow
+ // new String[]{"leadId:dgk8634yas", "gridftp://tempuri.org/conf.txt"}
+ // );
+ //
+ // // start to invoke a service
+ // ServiceObj svcObj =
+ // notifier.invokeServiceStarted(
+ // // optional input param names to service
+ // new String[]{"dataFileID", "confFileURL"},
+ // // optional input param values to service
+ // new String[]{"leadId:dgk8634yas", "gridftp://tempuri.org/conf.txt"},
+ // "Node1", // node ID in workflow
+ // "step1", // timestep in workflow execution
+ // "{http://foobar.org}FuBar1" // Servce QName
+ // );
+ //
+ // // invocation returned successfully
+ // notifier.serviceFinishedSuccess(svcObj);
+ //
+ // // OR invocation failed
+ // // notifier.serviceFinishedFailed(svcObj, "service failed");
+ //
+ // // workflow completed successfully
+ // notifier.workflowFinishedSuccess();
+ //
+ // // OR workflow failed
+ // // notifier.workflowFinishedFailed("i failed!");
+ //
+ // // Done with workflow. call flush to ensure messages are sent...
+ // notifier.flush();
+ // }
+ //
+ // return t.end("done: " + count);
+ // }
+ //
+ // public static long runService(Notifier notifier, int count) throws Exception {
+ //
+ // String done = "done " + count;
+ // Timer t = Timer.initAndStart("service"); // start timer
+ // for (int i=0; i < count; i++) {
+ //
+ // // APP STARTS
+ // notifier.serviceInvoked("FuBarApp1"); // we can optionally pass the input params & values too
+ //
+ // // START TO RECEIVE A FILE
+ // DataObj fileObj =
+ // notifier.fileReceiveStarted("leadId-001", // leadID
+ // "gridftp://remotehost.org/foo.dat", // remote file source
+ // "/data/tmp/foo.dat"); // local file destination
+ // /* APP DOES FILE TRANSFER ... */
+ // // DONE RECEIVING FILE
+ // notifier.fileReceiveFinished(fileObj);
+ //
+ // // THE RECEIVED FILE WILL BE CONSUMED IN A COMPUTATION
+ // // ALONG WITH ANOTHER LOCAL FILE
+ // notifier.dataConsumed(fileObj);
+ // notifier.dataConsumed("leadId-002", "/etc/app/config/foo.cfg");
+ //
+ // // send info message on some processing
+ // int runs = 2;
+ // notifier.info("i'm going to use input file for " + runs + " number of WRF runs ...");
+ //
+ // // START COMPUTATION RUNS
+ // for (int j=0; j < runs; j++) {
+ // // START COMPUTATION
+ // DurationObj compObj = notifier.computationStarted("WRF Run");
+ // /* APP DOES COMPUTATION ... */
+ // // FINISHED COMPUTATION
+ // notifier.computationFinished(compObj);
+ // }
+ //
+ // // NOTIFY THAT A FILE WAS PRODUCED
+ // DataObj fileObj2 = notifier.fileProduced("/data/tmp/output/bar.dat");
+ //
+ // // START SENDING OUTPUT FILE TO REMOTE LOCATION
+ // notifier.fileSendStarted(fileObj2, "gridftp://remotehost.org/bar.dat");
+ // /* APP DOES FILE TRANSFER ... */
+ // // DONE SENDING FILE
+ // notifier.fileSendFinished(fileObj2);
+ //
+ // // PUBLISH THE OUTPUT FILE URL AS MESSAGE FOR VIZ
+ // notifier.publishURL("Output visualization", "http://localhost/" + fileObj2.getLocalLocation());
+ //
+ // // APPLICATION COMPLETES
+ // notifier.sendingResult(null, null);
+ //
+ // // DONE SENDING NOTIFICATIONS. CALL FLUSH TO ENSURE ALL MESSAGES HAVE BEEN PUBLISHED...
+ // notifier.flush();
+ // }
+ // return t.end(done); // end timer
+ //
+ // }
+ //
+ // public static void main(String[] args) throws Exception {
+ //
+ // System.out.println("USAGE: java SimpleTest [service | engine] <iterations>");
+ //
+ // boolean runAsEngine = "engine".equalsIgnoreCase(args[0]); // run test as if from workflow engine
+ // boolean runAsService = "service".equalsIgnoreCase(args[0]); // run test as if from application service
+ // if (!runAsEngine && !runAsService) {
+ // throw new Exception("pass either 'service' or 'engine' as param");
+ // }
+ //
+ //
+ // int count = 1;
+ // try {
+ // count = Integer.parseInt(args[1]);
+ // } catch (NumberFormatException e) {
+ // // ignore and use count = 1
+ // }
+ //
+ // System.out.println("Running as : " + (runAsEngine ? "ENGINE" : "SERVICE") +
+ // " for " + count + " iterations");
+ //
+ // // create the properties constructor...see CONSTS.java for more options
+ // // Passing System.getProperties() ensures that any system properties that are set are
+ // // carried over into the constructor
+ // Props props =
+ // //Props.newProps(System.getProperties()).
+ // Props.newProps("properties.xml").
+ // set(CONSTS.WORKFLOW_ID, "wf100201").
+ // set(CONSTS.ENABLE_NAME_RESOLVER, "false").
+ // // set(NAME_RESOLVER_URL, ""). // since name resolver is disabled, we do not need URL
+ // //set(IN_XML_MESSAGE, ""). // pass the incoming SOAP message if async response to sender required
+ // set(CONSTS.BROKER_URL, "rainier.extreme.indiana.edu:12346").
+ // set(CONSTS.TOPIC, "somerandomtopic");
+ //
+ // // when running from the service perspective, additional attributes are need
+ // // ...not needed when running as workflow engine
+ // if (runAsService) {
+ // props.
+ // /* either this service's QName should be passed as SERVICE_ID or */
+ // /* its WSDL should be passed as SERVICE_WSDL to extract its QName */
+ // set(CONSTS.SERVICE_ID, "{http://foobar.org}FuBar1").
+ // //set(CONSTS.SERVICE_WSDL, "<wsdl:definitions/>").
+ // set(CONSTS.NODE_ID, "N1").
+ // set(CONSTS.TIMESTEP, "1");
+ // }
+ //
+ // // creates the default notifier and passes above properties to it as parameters
+ // Notifier notifier = NotifierFactory.createNotifier(props);
+ //
+ // long time = -1;
+ // if (runAsService) {
+ // time = runService(notifier, count);
+ //
+ // }
+ //
+ // if (runAsEngine) {
+ // time = runWorkflowEngine(notifier, count);
+ // }
+ //
+ // System.out.println("Done in " + time + " millis");
+ // }
+}
+
+/*
+ * Indiana University Extreme! Lab Software License, Version 1.2
+ *
+ * Copyright (C) 2004 The Trustees of Indiana University. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * 1) All redistributions of source code must retain the above copyright notice, the list of authors in the original
+ * source code, this list of conditions and the disclaimer listed in this license;
+ *
+ * 2) All redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
+ * disclaimer listed in this license in the documentation and/or other materials provided with the distribution;
+ *
+ * 3) Any documentation included with all redistributions must include the following acknowledgement:
+ *
+ * "This product includes software developed by the Indiana University Extreme! Lab. For further information please
+ * visit http://org.apache.airavata/"
+ *
+ * Alternatively, this acknowledgment may appear in the software itself, and wherever such third-party acknowledgments
+ * normally appear.
+ *
+ * 4) The name "Indiana University" or "Indiana University Extreme! Lab" shall not be used to endorse or promote
+ * products derived from this software without prior written permission from Indiana University. For written permission,
+ * please contact http://org.apache.airavata/.
+ *
+ * 5) Products derived from this software may not use "Indiana University" name nor may "Indiana University" appear in
+ * their name, without prior written permission of the Indiana University.
+ *
+ * Indiana University provides no reassurances that the source code provided does not infringe the patent or any other
+ * intellectual property rights of any other entity. Indiana University disclaims any liability to any recipient for
+ * claims brought by any other entity based on infringement of intellectual property rights or otherwise.
+ *
+ * LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE
+ * MADE. INDIANA UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT SOFTWARE IS FREE OF INFRINGEMENT OF
+ * THIRD PARTY PATENT, COPYRIGHT, OR OTHER PROPRIETARY RIGHTS. INDIANA UNIVERSITY MAKES NO WARRANTIES THAT SOFTWARE IS
+ * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", OR OTHER HARMFUL CODE. LICENSEE ASSUMES THE
+ * ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
+ * INFORMATION GENERATED USING SOFTWARE.
+ */
+