From c4f2c93aad9ca22e6346fc13d74df5c96f4f664e Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 4 Dec 2012 11:48:05 +0000 Subject: [PATCH] JAL-1213 JAL-674 robust test with an existing structure in the examples directory --- test/jalview/ext/jmol/PDBFileWithJmolTest.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/jalview/ext/jmol/PDBFileWithJmolTest.java b/test/jalview/ext/jmol/PDBFileWithJmolTest.java index 2b53822..39b679a 100644 --- a/test/jalview/ext/jmol/PDBFileWithJmolTest.java +++ b/test/jalview/ext/jmol/PDBFileWithJmolTest.java @@ -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 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); + } + } } } -- 1.7.10.2