JAL-1805 test envirionment separation
[jalview.git] / test / jalview / structure / Mapping.java
index b0144fc..c057980 100644 (file)
@@ -1,8 +1,8 @@
 package jalview.structure;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.Sequence;
@@ -11,8 +11,9 @@ import jalview.gui.AlignFrame;
 import jalview.io.FileLoader;
 import jalview.io.FormatAdapter;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
 
 import MCview.PDBfile;
 
@@ -26,10 +27,11 @@ public class Mapping
    * 115 in PDB Res Numbering secondary structure numbers in jmol seem to be in
    * msd numbering, not pdb res numbering.
    */
-  @Test
+  @Test(groups =
+  { "Functional" }, enabled = false)
   public void pdbEntryPositionMap() throws Exception
   {
-    fail("This test intentionally left to fail");
+    Assert.fail("This test intentionally left to fail");
     for (int offset = 0; offset < 20; offset += 6)
     {
       // check we put the secondary structure in the right position
@@ -108,10 +110,11 @@ public class Mapping
     }
   }
 
-  @Test
+  @Test(groups =
+  { "Functional" }, enabled = false)
   public void testPDBentryMapping() throws Exception
   {
-    fail("This test intentionally left to fail");
+    Assert.fail("This test intentionally left to fail");
     Sequence sq = new Sequence(
             "1GAQ A subseq 126 to 219",
             "EIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPNATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKM");
@@ -209,7 +212,7 @@ public class Mapping
    * transform
    * 
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void mapFer1From3W5V() throws Exception
   {
     AlignFrame seqf = new FileLoader(false)
@@ -224,7 +227,7 @@ public class Mapping
             jalview.io.FormatAdapter.FILE);
     if (pmap == null)
     {
-      Assert.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE");
+      AssertJUnit.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE");
     }
   }
 
@@ -232,7 +235,7 @@ public class Mapping
    * compare reference annotation for imported pdb sequence to identical
    * seuqence with transferred annotation from mapped pdb file
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void compareTransferredToRefPDBAnnot() throws Exception
   {
     AlignFrame ref = new FileLoader(false)
@@ -245,6 +248,8 @@ public class Mapping
     newseq.setStart(refseq.getStart() + 25);
     newseq.setEnd(refseq.getLength() + 25 + refseq.getStart());
     StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager();
+    ssm.setProcessSecondaryStructure(true);
+    ssm.setAddTempFacAnnot(true);
     PDBfile pmap = ssm.setMapping(true, new SequenceI[]
     { newseq }, new String[]
     { null }, "test/jalview/ext/jmol/1QCF.pdb",
@@ -252,7 +257,9 @@ public class Mapping
     assertTrue(pmap != null);
     assertEquals("Original and copied sequence of different lengths.",
             refseq.getLength(), newseq.getLength());
-    assertTrue(refseq.getAnnotation().length > 0
+    assertTrue(refseq.getAnnotation() != null
+            && refseq.getAnnotation().length > 0);
+    assertTrue(newseq.getAnnotation() != null
             && newseq.getAnnotation().length > 0);
     for (AlignmentAnnotation oannot : refseq.getAnnotation())
     {