Added Apache license header and update AiravataDefaultParser test
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/308291f5 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/308291f5 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/308291f5 Branch: refs/heads/master Commit: 308291f5296dc8d1325856a5aa1aba21eb7d2143 Parents: 9fcf226 Author: shamrath <[email protected]> Authored: Wed Feb 18 07:53:20 2015 -0500 Committer: shamrath <[email protected]> Committed: Wed Feb 18 07:53:20 2015 -0500 ---------------------------------------------------------------------- .../engine/SimpleWorkflowInterpreter.java | 1 - .../simple/workflow/engine/WfNodeContainer.java | 24 +++++++-- .../simple/workflow/engine/WorkflowFactory.java | 21 ++++++++ .../workflow/engine/WorkflowFactoryImpl.java | 8 --- .../simple/workflow/engine/WorkflowParser.java | 2 - .../simple/workflow/engine/WorkflowUtil.java | 24 +++++++-- .../workflow/engine/dag/edge/DirectedEdge.java | 21 ++++++++ .../simple/workflow/engine/dag/edge/Edge.java | 24 +++++++-- .../engine/dag/nodes/ApplicationNodeImpl.java | 2 - .../workflow/engine/dag/nodes/NodeType.java | 24 +++++++-- .../engine/dag/nodes/WorkflowInputNode.java | 3 -- .../engine/dag/nodes/WorkflowInputNodeImpl.java | 3 -- .../engine/dag/nodes/WorkflowOutputNode.java | 1 - .../dag/nodes/WorkflowOutputNodeImpl.java | 3 -- .../workflow/engine/dag/port/InputPortIml.java | 3 +- .../workflow/engine/dag/port/OutPortImpl.java | 24 +++++++-- .../simple/workflow/engine/dag/port/Port.java | 3 -- .../engine/parser/AiravataDefaultParser.java | 53 ++++++++------------ .../workflow/engine/parser/PortContainer.java | 21 ++++++++ .../simple/workflow/engine/WorkflowDAGTest.java | 23 ++++++++- .../parser/AiravataDefaultParserTest.java | 35 ++++++++++++- 21 files changed, 246 insertions(+), 77 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/SimpleWorkflowInterpreter.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/SimpleWorkflowInterpreter.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/SimpleWorkflowInterpreter.java index 3d5b99a..bc9c9a2 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/SimpleWorkflowInterpreter.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/SimpleWorkflowInterpreter.java @@ -36,7 +36,6 @@ import org.apache.airavata.registry.cpi.ChildDataType; import org.apache.airavata.registry.cpi.Registry; import org.apache.airavata.registry.cpi.RegistryException; import org.apache.airavata.registry.cpi.RegistryModelType; -import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.nodes.ApplicationNode; import org.apache.ariavata.simple.workflow.engine.dag.nodes.NodeState; import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowInputNode; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WfNodeContainer.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WfNodeContainer.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WfNodeContainer.java index d7e0c2a..e0cebd6 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WfNodeContainer.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WfNodeContainer.java @@ -1,11 +1,29 @@ +/* + * + * 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.ariavata.simple.workflow.engine; import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails; import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode; -/** - * Created by shameera on 2/9/15. - */ public class WfNodeContainer { private WorkflowNode workflowNode; private WorkflowNodeDetails wfNodeDetails; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactory.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactory.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactory.java index 6cfceaf..b0ee4a1 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactory.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactory.java @@ -1,3 +1,24 @@ +/* + * + * 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.ariavata.simple.workflow.engine; /** http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactoryImpl.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactoryImpl.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactoryImpl.java index f84acc9..f489a12 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactoryImpl.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowFactoryImpl.java @@ -30,7 +30,6 @@ public class WorkflowFactoryImpl implements WorkflowFactory { private static WorkflowFactoryImpl workflowFactoryImpl; - private WorkflowEnactor workflowEnactor; private WorkflowParser workflowParser; private WorkflowFactoryImpl(){ @@ -57,11 +56,4 @@ public class WorkflowFactoryImpl implements WorkflowFactory { return workflowParser; } - @Override - public WorkflowEnactor getWorkflowEnactor() { - if (workflowEnactor == null) { - workflowEnactor = new WorkflowEnactor(); - } - return workflowEnactor; - } } http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowParser.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowParser.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowParser.java index b8b6367..adf0447 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowParser.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowParser.java @@ -21,8 +21,6 @@ package org.apache.ariavata.simple.workflow.engine; -import org.airavata.appcatalog.cpi.AppCatalogException; -import org.apache.airavata.registry.cpi.RegistryException; import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowInputNode; import java.util.List; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowUtil.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowUtil.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowUtil.java index 0d720b0..71d0288 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowUtil.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/WorkflowUtil.java @@ -1,11 +1,29 @@ +/* + * + * 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.ariavata.simple.workflow.engine; import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -/** - * Created by shameera on 2/9/15. - */ public class WorkflowUtil { public static InputDataObjectType copyValues(InputDataObjectType fromInputObj, InputDataObjectType toInputObj){ http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/DirectedEdge.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/DirectedEdge.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/DirectedEdge.java index 000cd06..9e1544e 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/DirectedEdge.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/DirectedEdge.java @@ -1,3 +1,24 @@ +/* + * + * 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.ariavata.simple.workflow.engine.dag.edge; import org.apache.ariavata.simple.workflow.engine.dag.port.InPort; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/Edge.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/Edge.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/Edge.java index 667a01d..cc8116a 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/Edge.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/edge/Edge.java @@ -1,8 +1,26 @@ +/* + * + * 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.ariavata.simple.workflow.engine.dag.edge; -import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; -import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode; import org.apache.ariavata.simple.workflow.engine.dag.port.InPort; import org.apache.ariavata.simple.workflow.engine.dag.port.OutPort; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/ApplicationNodeImpl.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/ApplicationNodeImpl.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/ApplicationNodeImpl.java index fd7e3c7..36d4349 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/ApplicationNodeImpl.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/ApplicationNodeImpl.java @@ -19,10 +19,8 @@ * */ - package org.apache.ariavata.simple.workflow.engine.dag.nodes; - import org.apache.ariavata.simple.workflow.engine.dag.port.InPort; import org.apache.ariavata.simple.workflow.engine.dag.port.OutPort; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/NodeType.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/NodeType.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/NodeType.java index cfb7c3d..9cef6ab 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/NodeType.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/NodeType.java @@ -1,8 +1,26 @@ +/* + * + * 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.ariavata.simple.workflow.engine.dag.nodes; -/** - * Created by shameera on 1/29/15. - */ public enum NodeType { APPLICATION, WORKFLOW_INPUT, http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNode.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNode.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNode.java index b27fdea..0c1d0b4 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNode.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNode.java @@ -22,11 +22,8 @@ package org.apache.ariavata.simple.workflow.engine.dag.nodes; import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; -import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.port.OutPort; -import java.util.List; - public interface WorkflowInputNode extends WorkflowNode { public InputDataObjectType getInputObject(); http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNodeImpl.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNodeImpl.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNodeImpl.java index 0f6ea92..38092dd 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNodeImpl.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowInputNodeImpl.java @@ -17,14 +17,11 @@ * under the License. */ - - package org.apache.ariavata.simple.workflow.engine.dag.nodes; import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; import org.apache.ariavata.simple.workflow.engine.dag.port.OutPort; - public class WorkflowInputNodeImpl implements WorkflowInputNode { private NodeState myState = NodeState.READY; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNode.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNode.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNode.java index a1ff6d4..63a52a3 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNode.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNode.java @@ -22,7 +22,6 @@ package org.apache.ariavata.simple.workflow.engine.dag.nodes; import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.port.InPort; public interface WorkflowOutputNode extends WorkflowNode { http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNodeImpl.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNodeImpl.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNodeImpl.java index ec3a1ea..32db82c 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNodeImpl.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/nodes/WorkflowOutputNodeImpl.java @@ -19,12 +19,9 @@ * */ - package org.apache.ariavata.simple.workflow.engine.dag.nodes; - import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.port.InPort; public class WorkflowOutputNodeImpl implements WorkflowOutputNode { http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/InputPortIml.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/InputPortIml.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/InputPortIml.java index 629a832..b42c11b 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/InputPortIml.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/InputPortIml.java @@ -16,14 +16,13 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.ariavata.simple.workflow.engine.dag.port; import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode; -import java.util.List; - public class InputPortIml implements InPort { private InputDataObjectType inputDataObjectType; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/OutPortImpl.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/OutPortImpl.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/OutPortImpl.java index 35b8c3b..f4a690b 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/OutPortImpl.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/OutPortImpl.java @@ -1,3 +1,24 @@ +/* + * + * 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.ariavata.simple.workflow.engine.dag.port; import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; @@ -7,9 +28,6 @@ import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode; import java.util.ArrayList; import java.util.List; -/** - * Created by shameera on 2/11/15. - */ public class OutPortImpl implements OutPort { private OutputDataObjectType outputDataObjectType; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/Port.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/Port.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/Port.java index 8c5d6c5..bcd7936 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/Port.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/dag/port/Port.java @@ -21,11 +21,8 @@ package org.apache.ariavata.simple.workflow.engine.dag.port; -import org.apache.ariavata.simple.workflow.engine.dag.edge.Edge; import org.apache.ariavata.simple.workflow.engine.dag.nodes.WorkflowNode; -import java.util.List; - public interface Port { public boolean isSatisfy(); http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/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 62a76b3..b86e58b 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 @@ -1,9 +1,29 @@ +/* + * + * 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.ariavata.simple.workflow.engine.parser; import org.airavata.appcatalog.cpi.AppCatalogException; import org.airavata.appcatalog.cpi.WorkflowCatalog; import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory; -import org.apache.aiaravata.application.catalog.data.model.WorkflowOutput; import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; import org.apache.airavata.model.workspace.experiment.Experiment; @@ -44,11 +64,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -//import org.apache.airavata.model.Workflow; - -/** - * Created by shameera on 2/11/15. - */ public class AiravataDefaultParser implements WorkflowParser { private String experimentId; @@ -95,23 +110,10 @@ public class AiravataDefaultParser implements WorkflowParser { // TODO: throw an error and exit. } portContainers.addAll(processOutPorts(gNode, wfInputNode)); -/* for (DataPort dataPort : gNode.getOutputPorts()) { - outPort = new OutPortImpl(dataPort.getID()); - for (DataEdge dataEdge : dataPort.getEdges()) { - edge = new DirectedEdge(); - edge.setFromPort(outPort); - outPort.addEdge(edge); - inPort = getInPort(dataEdge.getToPort()); - edge.setToPort(inPort); - inPort.addEdge(edge); - portContainers.add(new PortContainer(dataEdge.getToPort(), inPort)); - } -// outPort.setOutputObject(getOutputDataObject(wfInputNode.getInputObject())); - }*/ wfInputNodes.add(wfInputNode); } - // while port container empty iterate graph and build the workflow DAG. + // while port container is not empty iterate graph and build the workflow DAG. buildModel(portContainers); return wfInputNodes; @@ -154,12 +156,6 @@ public class AiravataDefaultParser implements WorkflowParser { wfOutputNode.setInPort(inPort); wfNodes.put(wfOutputNode.getNodeId(), wfOutputNode); } - // set the workflow node to inPort - // if require check the types of inputs and output ports, - // add outputPorts to the workflow node - // add edges to each output port - // add inport and indataport to the list - // recursively call the function. } buildModel(nextPortContainerList); @@ -220,11 +216,6 @@ public class AiravataDefaultParser implements WorkflowParser { return outputDataObjectType; } - private WorkflowInputNode getWorkflowInputNode(Node inputNode) { - // FIXME: create a new workflow input node implementation with input node data. - return null; - } - private Workflow getWorkflowFromExperiment() throws RegistryException, AppCatalogException, GraphException, ComponentException { Registry registry = RegistryFactory.getDefaultRegistry(); experiment = (Experiment)registry.get(RegistryModelType.EXPERIMENT, experimentId); http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/PortContainer.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/PortContainer.java b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/PortContainer.java index 292bd1f..d18a104 100644 --- a/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/PortContainer.java +++ b/modules/simple-workflow/src/main/java/org/apache/ariavata/simple/workflow/engine/parser/PortContainer.java @@ -1,3 +1,24 @@ +/* + * + * 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.ariavata.simple.workflow.engine.parser; import org.apache.airavata.workflow.model.graph.DataPort; http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/WorkflowDAGTest.java ---------------------------------------------------------------------- diff --git a/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/WorkflowDAGTest.java b/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/WorkflowDAGTest.java index 645af42..867ddc6 100644 --- a/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/WorkflowDAGTest.java +++ b/modules/simple-workflow/src/test/java/org/apache/ariavata/simple/workflow/engine/WorkflowDAGTest.java @@ -1,11 +1,30 @@ +/* + * + * 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.ariavata.simple.workflow.engine; import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; - public class WorkflowDAGTest { @Before http://git-wip-us.apache.org/repos/asf/airavata/blob/308291f5/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 1f8e9c8..15b2864 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 @@ -1,3 +1,24 @@ +/* + * + * 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.ariavata.simple.workflow.engine.parser; import junit.framework.Assert; @@ -34,7 +55,8 @@ public class AiravataDefaultParserTest { @Test public void testWorkflowParse() throws Exception { - File jsonWfFile = new File("modules/simple-workflow/src/test/resources/ComplexMathWorkflow.awf"); +// File jsonWfFile = new File("modules/simple-workflow/src/test/resources/ComplexMathWorkflow.awf"); + File jsonWfFile = new File("/Users/shameera/work/source/git_airavata/modules/simple-workflow/src/test/resources/ComplexMathWorkflow.awf"); BufferedReader br = new BufferedReader(new FileReader(jsonWfFile)); StringBuffer sb = new StringBuffer(); String nextLine = br.readLine(); @@ -70,6 +92,10 @@ public class AiravataDefaultParserTest { List<WorkflowInputNode> workflowInputNodes = parser.parseWorkflow(workflow); Assert.assertNotNull(workflowInputNodes); Assert.assertEquals(3, workflowInputNodes.size()); + for (WorkflowInputNode workflowInputNode : workflowInputNodes) { + Assert.assertNotNull(workflowInputNode.getOutPort()); + Assert.assertNotNull(workflowInputNode.getInputObject()); + } Map<String, WorkflowNode> wfNodes = parser.getWfNodes(); for (String wfId : wfNodes.keySet()) { @@ -77,7 +103,14 @@ public class AiravataDefaultParserTest { if (wfNode instanceof ApplicationNode) { ApplicationNode node = (ApplicationNode) wfNode; Assert.assertEquals(2, node.getInputPorts().size()); + Assert.assertNotNull(node.getInputPorts().get(0).getInputObject()); + Assert.assertNotNull(node.getInputPorts().get(1).getInputObject()); + Assert.assertNotNull(node.getInputPorts().get(0).getEdge()); + Assert.assertNotNull(node.getInputPorts().get(1).getEdge()); + Assert.assertEquals(1, node.getOutputPorts().size()); + Assert.assertEquals(1, node.getOutputPorts().get(0).getOutEdges().size()); + Assert.assertNotNull(node.getOutputPorts().get(0).getOutEdges().get(0)); }else if (wfNode instanceof WorkflowOutputNode) { WorkflowOutputNode workflowOutputNode = (WorkflowOutputNode) wfNode; Assert.assertNotNull(workflowOutputNode.getInPort());
