From: kjvdheide Date: Thu, 1 Feb 2018 19:26:50 +0000 (+0000) Subject: JAL-2890 added test X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bd27a7d65bdaa5a32e23f2641d1ea1f1238a0899;p=jalview.git JAL-2890 added test --- diff --git a/test/jalview/ext/cipres/CipresJobTest.java b/test/jalview/ext/cipres/CipresJobTest.java new file mode 100644 index 0000000..a1cd2df --- /dev/null +++ b/test/jalview/ext/cipres/CipresJobTest.java @@ -0,0 +1,70 @@ +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(); + + } +}