JAL-1270 JUnit to TestNG refactoring
[jalview.git] / test / jalview / ext / paradise / TestAnnotate3D.java
index d2322ef..d4f57d8 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-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.ext.paradise;
 
-import static org.junit.Assert.assertTrue;
-
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SequenceI;
-import jalview.ext.paradise.Annotate3D;
-import jalview.io.FastaFile;
-import jalview.io.FormatAdapter;
+import static org.testng.AssertJUnit.assertTrue;
 
 import java.io.BufferedReader;
 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;
 
 import compbio.util.FileUtil;
 
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceI;
+import jalview.io.FastaFile;
+import jalview.io.FormatAdapter;
+
 public class TestAnnotate3D
 {
 
-  @Test
+  @Test(enabled = false)
   public void test1GIDbyId() throws Exception
   {
     // use same ID as standard tests given at
@@ -53,7 +53,7 @@ public class TestAnnotate3D
     testRNAMLcontent(ids, null);
   }
 
-  @Test
+  @Test(enabled = false)
   public void testIdVsContent2GIS() throws Exception
   {
     Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
@@ -72,9 +72,13 @@ public class TestAnnotate3D
         iline = id.readLine();
         fline = file.readLine();
         if (iline != null)
+        {
           System.out.println(iline);
+        }
         if (fline != null)
+        {
           System.out.println(fline);
+        }
         // next assert fails for latest RNAview - because the XMLID entries
         // change between file and ID based RNAML generation.
         assertTrue(
@@ -93,10 +97,11 @@ public class TestAnnotate3D
    * 
    * @throws Exception
    */
-  @Test
+  @Test(enabled = false)
   public void testPDBfileVsRNAML() throws Exception
   {
-    PDBfile pdbf = new PDBfile(true,true,"examples/2GIS.pdb", FormatAdapter.FILE);
+    PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
+            FormatAdapter.FILE);
     Assert.assertTrue(pdbf.isValid());
     // Comment - should add new FileParse constructor like new FileParse(Reader
     // ..). for direct reading
@@ -106,6 +111,7 @@ public class TestAnnotate3D
     testRNAMLcontent(readers, pdbf);
   }
 
+  @Test(enabled = false)
   private void testRNAMLcontent(Iterator<Reader> readers, PDBfile pdbf)
           throws Exception
   {
@@ -121,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);
@@ -138,7 +145,8 @@ public class TestAnnotate3D
             String sq_ = new String(sq.getSequence()).toLowerCase();
             for (SequenceI _struseq : pdbf.getSeqsAsArray())
             {
-              if (new String(_struseq.getSequence()).toLowerCase().equals(
+              final String lowerCase = new String(_struseq.getSequence()).toLowerCase();
+              if (lowerCase.equals(
                       sq_))
               {
                 struseq = _struseq;
@@ -147,7 +155,7 @@ public class TestAnnotate3D
             }
             if (struseq == null)
             {
-              Assert.fail("Couldn't find this sequence in original input:\n"
+              AssertJUnit.fail("Couldn't find this sequence in original input:\n"
                       + new FastaFile().print(new SequenceI[]
                       { sq })
                       + "\n\nOriginal input:\n"