JAL-1213 JAL-674 robust test with an existing structure in the examples directory
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 4 Dec 2012 11:48:05 +0000 (11:48 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 4 Dec 2012 11:48:48 +0000 (11:48 +0000)
test/jalview/ext/jmol/PDBFileWithJmolTest.java

index 2b53822..39b679a 100644 (file)
@@ -7,6 +7,8 @@ import static org.junit.Assert.*;
 
 import java.util.Vector;
 
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 
 import org.junit.Test;
@@ -21,11 +23,18 @@ public class PDBFileWithJmolTest
   @Test
   public void test() throws Exception
   {
-    PDBFileWithJmol jtest=new PDBFileWithJmol("./examples/1vsp", jalview.io.AppletFormatAdapter.FILE);
+    PDBFileWithJmol jtest=new PDBFileWithJmol("./examples/1GAQ.txt", jalview.io.AppletFormatAdapter.FILE);
     Vector<SequenceI> seqs=jtest.getSeqs();
-    assertTrue("No sequences extracted from testfile", seqs!=null && seqs.size()>0);
-    assertTrue("No annotation generated.", seqs.get(0).getAnnotation()!=null && seqs.get(0).getAnnotation().length!=0);
     
+    assertTrue("No sequences extracted from testfile\n"+(jtest.hasWarningMessage() ? jtest.getWarningMessage(): "(No warnings raised)"), seqs!=null && seqs.size()>0);
+    for (SequenceI sq:seqs)
+    {
+      AlignmentI al = new Alignment(new SequenceI[] { sq});
+      if (!al.isNucleotide())
+      {
+        assertTrue("No secondary structure assigned for protein sequence.",sq.getAnnotation()!=null && sq.getAnnotation().length>=1 && sq.getAnnotation()[0].hasIcons);
+      }
+    }
   }
 
 }