JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / test / jalview / ws / jabaws / JpredJabaStructExportImport.java
index 7afaeed..6f78f04 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  */
 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.datamodel.AlignmentI;
 import jalview.gui.Jalview2XML;
@@ -50,6 +35,21 @@ 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
 {
   public static String testseqs = "examples/uniref50.fa";
@@ -62,7 +62,7 @@ public class JpredJabaStructExportImport
 
   public static jalview.gui.AlignFrame af = null;
 
-  @BeforeClass
+  @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
 
@@ -71,7 +71,6 @@ public class JpredJabaStructExportImport
 
     for (Jws2Instance svc : disc.getServices())
     {
-
       if (svc.getServiceTypeURI().toLowerCase().contains("jpred"))
       {
         jpredws = svc;
@@ -79,18 +78,10 @@ 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
@@ -103,7 +94,7 @@ public class JpredJabaStructExportImport
     }
   }
 
-  @Test
+  @Test(groups = { "Functional" })
   public void testJPredStructOneSeqOnly()
   {
     af.selectAllSequenceMenuItem_actionPerformed(null);
@@ -144,7 +135,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 +146,7 @@ public class JpredJabaStructExportImport
 
   }
 
-  @Test
+  @Test(groups = { "Functional" })
   public void testJPredStructExport()
   {
 
@@ -221,15 +212,15 @@ public class JpredJabaStructExportImport
     {
       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<compbio.metadata.Argument> opts = new ArrayList<compbio.metadata.Argument>();
     for (compbio.metadata.Argument rg : (List<compbio.metadata.Argument>) jpredws
             .getRunnerConfig().getArguments())
@@ -241,7 +232,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);