From bd27a7d65bdaa5a32e23f2641d1ea1f1238a0899 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Thu, 1 Feb 2018 19:26:50 +0000 Subject: [PATCH] JAL-2890 added test --- test/jalview/ext/cipres/CipresJobTest.java | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 test/jalview/ext/cipres/CipresJobTest.java 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(); + + } +} -- 1.7.10.2