You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/07/12 04:34:41 UTC
[3/9] introducing workflow support in airavata api + other related
modules
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/main/resources/wsdls/eventing.wsdl
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/main/resources/wsdls/eventing.wsdl b/modules/workflow-model/workflow-engine/src/main/resources/wsdls/eventing.wsdl
new file mode 100644
index 0000000..ac33777
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/main/resources/wsdls/eventing.wsdl
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--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. -->
+
+<wsdl:definitions targetNamespace='http://schemas.xmlsoap.org/ws/2004/08/eventing' xmlns:wse='http://schemas.xmlsoap.org/ws/2004/08/eventing'
+ xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+
+ <wsdl:types>
+
+ <xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:tns="http://schemas.xmlsoap.org/ws/2004/08/eventing"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" blockDefault="#all">
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
+
+ <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing" />
+
+ <!-- Types and global elements -->
+ <xs:complexType name="DeliveryType" mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="Mode" type="xs:anyURI" use="optional" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+
+ <xs:element name="NotifyTo" type="wsa:EndpointReferenceType" />
+
+ <xs:simpleType name="NonNegativeDurationType">
+ <xs:restriction base="xs:duration">
+ <xs:minInclusive value="P0Y0M0DT0H0M0S" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="ExpirationType">
+ <xs:union memberTypes="xs:dateTime tns:NonNegativeDurationType" />
+ </xs:simpleType>
+
+ <xs:complexType name="FilterType" mixed="true">
+ <xs:sequence>
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="Dialect" type="xs:anyURI" use="optional" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+
+ <xs:complexType name="LanguageSpecificStringType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <!-- Subscribe request -->
+ <xs:element name="Subscribe">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="EndTo" type="wsa:EndpointReferenceType" minOccurs="0" />
+ <xs:element name="Delivery" type="tns:DeliveryType" />
+ <xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+ <xs:element name="Filter" type="tns:FilterType" minOccurs="0" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Identifier" type="xs:anyURI" />
+
+ <!-- Subscribe response -->
+ <xs:element name="SubscribeResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="SubscriptionManager" type="wsa:EndpointReferenceType" />
+ <xs:element name="Expires" type="tns:ExpirationType" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Used in a fault if there's an unsupported dialect -->
+ <xs:element name="SupportedDialect" type="xs:anyURI" />
+
+ <!-- Used in a fault if there's an unsupported delivery mode -->
+ <xs:element name="SupportedDeliveryMode" type="xs:anyURI" />
+
+ <!-- Renew request -->
+ <xs:element name="Renew">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Renew response -->
+ <xs:element name="RenewResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- GetStatus request -->
+ <xs:element name="GetStatus">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- GetStatus response -->
+ <xs:element name="GetStatusResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Unsubscribe request -->
+ <xs:element name="Unsubscribe">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- count(/s:Envelope/s:Body/*) = 0 for Unsubscribe response -->
+
+ <!-- SubscriptionEnd message -->
+ <xs:element name="SubscriptionEnd">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="SubscriptionManager" type="wsa:EndpointReferenceType" />
+ <xs:element name="Status" type="tns:OpenSubscriptionEndCodeType" />
+ <xs:element name="Reason" type="tns:LanguageSpecificStringType" minOccurs="0" maxOccurs="unbounded" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="SubscriptionEndCodeType">
+ <xs:restriction base="xs:anyURI">
+ <xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryFailure" />
+ <xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceShuttingDown" />
+ <xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceCancelling" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="OpenSubscriptionEndCodeType">
+ <xs:union memberTypes="tns:SubscriptionEndCodeType xs:anyURI" />
+ </xs:simpleType>
+
+ <xs:attribute name="EventSource" type="xs:boolean" />
+
+ </xs:schema>
+
+ <xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" elementFormDefault="qualified" blockDefault="#all">
+ <!-- //////////////////// WS-Addressing //////////////////// -->
+ <!-- Endpoint reference -->
+ <xs:element name="EndpointReference" type="wsa:EndpointReferenceType" />
+ <xs:complexType name="EndpointReferenceType">
+ <xs:sequence>
+ <xs:element name="Address" type="wsa:AttributedURI" />
+ <xs:element name="ReferenceProperties" type="wsa:ReferencePropertiesType" minOccurs="0" />
+ <xs:element name="ReferenceParameters" type="wsa:ReferenceParametersType" minOccurs="0" />
+ <xs:element name="PortType" type="wsa:AttributedQName" minOccurs="0" />
+ <xs:element name="ServiceName" type="wsa:ServiceNameType" minOccurs="0" />
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must
+ appear first (before any extensibility elements).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:complexType>
+ <xs:complexType name="ReferencePropertiesType">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ReferenceParametersType">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ServiceNameType">
+ <xs:simpleContent>
+ <xs:extension base="xs:QName">
+ <xs:attribute name="PortName" type="xs:NCName" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <!-- Message information header blocks -->
+ <xs:element name="MessageID" type="wsa:AttributedURI" />
+ <xs:element name="RelatesTo" type="wsa:Relationship" />
+ <xs:element name="To" type="wsa:AttributedURI" />
+ <xs:element name="Action" type="wsa:AttributedURI" />
+ <xs:element name="From" type="wsa:EndpointReferenceType" />
+ <xs:element name="ReplyTo" type="wsa:EndpointReferenceType" />
+ <xs:element name="FaultTo" type="wsa:EndpointReferenceType" />
+ <xs:complexType name="Relationship">
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:attribute name="RelationshipType" type="xs:QName" use="optional" />
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:simpleType name="RelationshipTypeValues">
+ <xs:restriction base="xs:QName">
+ <xs:enumeration value="wsa:Reply" />
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:element name="ReplyAfter" type="wsa:ReplyAfterType" />
+ <xs:complexType name="ReplyAfterType">
+ <xs:simpleContent>
+ <xs:extension base="xs:nonNegativeInteger">
+ <xs:anyAttribute namespace="##other" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:simpleType name="FaultSubcodeValues">
+ <xs:restriction base="xs:QName">
+ <xs:enumeration value="wsa:InvalidMessageInformationHeader" />
+ <xs:enumeration value="wsa:MessageInformationHeaderRequired" />
+ <xs:enumeration value="wsa:DestinationUnreachable" />
+ <xs:enumeration value="wsa:ActionNotSupported" />
+ <xs:enumeration value="wsa:EndpointUnavailable" />
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:attribute name="Action" type="xs:anyURI" />
+ <!-- Common declarations and definitions -->
+ <xs:complexType name="AttributedQName">
+ <xs:simpleContent>
+ <xs:extension base="xs:QName">
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="AttributedURI">
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:anyAttribute namespace="##other" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:schema>
+
+ </wsdl:types>
+
+ <wsdl:message name='SubscribeMsg'>
+ <wsdl:part name='body' element='wse:Subscribe' />
+ </wsdl:message>
+ <wsdl:message name='SubscribeResponseMsg'>
+ <wsdl:part name='body' element='wse:SubscribeResponse' />
+ </wsdl:message>
+
+ <wsdl:message name='RenewMsg'>
+ <wsdl:part name='body' element='wse:Renew' />
+ </wsdl:message>
+ <wsdl:message name='RenewResponseMsg'>
+ <wsdl:part name='body' element='wse:RenewResponse' />
+ </wsdl:message>
+
+ <wsdl:message name='GetStatusMsg'>
+ <wsdl:part name='body' element='wse:GetStatus' />
+ </wsdl:message>
+ <wsdl:message name='GetStatusResponseMsg'>
+ <wsdl:part name='body' element='wse:GetStatusResponse' />
+ </wsdl:message>
+
+ <wsdl:message name='UnsubscribeMsg'>
+ <wsdl:part name='body' element='wse:Unsubscribe' />
+ </wsdl:message>
+ <wsdl:message name='UnsubscribeResponseMsg' />
+
+ <wsdl:message name='SubscriptionEnd'>
+ <wsdl:part name='body' element='wse:SubscriptionEnd' />
+ </wsdl:message>
+
+ <wsdl:portType name='EventSource'>
+ <wsdl:operation name='SubscribeOp'>
+ <wsdl:input message='wse:SubscribeMsg' />
+ <wsdl:output message='wse:SubscribeResponseMsg' />
+ </wsdl:operation>
+ <wsdl:operation name='SubscriptionEnd'>
+ <wsdl:output message='wse:SubscriptionEnd' />
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:portType name='SubscriptionManager'>
+ <wsdl:operation name='RenewOp'>
+ <wsdl:input message='wse:RenewMsg' />
+ <wsdl:output message='wse:RenewResponseMsg' />
+ </wsdl:operation>
+ <wsdl:operation name='GetStatusOp'>
+ <wsdl:input message='wse:GetStatusMsg' />
+ <wsdl:output message='wse:GetStatusResponseMsg' />
+ </wsdl:operation>
+ <wsdl:operation name='UnsubscribeOp'>
+ <wsdl:input message='wse:UnsubscribeMsg' />
+ <wsdl:output message='wse:UnsubscribeResponseMsg' />
+ </wsdl:operation>
+ </wsdl:portType>
+</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
new file mode 100644
index 0000000..a096071
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
@@ -0,0 +1,73 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class ComplexForEachWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running ComplexForEachWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexForEach.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+//// ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf,null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(), conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf,null,null,true);
+//
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
new file mode 100644
index 0000000..ce50e50
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
@@ -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.xbaya.interpreter;
+
+public class ComplexMathService {
+ public int adder(int param1, int param2) {
+ return param1 + param2;
+ }
+
+ public int multiplier(int param1, int param2) {
+ return param1 * param2;
+ }
+
+ public String echo(String str) {
+ return str;
+ }
+
+ public String concatenate(String str1, String str2) {
+ return str1 + str2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
new file mode 100644
index 0000000..dd7d184
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
@@ -0,0 +1,71 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class ComplexMathWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(ComplexMathWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running ComplexMathWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexMath.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
new file mode 100644
index 0000000..6971e8a
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
@@ -0,0 +1,71 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class CrossProductWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(CrossProductWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running CrossProductWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("LevenshteinDistance.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,new SSWorkflowInterpreterInteractorImpl());
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
new file mode 100644
index 0000000..0e76399
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
@@ -0,0 +1,28 @@
+/*
+ *
+ * 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.xbaya.interpreter;
+
+public class EchoService {
+
+ public String echo(String input) {
+ return input;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
new file mode 100644
index 0000000..85fcc22
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
@@ -0,0 +1,73 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.graph.system.InputNode;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class ForEachWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running ForEachWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleEcho.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
new file mode 100644
index 0000000..3a65729
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
@@ -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.xbaya.interpreter;
+
+public class LevenshteinDistanceService {
+ public int computeDistance(String sequence1, String sequence2) {
+ int[][] distance = new int[sequence1.length() + 1][sequence2.length() + 1];
+
+ for (int i = 0; i <= sequence1.length(); i++) {
+ distance[i][0] = i;
+ }
+ for (int j = 0; j <= sequence2.length(); j++) {
+ distance[0][j] = j;
+ }
+
+ for (int i = 1; i <= sequence1.length(); i++) {
+ for (int j = 1; j <= sequence2.length(); j++) {
+ distance[i][j] = min(distance[i - 1][j] + 1, distance[i][j - 1] + 1, distance[i - 1][j - 1] + ((sequence1.charAt(i - 1) == sequence2.charAt(j - 1)) ? 0 : 1));
+ }
+ }
+
+ return distance[sequence1.length()][sequence2.length()];
+ }
+
+ private int min(int a, int b, int c) {
+ return Math.min(Math.min(a, b), c);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
new file mode 100644
index 0000000..6443828
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.xbaya.interpreter;
+
+import org.apache.airavata.wsmg.client.NotificationHandler;
+
+public class Listener implements NotificationHandler {
+
+ public void handleNotification(String message) {
+ System.out.println("MessageRecieved: " + message);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
new file mode 100644
index 0000000..261b07f
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
@@ -0,0 +1,204 @@
+/*
+ *
+ * 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.xbaya.interpreter;
+
+
+import org.apache.airavata.workflow.tracking.NotifierFactory;
+import org.apache.airavata.workflow.tracking.WorkflowNotifier;
+import org.apache.airavata.workflow.tracking.common.InvocationContext;
+import org.apache.airavata.workflow.tracking.common.InvocationEntity;
+import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
+import org.apache.axis2.addressing.EndpointReference;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.net.URI;
+import java.util.Properties;
+
+public class NotificationSender {
+
+ protected WorkflowNotifier notifier;
+
+ protected String brokerURL;
+
+ protected String topic;
+
+ protected URI workflowID;
+
+ protected InvocationEntity initiator;
+
+ protected InvocationEntity receiver;
+
+ protected InvocationContext invocationContext;
+
+ protected EndpointReference eventSink;
+
+ protected WorkflowTrackingContext context;
+
+ /**
+ * Constructs a NotificationSender.
+ *
+ * @param brokerURL
+ * @param topic
+ */
+ public NotificationSender(URI brokerURL, String topic) {
+ this(brokerURL.toString(), topic);
+ }
+
+ /**
+ * Creates a NotificationSender.
+ *
+ * @param brokerURL The location of notification brokerUrl.
+ * @param topic The notification topic.
+ */
+ public NotificationSender(String brokerURL, String topic) {
+ this.topic = topic;
+ this.brokerURL = brokerURL;
+ this.workflowID = URI.create(this.convertToJavaIdentifier(this.topic));
+ this.eventSink = new EndpointReference(this.brokerURL);
+ Properties props = new Properties();
+
+ this.notifier = NotifierFactory.createNotifier();
+ URI initiatorWorkflowID = null;
+ URI initiatorServiceID = URI.create(this.convertToJavaIdentifier(topic));
+ String initiatorWorkflowNodeID = null;
+ Integer initiatorWorkflowTimeStep = null;
+ this.context = this.notifier.createTrackingContext(props, brokerURL, initiatorWorkflowID,
+ initiatorServiceID, initiatorWorkflowNodeID, initiatorWorkflowTimeStep);
+ this.context.setTopic(topic);
+ this.initiator = this.notifier.createEntity(initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID,
+ initiatorWorkflowTimeStep);
+
+ URI receiverWorkflowID = this.workflowID;
+ URI receiverServiceID = this.workflowID;
+ String receiverWorkflowNodeID = null;
+ Integer receiverWorkflowTimeStep = null;
+ this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
+ receiverWorkflowTimeStep);
+ }
+
+ /**
+ * @return The event sink EPR.
+ */
+ public EndpointReference getEventSink() {
+ return this.eventSink;
+ }
+
+
+ public void workflowStarted(String message) {
+ this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
+ }
+
+
+ public void workflowFinished(String message) {
+ this.notifier.sendingResult(context, this.invocationContext, message);
+ this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+ }
+
+ public void sendingPartialResults(Object[] args, String[] keywords) {
+ String message = "";
+ for (int i = 0; i < args.length; i++) {
+ if (i != 0) {
+ message += ", ";
+ }
+ message += keywords[i] + "=" + args[i];
+ }
+ this.notifier.sendingResult(context, this.invocationContext, message);
+ }
+
+
+ public void workflowTerminated() {
+ this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+ }
+
+ /**
+ * Sends a START_INCOMPLETED notification message.
+ *
+ * @param message The message to send
+ */
+ public void workflowFailed(String message) {
+ workflowFailed(message, null);
+ }
+
+ /**
+ * Sends a START_INCOMPLETED notification message.
+ *
+ * @param e
+ */
+ public void workflowFailed(Throwable e) {
+ workflowFailed(null, e);
+ }
+
+ /**
+ * Sends a START_INCOMPLETED notification message.
+ *
+ * @param message The message to send
+ * @param e
+ */
+ public void workflowFailed(String message, Throwable e) {
+ this.notifier.sendingFault(context, this.invocationContext, message);
+ }
+
+ public void info(String message) {
+ this.notifier.info(context, message);
+ }
+
+ /**
+ * @param throwable
+ * @return The stackTrace in String
+ */
+ public static String getStackTraceInString(Throwable throwable) {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ PrintStream printStream = new PrintStream(byteArrayOutputStream);
+ throwable.printStackTrace(printStream);
+ printStream.flush();
+ return byteArrayOutputStream.toString();
+ }
+
+ public static String convertToJavaIdentifier(String name) {
+
+ final char REPLACE_CHAR = '_';
+
+ if (name == null || name.length() == 0) {
+ return "" + REPLACE_CHAR;
+ }
+
+ StringBuilder buf = new StringBuilder();
+
+ char c = name.charAt(0);
+ if (!Character.isJavaIdentifierStart(c)) {
+ // Add _ at the beggining instead of replacing it to _. This is
+ // more readable if the name is like 3D_Model.
+ buf.append(REPLACE_CHAR);
+ }
+
+ for (int i = 0; i < name.length(); i++) {
+ c = name.charAt(i);
+ if (Character.isJavaIdentifierPart(c)) {
+ buf.append(c);
+ } else {
+ buf.append(REPLACE_CHAR);
+ }
+ }
+
+ return buf.toString();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
new file mode 100644
index 0000000..b9b86be
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
@@ -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.xbaya.interpreter;
+//
+//import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+//import org.apache.airavata.registry.api.exception.RegistryException;
+//import org.apache.airavata.commons.gfac.type.HostDescription;
+//import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+//import org.junit.After;
+//import org.junit.Before;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.ExpectedException;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+////FIXME: Add tests for new registry. Airavata-592
+//public class RegistryServiceTest {
+// @Rule
+// public ExpectedException exception = ExpectedException.none();
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// final Logger logger = LoggerFactory.getLogger(RegistryServiceTest.class);
+//
+// @Before
+// public void testExecute() throws RegistryException {
+//
+// }
+//
+// @After
+// public void cleanup() throws RegistryException {
+// }
+//
+// private HostDescription createHostDescription() {
+// HostDescription host = new HostDescription();
+// host.getType().setHostName("localhost");
+// host.getType().setHostAddress("localhost");
+// return host;
+// }
+//
+// private ServiceDescription createServiceDescription() {
+// ServiceDescription serv = new ServiceDescription();
+// serv.getType().setName("SimpleEcho");
+// return serv;
+// }
+//
+// private ApplicationDescription createAppDeploymentDescription() {
+// ApplicationDescription appDesc = new ApplicationDescription();
+// ApplicationDeploymentDescriptionType app = appDesc.getType();
+// ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
+// .newInstance();
+// name.setStringValue("EchoLocal");
+// app.setApplicationName(name);
+// app.setExecutableLocation("/bin/echo");
+// app.setScratchWorkingDirectory("/tmp");
+// app.setStaticWorkingDirectory("/tmp");
+// app.setInputDataDirectory("/tmp/input");
+// app.setOutputDataDirectory("/tmp/output");
+// app.setStandardOutput("/tmp/echo.stdout");
+// app.setStandardError("/tmp/echo.stdout");
+// return appDesc;
+// }
+//
+// @Test
+// public void getFromRegistry() throws RegistryException {
+// }
+//
+// @Test
+// public void searchRegistry() throws RegistryException {
+// }
+//
+// @Test
+// public void deleteFromRegistry() throws RegistryException {
+//
+// }
+//
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
new file mode 100644
index 0000000..dbe8cae
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
@@ -0,0 +1,72 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class SimpleForEachWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running SimpleForEachWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleForEach.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+//
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
new file mode 100644
index 0000000..fcfc44f
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
@@ -0,0 +1,73 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class SimpleMathWorkflowTest {
+// final Logger logger = LoggerFactory.getLogger(SimpleMathWorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running SimpleMathWorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleMath.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
new file mode 100644
index 0000000..7b016cd
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
@@ -0,0 +1,74 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import java.io.IOException;
+//import java.net.URISyntaxException;
+//import java.net.URL;
+//import java.util.UUID;
+//
+////import org.apache.airavata.registry.api.AiravataRegistry2;
+//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+//import org.apache.airavata.workflow.model.graph.system.InputNode;
+//import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.xbaya.XBayaConfiguration;
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+//import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+//import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//public class WorkflowTest{
+// final Logger logger = LoggerFactory.getLogger(WorkflowTest.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @Test
+// public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+// logger.info("Running WorkflowTest...");
+// URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleEcho.xwf");
+// Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+// ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+// XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//// AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+// WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+// UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+// workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+// SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+//
+// WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration, ssWorkflowInterpreterInteractorImpl);
+// interpretor.scheduleDynamically();
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
new file mode 100644
index 0000000..723699f
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
@@ -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.xbaya.interpreter;
+//
+//
+//import junit.framework.Assert;
+//import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+//import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+//import org.apache.airavata.xbaya.interpreter.utils.ConfigKeys;
+//import org.apache.airavata.xbaya.interpreter.utils.TestUtilServer;
+//import org.apache.axiom.soap.SOAPEnvelope;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//import java.util.Properties;
+//
+//public class WorkflowTrackingTest implements ConsumerNotificationHandler{
+// final static Logger logger = LoggerFactory.getLogger(ConsumerNotificationHandler.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// public void handleNotification(SOAPEnvelope msgEnvelope) {
+// logger.info("Received " + msgEnvelope);
+// String message = "<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header><wsa:Action xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://org.apache.airavata/WseNotification</wsa:Action><wsa:MessageID xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" /><wsa:To xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://140.182.151.20:61436/axis2/services/ConsumerService/</wsa:To><wsnt:Topic xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\" xmlns:ns2=\"http://tutorial.globus.org/auction\" Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\">ns2:abc</wsnt:Topic></soapenv:Header><soapenv:Body><wor:workflowInvoked xmlns:wor=\"http://airavata.apache.org/schemas/wft/2011/08\" infoModelVersion=\"2.6\"><wor:notificationSource wor:serviceID=\"abc\" /><wor:timestamp>2011-12-20T14:47:33.736-05:00</wor:timestamp><wor:description>Workflow S
tarted</wor:description><wor:annotation /><wor:initiator wor:serviceID=\"abc\" /></wor:workflowInvoked></soapenv:Body></soapenv:Envelope>";
+// Assert.assertEquals(message,msgEnvelope);
+// }
+//
+// private static Properties getDefaults() {
+// Properties defaults = new Properties();
+// defaults.setProperty(ConfigKeys.MSGBOX_SERVICE_URL,
+// "http://localhost:8080/axis2/services/MsgBoxService");
+// defaults.setProperty(ConfigKeys.MSGBROKER_SERVICE_URL,
+// "http://localhost:8080/axis2/services/EventingService");
+// defaults.setProperty(ConfigKeys.TOPIC, "abc");
+// return defaults;
+// }
+//
+// protected void setUp() throws Exception {
+// TestUtilServer.start(null, null);
+// }
+//
+// protected void tearDown() throws Exception {
+// TestUtilServer.stop();
+// }
+//
+// @Test
+// public void WorkflowTrackingtest() throws Exception{
+// logger.info("Running WorkflowTrackingTest...");
+// setUp();
+// Properties configurations = new Properties(getDefaults());
+// WseMsgBrokerClient brokerClient = new WseMsgBrokerClient();
+// String brokerLocation = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+// brokerClient.init(brokerLocation);
+// String topic = configurations.getProperty(ConfigKeys.TOPIC);
+// NotificationSender sender = null;
+// sender = new NotificationSender(brokerLocation, topic);
+//
+// int consumerPort = TestUtilServer.getAvailablePort();
+//
+// String[] consumerEPRs = brokerClient.startConsumerService(consumerPort, this);
+// // subscribing to the above created messsage box with configured topic
+// String subscriptionID = brokerClient.subscribe(consumerEPRs[0], topic, null);
+//
+// sender.workflowStarted("Workflow Started");
+//
+// //Here we simply assume the workflow invocation is the invoke of the subscribe operation of EventingService and result
+// // Is considered as the subscriptionID got from subscribe operation
+// try {
+// Thread.sleep(10000L);
+// } catch (InterruptedException e) {
+// e.printStackTrace();
+// }
+// brokerClient.unSubscribe(subscriptionID);
+// Assert.assertEquals(brokerLocation,"http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService");
+// tearDown();
+// }
+//}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
new file mode 100644
index 0000000..f6a7f85
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
@@ -0,0 +1,80 @@
+/*
+ *
+ * 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.xbaya.interpreter;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ListenerManager;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class XBayaClientTest {
+ final static Logger logger = LoggerFactory.getLogger(XBayaClientTest.class);
+
+ @Rule
+ public MethodRule watchman = new TestWatchman() {
+ public void starting(FrameworkMethod method) {
+ logger.info("{} being run...", method.getName());
+ }
+ };
+
+ @Test
+ public void testInvokeWorkflowString() {
+// try {
+// ListenerManager manager = axis2ServiceStarter();
+// XBayaClient xBayaClient = new XBayaClient("xbaya1.properties");
+// xBayaClient.loadWorkflowFromaFile("/Users/lahirugunathilake/localsimplemath.xwf");
+// NameValue[] nameValues = xBayaClient.setInputs("xbaya1.properties");
+// String s = xBayaClient.runWorkflow("test",nameValues,"admin");
+// org.junit.Assert.assertEquals("test",s);
+
+// manager.stop();*/
+// } catch (URISyntaxException e) {
+// TODO Auto-generated catch block
+// e.printStackTrace();
+// } catch (IOException e) {
+// TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+ }
+
+ private ListenerManager axis2ServiceStarter() throws AxisFault {
+ try {
+ ConfigurationContext configContext = ConfigurationContextFactory.createBasicConfigurationContext
+ ("axis2_default.xml");
+ AxisService service = AxisService.createService(EchoService.class.getName(), configContext.getAxisConfiguration());
+ configContext.deployService(service);
+ ListenerManager manager = new ListenerManager();
+ manager.init(configContext);
+ manager.start();
+ return manager;
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
new file mode 100644
index 0000000..cab7f51
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
@@ -0,0 +1,67 @@
+///*
+// *
+// * 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.xbaya.interpreter;
+//
+//import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+//import org.apache.axis2.AxisFault;
+//import org.apache.axis2.engine.ListenerManager;
+//import org.junit.AfterClass;
+//import org.junit.BeforeClass;
+//import org.junit.Rule;
+//import org.junit.rules.MethodRule;
+//import org.junit.rules.TestWatchman;
+//import org.junit.runner.RunWith;
+//import org.junit.runners.Suite;
+//import org.junit.runners.model.FrameworkMethod;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//
+//
+//@RunWith(Suite.class)
+//@Suite.SuiteClasses({XBayaClientTest.class, SimpleMathWorkflowTest.class, WorkflowTest.class,
+// ComplexMathWorkflowTest.class, CrossProductWorkflowTest.class, ForEachWorkflowTest.class,
+// SimpleForEachWorkflowTest.class, ComplexForEachWorkflowTest.class,
+// WorkflowTrackingTest.class, RegistryServiceTest.class})
+//public class XBayaConsolidatedTestSuite {
+// private static ListenerManager manager = null;
+//
+// final static Logger logger = LoggerFactory.getLogger(XBayaConsolidatedTestSuite.class);
+//
+// @Rule
+// public MethodRule watchman = new TestWatchman() {
+// public void starting(FrameworkMethod method) {
+// logger.info("{} being run...", method.getName());
+// }
+// };
+//
+// @BeforeClass
+// public static void startServer() throws AxisFault {
+// logger.info("Starting simple Axis2 Server...");
+// manager = WorkflowTestUtils.axis2ServiceStarter();
+// }
+//
+// @AfterClass
+// public static void stopServer() throws AxisFault {
+// logger.info("Stopping simple Axis2 Server...");
+// manager.stop();
+// }
+//
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/a8974b7c/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
new file mode 100644
index 0000000..77a2722
--- /dev/null
+++ b/modules/workflow-model/workflow-engine/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.xbaya.interpreter.utils;
+
+
+public class ConfigKeys {
+
+ public static final String AXIS2_REPO = "axis2.repository";
+ public static final String CONFIG_FILE_NAME = "configuration.properties";
+ public static final String MSGBOX_SERVICE_URL = "msgbox.service.url";
+ public static final String MSGBROKER_SERVICE_URL = "msgbroker.service.url";
+ public static final String MSGBOX_ID = "msgbox.id";
+ public static final String TOPIC = "abc";
+
+
+}
\ No newline at end of file