--- /dev/null
+package jalview.ext.cipres;
+
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
+import jalview.gui.JvOptionPane;
+
+import java.util.Arrays;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class CipresJobTest
+{
+ @BeforeClass(
+ alwaysRun = true
+ )
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ @Test(
+ groups = "Functional"
+ )
+ public void testSettingJobParameters()
+ {
+ CipresJob testJob = new CipresJob("examples/plantfdx.fa");
+ testJob.addToolParameters("runtime_", Arrays.asList("0.3"));
+ testJob.addInputParameter("test", "hoi");
+ testJob.addMetadata("hennepin", "crawler");
+ assertFalse(testJob.areParamsValidated());
+
+ testJob.clearAllParameters();
+ assertNull(testJob.getvParams().get("runtime_"));
+
+
+ }
+
+ @Test(
+ groups =
+ { "External" }
+ )
+ public void testValidatingParameters()
+ {
+ CipresJob testJob = new CipresJob("examples/plantfdx.fa", "CLUSTALW");
+ testJob.addToolParameters("runtime_", Arrays.asList("0.2"));
+ testJob.addMetadata("clientJobId", "101");
+ testJob.validateJobParams();
+ assertTrue(testJob.areParamsValidated());
+
+ }
+
+ @Test(
+ groups =
+ { "External" }
+ )
+ public void testJobSubmission()
+ {
+ CipresJob testJob = new CipresJob("examples/plantfdx.fa", "CLUSTALW");
+ testJob.addToolParameters("runtime_", Arrays.asList("0.2"));
+ testJob.addMetadata("clientJobId", "102");
+ testJob.addMetadata("statusEmail", "false");
+ testJob.addMetadata("clientJobName", "test_job");
+ testJob.submitJob();
+
+ }
+}