+ String[] testFile = new String[] { "./examples/1GAQ.txt",
+ "./test/jalview/ext/jmol/1QCF.pdb" }; // ,
+
+ // "./examples/DNMT1_MOUSE.pdb"
+ // };
+
+ @BeforeMethod(alwaysRun = true)
+ public void setUp()
+ {
+ Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
+ Boolean.TRUE.toString());
+ Cache.applicationProperties.setProperty("ADD_SS_ANN",
+ Boolean.TRUE.toString());
+ }
+
+ @Test(groups = { "Functional" })
+ public void testAlignmentLoader() throws Exception
+ {
+ for (String f : testFile)
+ {
+ FileLoader fl = new jalview.io.FileLoader(false);
+ AlignFrame af = fl
+ .LoadFileWaitTillLoaded(f, AppletFormatAdapter.FILE);
+ validateSecStrRows(af.getViewport().getAlignment());
+ }
+ }
+
+ @Test(groups = { "Functional" })
+ public void testFileParser() throws Exception
+ {
+ for (String pdbStr : testFile)
+ {
+ PDBfile mctest = new PDBfile(false, false, false, pdbStr,
+ AppletFormatAdapter.FILE);
+ PDBFileWithJmol jtest = new PDBFileWithJmol(pdbStr,
+ jalview.io.AppletFormatAdapter.FILE);
+ Vector<SequenceI> seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs();
+
+ assertTrue(
+ "No sequences extracted from testfile\n"
+ + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
+ : "(No warnings raised)"), seqs != null
+ && seqs.size() > 0);
+ for (SequenceI sq : seqs)
+ {
+ assertEquals("JMol didn't process " + pdbStr
+ + " to the same sequence as MCView",
+ sq.getSequenceAsString(), mcseqs.remove(0)
+ .getSequenceAsString());
+ AlignmentI al = new Alignment(new SequenceI[] { sq });
+ validateSecStrRows(al);
+ }
+ }
+ }