1 package jalview.ext.cipres;
3 import static org.testng.Assert.assertFalse;
4 import static org.testng.Assert.assertNull;
5 import static org.testng.Assert.assertTrue;
7 import jalview.gui.JvOptionPane;
9 import java.util.Arrays;
11 import org.testng.annotations.BeforeClass;
12 import org.testng.annotations.Test;
14 public class CipresJobTest
19 public void setUpJvOptionPane()
21 JvOptionPane.setInteractiveMode(false);
22 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
28 public void testSettingJobParameters()
30 CipresJob testJob = new CipresJob("examples/plantfdx.fa");
31 testJob.addToolParameters("runtime_", Arrays.asList("0.3"));
32 testJob.addInputParameter("test", "hoi");
33 testJob.addMetadata("hennepin", "crawler");
34 assertFalse(testJob.areParamsValidated());
36 testJob.clearAllParameters();
37 assertNull(testJob.getvParams().get("runtime_"));
46 public void testValidatingParameters()
48 CipresJob testJob = new CipresJob("examples/plantfdx.fa", "CLUSTALW");
49 testJob.addToolParameters("runtime_", Arrays.asList("0.2"));
50 testJob.addMetadata("clientJobId", "101");
51 testJob.validateJobParams();
52 assertTrue(testJob.areParamsValidated());
60 public void testJobSubmission()
62 CipresJob testJob = new CipresJob("examples/plantfdx.fa", "CLUSTALW");
63 testJob.addToolParameters("runtime_", Arrays.asList("0.2"));
64 testJob.addMetadata("clientJobId", "102");
65 testJob.addMetadata("statusEmail", "false");
66 testJob.addMetadata("clientJobName", "test_job");
68 assertTrue(testJob.areParamsValidated());