JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / test / jalview / ext / paradise / TestAnnotate3D.java
index a7c439f..fc934b2 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 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.
  * 
@@ -20,7 +20,8 @@
  */
 package jalview.ext.paradise;
 
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
+
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 import jalview.io.FastaFile;
@@ -31,8 +32,9 @@ import java.io.File;
 import java.io.Reader;
 import java.util.Iterator;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
 
 import MCview.PDBfile;
 
@@ -41,7 +43,7 @@ import compbio.util.FileUtil;
 public class TestAnnotate3D
 {
 
-  @Test
+  @Test(groups = { "Functional" }, enabled = false)
   public void test1GIDbyId() throws Exception
   {
     // use same ID as standard tests given at
@@ -51,7 +53,7 @@ public class TestAnnotate3D
     testRNAMLcontent(ids, null);
   }
 
-  @Test
+  @Test(groups = { "Functional" }, enabled = false)
   public void testIdVsContent2GIS() throws Exception
   {
     Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
@@ -95,7 +97,7 @@ public class TestAnnotate3D
    * 
    * @throws Exception
    */
-  @Test
+  @Test(groups = { "Functional" }, enabled = false)
   public void testPDBfileVsRNAML() throws Exception
   {
     PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
@@ -109,6 +111,7 @@ public class TestAnnotate3D
     testRNAMLcontent(readers, pdbf);
   }
 
+  @Test(groups = { "Functional" }, enabled = false)
   private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
           throws Exception
   {
@@ -124,11 +127,12 @@ public class TestAnnotate3D
         sb.append(line + "\n");
       }
       assertTrue("No data returned by Annotate3D", sb.length() > 0);
-      AlignmentI al = new FormatAdapter().readFile(sb.toString(),
+      final String lines = sb.toString();
+      AlignmentI al = new FormatAdapter().readFile(lines,
               FormatAdapter.PASTE, "RNAML");
       if (al == null || al.getHeight() == 0)
       {
-        System.out.println(sb.toString());
+        System.out.println(lines);
       }
       assertTrue("No alignment returned.", al != null);
       assertTrue("No sequences in returned alignment.", al.getHeight() > 0);
@@ -141,8 +145,9 @@ public class TestAnnotate3D
             String sq_ = new String(sq.getSequence()).toLowerCase();
             for (SequenceI _struseq : pdbf.getSeqsAsArray())
             {
-              if (new String(_struseq.getSequence()).toLowerCase().equals(
-                      sq_))
+              final String lowerCase = new String(_struseq.getSequence())
+                      .toLowerCase();
+              if (lowerCase.equals(sq_))
               {
                 struseq = _struseq;
                 break;
@@ -150,11 +155,13 @@ public class TestAnnotate3D
             }
             if (struseq == null)
             {
-              Assert.fail("Couldn't find this sequence in original input:\n"
-                      + new FastaFile().print(new SequenceI[]
-                      { sq })
-                      + "\n\nOriginal input:\n"
-                      + new FastaFile().print(pdbf.getSeqsAsArray()) + "\n");
+              AssertJUnit
+                      .fail("Couldn't find this sequence in original input:\n"
+                              + new FastaFile()
+                                      .print(new SequenceI[] { sq })
+                              + "\n\nOriginal input:\n"
+                              + new FastaFile().print(pdbf.getSeqsAsArray())
+                              + "\n");
             }
           }
         }