X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fjabaws%2FJpredJabaStructExportImport.java;h=22cdd4c819f67cb048979a74c3e2465818d2bfd1;hb=5f4e1e4c330b045e9c8bce28ee132a0fca3834d8;hp=c522bc39b69e17afab2ce7eab709219adfadf78d;hpb=bc12a8c2d3727216f12bbf9ffd49cd137d19ad9a;p=jalview.git diff --git a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java index c522bc3..22cdd4c 100644 --- a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java +++ b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java @@ -20,26 +20,13 @@ */ package jalview.ws.jabaws; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.awt.Component; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.JMenu; -import javax.swing.JMenuItem; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import compbio.metadata.Argument; -import compbio.metadata.WrongParameterException; +import static org.testng.AssertJUnit.assertNotNull; +import static org.testng.AssertJUnit.assertTrue; +import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import jalview.io.AnnotationFile; import jalview.io.FormatAdapter; import jalview.io.StockholmFileTest; @@ -50,8 +37,31 @@ import jalview.ws.jws2.SequenceAnnotationWSClient; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.AutoCalcSetting; +import java.awt.Component; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JMenu; +import javax.swing.JMenuItem; + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import compbio.metadata.Argument; +import compbio.metadata.WrongParameterException; + public class JpredJabaStructExportImport { + + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static String testseqs = "examples/uniref50.fa"; public static Jws2Discoverer disc; @@ -62,16 +72,15 @@ public class JpredJabaStructExportImport public static jalview.gui.AlignFrame af = null; - @BeforeClass + @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { - - jalview.bin.Cache.initLogger(); + Cache.loadProperties("test/jalview/io/testProps.jvprops"); + Cache.initLogger(); disc = JalviewJabawsTestUtils.getJabawsDiscoverer(false); for (Jws2Instance svc : disc.getServices()) { - if (svc.getServiceTypeURI().toLowerCase().contains("jpred")) { jpredws = svc; @@ -79,21 +88,13 @@ public class JpredJabaStructExportImport } System.out.println("State of jpredws: " + jpredws); - - if (jpredws == null) - { - fail("jpredws is null"); - } - + Assert.assertNotNull(jpredws, "jpredws is null!"); jalview.io.FileLoader fl = new jalview.io.FileLoader(false); - af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.FormatAdapter.FILE); - assertNotNull("Couldn't load test data ('" + testseqs + "')", af); - } - @AfterClass + @AfterClass(alwaysRun = true) public static void tearDownAfterClass() throws Exception { if (af != null) @@ -103,7 +104,7 @@ public class JpredJabaStructExportImport } } - @Test + @Test(groups = { "Functional" }) public void testJPredStructOneSeqOnly() { af.selectAllSequenceMenuItem_actionPerformed(null); @@ -144,7 +145,7 @@ public class JpredJabaStructExportImport if (!success) { jpredClient.cancelCurrentJob(); - fail("Jpred Client didn't run with hardwired default parameters."); + Assert.fail("Jpred Client didn't run with hardwired default parameters."); } } catch (InterruptedException x) @@ -155,7 +156,7 @@ public class JpredJabaStructExportImport } - @Test + @Test(groups = { "Functional" }) public void testJPredStructExport() { @@ -215,21 +216,21 @@ public class JpredJabaStructExportImport FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, false); return; } catch (Exception e) { e.printStackTrace(); } - fail("Test " + Assert.fail("Test " + testname + "\nCouldn't complete Annotation file roundtrip input/output/input test."); } - // @Test + @Test(groups = { "Functional" }) public void testJpredwsSettingsRecovery() { - fail("not implemnented"); + Assert.fail("not implemnented"); List opts = new ArrayList(); for (compbio.metadata.Argument rg : (List) jpredws .getRunnerConfig().getArguments()) @@ -241,7 +242,7 @@ public class JpredJabaStructExportImport rg.setValue("292"); } catch (WrongParameterException q) { - fail("Couldn't set the temperature parameter " + Assert.fail("Couldn't set the temperature parameter " + q.getStackTrace()); } opts.add(rg);