Skip to content

Commit 3e9b04b

Browse files
committed
add test for Workflows being the correct class
1 parent ad55661 commit 3e9b04b

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

src/test/java/org/w3id/cwl/cwl1_2/utils/RequirementsClassTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public RequirementsClassTest() throws URISyntaxException {
2323

2424
@Test
2525
public void className() {
26-
Assert.assertEquals(doc.getClass().getSimpleName(), "CommandLineToolImpl");
26+
Assert.assertEquals("CommandLineToolImpl", doc.getClass().getSimpleName());
2727
}
2828

2929
@Test
@@ -38,18 +38,18 @@ public void hints() {
3838
java.util.Optional<java.util.List<Object>> hints = doc.getHints();
3939
Assert.assertTrue(hints.isPresent());
4040
java.util.List<Object> hintList = hints.get();
41-
Assert.assertEquals(hintList.size(), 1);
41+
Assert.assertEquals(1, hintList.size());
4242
}
4343

4444
@Test
4545
public void reqs() {
4646
java.util.Optional<java.util.List<Object>> reqs = doc.getRequirements();
4747
Assert.assertTrue(reqs.isPresent());
4848
java.util.List<Object> reqList = reqs.get();
49-
Assert.assertEquals(reqList.size(), 2);
49+
Assert.assertEquals(2, reqList.size());
5050
InlineJavascriptRequirement reqOne = (InlineJavascriptRequirement) reqList.get(0);
51-
Assert.assertEquals(reqOne.getClass().getSimpleName(), "InlineJavascriptRequirementImpl");
52-
Assert.assertNotEquals(reqList.get(1).getClass().getSimpleName(), "InlineJavascriptRequirementImpl");
51+
Assert.assertEquals("InlineJavascriptRequirementImpl", reqOne.getClass().getSimpleName());
52+
Assert.assertNotEquals("InlineJavascriptRequirementImpl", reqList.get(1).getClass().getSimpleName());
5353
}
5454

5555
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.w3id.cwl.cwl1_2.utils;
2+
3+
import org.w3id.cwl.cwl1_2.Process;
4+
import org.w3id.cwl.cwl1_2.SchemaDefRequirement;
5+
import org.w3id.cwl.cwl1_2.CWLVersion;
6+
import org.w3id.cwl.cwl1_2.InlineJavascriptRequirement;
7+
import org.w3id.cwl.cwl1_2.InputRecordSchema;
8+
9+
import java.net.URISyntaxException;
10+
import java.util.List;
11+
12+
import org.junit.Assert;
13+
import org.junit.Test;
14+
15+
public class WorkflowClassTest {
16+
Process doc;
17+
18+
public WorkflowClassTest() throws URISyntaxException {
19+
super();
20+
this.doc = (Process) RootLoader
21+
.loadDocument(java.nio.file.Paths.get(getClass().getResource("valid_count-lines1-wf.cwl").toURI()));
22+
}
23+
24+
@Test
25+
public void className() {
26+
Assert.assertEquals("WorkflowImpl", doc.getClass().getSimpleName());
27+
}
28+
29+
@Test
30+
public void version() {
31+
java.util.Optional<CWLVersion> version = doc.getCwlVersion();
32+
Assert.assertTrue(version.isPresent());
33+
Assert.assertEquals(CWLVersion.V1_2, version.get());
34+
}
35+
36+
}

0 commit comments

Comments
 (0)