airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [04/50] [abbrv] airavata git commit: Modified Test cases
Date Thu, 26 Mar 2015 17:08:03 GMT
Modified Test cases


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/263522a2
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/263522a2
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/263522a2

Branch: refs/heads/master
Commit: 263522a29d601d547d05ee835709a8ae4e16cd40
Parents: 9445b7a
Author: shamrath <shameerainfo@gmail.com>
Authored: Mon Feb 16 21:52:33 2015 -0500
Committer: shamrath <shameerainfo@gmail.com>
Committed: Mon Feb 16 21:52:33 2015 -0500

----------------------------------------------------------------------
 .../engine/parser/AiravataDefaultParser.java        | 16 ++++++++++++----
 .../engine/parser/AiravataDefaultParserTest.java    | 13 +++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/263522a2/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParser.java
----------------------------------------------------------------------
diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParser.java
b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParser.java
index d2095c8..baca99e 100644
--- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParser.java
+++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParser.java
@@ -134,12 +134,16 @@ public class AiravataDefaultParser implements WorkflowParser {
             inPort.setInputObject(getInputDataObject(dataPort));
             if (node instanceof WSNode) {
                 WSNode wsNode = (WSNode) node;
-                wfApplicationNode = (ApplicationNode) wfNodes.get(wsNode.getID());
-                if (wfApplicationNode == null) {
+                WorkflowNode wfNode = wfNodes.get(wsNode.getID());
+                if (wfNode == null) {
                     wfApplicationNode = new ApplicationNodeImpl(wsNode.getID(),
                             wsNode.getComponent().getApplication().getApplicationId());
                     wfNodes.put(wfApplicationNode.getNodeId(), wfApplicationNode);
                     nextPortContainerList.addAll(processOutPorts(wsNode, wfApplicationNode));
+                } else if (wfNode instanceof ApplicationNode) {
+                    wfApplicationNode = (ApplicationNode) wfNode;
+                } else {
+                    // TODO : handle this scenario
                 }
                 inPort.setNode(wfApplicationNode);
                 wfApplicationNode.addInPort(inPort);
@@ -149,7 +153,6 @@ public class AiravataDefaultParser implements WorkflowParser {
                 wfOutportNode = new WorkflowOutputNodeImpl(oNode.getID(), oNode.getName());
                 wfOutportNode.setInPort(inPort);
             }
-            buildModel(nextPortContainerList);
             // set the workflow node to inPort
             // if require check the types of inputs and output ports,
             // add outputPorts to the workflow node
@@ -157,6 +160,7 @@ public class AiravataDefaultParser implements WorkflowParser {
             // add inport and indataport to the list
             // recursively call the function.
         }
+        buildModel(nextPortContainerList);
 
     }
 
@@ -183,7 +187,7 @@ public class AiravataDefaultParser implements WorkflowParser {
             }else if (wfNode instanceof ApplicationNode) {
                 ApplicationNode applicationNode = ((ApplicationNode) wfNode);
                 applicationNode.addOutPort(outPort);
-                applicationNode.addInPort(inPort);
+//                applicationNode.addInPort(inPort);
             }
         }
         return portContainers;
@@ -242,4 +246,8 @@ public class AiravataDefaultParser implements WorkflowParser {
         }
         return list;
     }
+
+    public Map<String, WorkflowNode> getWfNodes() {
+        return wfNodes;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/263522a2/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParserTest.java
----------------------------------------------------------------------
diff --git a/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParserTest.java
b/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParserTest.java
index 0d56aa4..ea955d8 100644
--- a/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParserTest.java
+++ b/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/parser/AiravataDefaultParserTest.java
@@ -5,7 +5,9 @@ import org.apache.airavata.model.appcatalog.appinterface.DataType;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.workspace.experiment.Experiment;
 import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.ariavata.simple.workflow.engine.dag.nodes.ApplicationNode;
 import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowInputNode;
+import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -15,6 +17,7 @@ import java.io.File;
 import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 public class AiravataDefaultParserTest {
 
@@ -67,5 +70,15 @@ public class AiravataDefaultParserTest {
         Assert.assertNotNull(workflowInputNodes);
         Assert.assertEquals(3, workflowInputNodes.size());
 
+        Map<String, WorkflowNode> wfNodes = parser.getWfNodes();
+        for (String wfId : wfNodes.keySet()) {
+            WorkflowNode wfNode = wfNodes.get(wfId);
+            if (wfNode instanceof ApplicationNode) {
+                ApplicationNode node = (ApplicationNode) wfNode;
+                Assert.assertEquals(2, node.getInputPorts().size());
+                Assert.assertEquals(1, node.getOutputPorts().size());
+            }
+        }
+
     }
 }
\ No newline at end of file


Mime
View raw message