You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2018/07/16 09:22:26 UTC
[12/15] incubator-taverna-language git commit: Fix test equality for
ports and add Apache header
Fix test equality for ports and add Apache header
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/d39a8a2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/d39a8a2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/d39a8a2f
Branch: refs/heads/master
Commit: d39a8a2fa3f4137458b247a8d37989af47c3d72a
Parents: 289583c
Author: Majdi Haouech <m....@criteo.com>
Authored: Fri Jun 22 12:39:54 2018 +0200
Committer: Majdi Haouech <m....@criteo.com>
Committed: Fri Jun 22 12:42:31 2018 +0200
----------------------------------------------------------------------
.../apache/taverna/scufl2/cwl/TestParser.java | 38 ++++++++++++++++----
.../src/test/resources/1st-tool.cwl | 16 +++++++++
.../src/test/resources/hello_world.cwl | 18 ++++++++++
.../src/test/resources/int_input.cwl | 16 +++++++++
.../src/test/resources/simple_string_input.cwl | 16 +++++++++
.../src/test/resources/worklflow2.cwl | 17 +++++++++
6 files changed, 114 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/java/org/apache/taverna/scufl2/cwl/TestParser.java
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/java/org/apache/taverna/scufl2/cwl/TestParser.java b/taverna-scufl2-cwl/src/test/java/org/apache/taverna/scufl2/cwl/TestParser.java
index 89c81ba..4e3e69e 100644
--- a/taverna-scufl2-cwl/src/test/java/org/apache/taverna/scufl2/cwl/TestParser.java
+++ b/taverna-scufl2-cwl/src/test/java/org/apache/taverna/scufl2/cwl/TestParser.java
@@ -1,3 +1,21 @@
+/*
+ * 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.taverna.scufl2.cwl;
@@ -48,9 +66,12 @@ public class TestParser {
@Test
public void testParseInputs() throws Exception {
+ workflow.setParent(null);
NamedSet<InputWorkflowPort> workflowInputs = workflow.getInputPorts();
- NamedSet<InputWorkflowPort> expectedInputs = new NamedSet<>();
- expectedInputs.add(new InputWorkflowPort(workflow, "name"));
+
+ Workflow expectedWorkflow = new Workflow(workflow.getName());
+ NamedSet<InputWorkflowPort> expectedInputs = expectedWorkflow.getInputPorts();
+ expectedInputs.add(new InputWorkflowPort(expectedWorkflow, "name"));
assertEquals(expectedInputs, workflowInputs);
}
@@ -67,9 +88,12 @@ public class TestParser {
@Test
public void testParseProcessors() throws Exception {
+ workflow.setParent(null);
NamedSet<Processor> workflowProcessors = workflow.getProcessors();
- NamedSet<Processor> expectedProcessors = new NamedSet<>();
- expectedProcessors.add(new Processor(workflow, "step1"));
+
+ Workflow expectedWorkflow = new Workflow(workflow.getName());
+ NamedSet<Processor> expectedProcessors = expectedWorkflow.getProcessors();
+ expectedProcessors.add(new Processor(expectedWorkflow, "step1"));
assertEquals(expectedProcessors, workflowProcessors);
}
@@ -79,10 +103,9 @@ public class TestParser {
Set<DataLink> workflowDataLinks = workflow.getDataLinks();
Set<DataLink> expectedDataLinks = new HashSet<>();
- Set<Processor> processorSet = workflow.getProcessors();
+ NamedSet<Processor> processorSet = workflow.getProcessors();
// processorSet has one processor
- Processor processor = processorSet.iterator().next();
-
+ Processor processor = processorSet.getByName("step1");
expectedDataLinks.add(
new DataLink(
workflow,
@@ -91,6 +114,7 @@ public class TestParser {
)
);
+ assertEquals(1, workflowDataLinks.size());
assertEquals(expectedDataLinks, workflowDataLinks);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/resources/1st-tool.cwl
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/resources/1st-tool.cwl b/taverna-scufl2-cwl/src/test/resources/1st-tool.cwl
index e292134..be272f2 100644
--- a/taverna-scufl2-cwl/src/test/resources/1st-tool.cwl
+++ b/taverna-scufl2-cwl/src/test/resources/1st-tool.cwl
@@ -1,3 +1,19 @@
+# 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.
cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/resources/hello_world.cwl
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/resources/hello_world.cwl b/taverna-scufl2-cwl/src/test/resources/hello_world.cwl
index d716812..2172578 100644
--- a/taverna-scufl2-cwl/src/test/resources/hello_world.cwl
+++ b/taverna-scufl2-cwl/src/test/resources/hello_world.cwl
@@ -1,4 +1,22 @@
#!/usr/bin/env cwl-runner
+
+# 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.
+
cwlVersion: v1.0
class: Workflow
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/resources/int_input.cwl
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/resources/int_input.cwl b/taverna-scufl2-cwl/src/test/resources/int_input.cwl
index ffb79e6..f2041da 100644
--- a/taverna-scufl2-cwl/src/test/resources/int_input.cwl
+++ b/taverna-scufl2-cwl/src/test/resources/int_input.cwl
@@ -1,3 +1,19 @@
+# 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.
inputs:
example_int:
type: int
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/resources/simple_string_input.cwl
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/resources/simple_string_input.cwl b/taverna-scufl2-cwl/src/test/resources/simple_string_input.cwl
index b474f9d..059338f 100644
--- a/taverna-scufl2-cwl/src/test/resources/simple_string_input.cwl
+++ b/taverna-scufl2-cwl/src/test/resources/simple_string_input.cwl
@@ -1,3 +1,19 @@
+# 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.
inputs:
example_string: string
steps:
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/d39a8a2f/taverna-scufl2-cwl/src/test/resources/worklflow2.cwl
----------------------------------------------------------------------
diff --git a/taverna-scufl2-cwl/src/test/resources/worklflow2.cwl b/taverna-scufl2-cwl/src/test/resources/worklflow2.cwl
index 43f164c..fc5e846 100644
--- a/taverna-scufl2-cwl/src/test/resources/worklflow2.cwl
+++ b/taverna-scufl2-cwl/src/test/resources/worklflow2.cwl
@@ -1,4 +1,21 @@
#!/usr/bin/env cwl-runner
+
+# 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.
cwlVersion: v1.0
class: Workflow