X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FAnnotatedPDBFileInputTest.java;h=86fc236b4d35eb7558e6e4a3dc43b60f74fcfa8e;hb=5f4e1e4c330b045e9c8bce28ee132a0fca3834d8;hp=4b10ab80720839dcd17dcb8793072fbc2c4ec39e;hpb=8f118c154e74caaef6bec19acd0466904ac424d4;p=jalview.git diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index 4b10ab8..86fc236 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -31,10 +31,12 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; +import jalview.structure.StructureImportSettings; +import jalview.structure.StructureImportSettings.StructureParser; import java.io.File; -import org.junit.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; @@ -43,6 +45,13 @@ import org.testng.annotations.Test; public class AnnotatedPDBFileInputTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + AlignmentI al; String pdbId; @@ -66,6 +75,9 @@ public class AnnotatedPDBFileInputTest al = af.getViewport().getAlignment(); pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries() .get(0).getId(); + StructureImportSettings.setDefaultStructureFileFormat("PDB"); + // StructureImportSettings + // .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER); } @Test(groups = { "Functional" }) @@ -81,8 +93,8 @@ public class AnnotatedPDBFileInputTest { for (int q = p + 1; q < avec.length; q++) { - Assert.assertNotEquals("Found a duplicate annotation row " - + avec[p].label, avec[p], avec[q]); + assertTrue("Found a duplicate annotation row " + avec[p].label, + avec[p] != avec[q]); } } } @@ -97,7 +109,11 @@ public class AnnotatedPDBFileInputTest { System.out.println("CalcId: " + aa.getCalcId()); - assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId)); + if (StructureImportSettings.getDefaultPDBFileParser().equals( + StructureParser.JALVIEW_PARSER)) + { + assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId)); + } } } } @@ -181,7 +197,7 @@ public class AnnotatedPDBFileInputTest /** * @throws java.lang.Exception */ - @AfterClass + @AfterClass(alwaysRun = true) public static void tearDownAfterClass() throws Exception { jalview.gui.Desktop.instance.closeAll_actionPerformed(null); @@ -213,8 +229,8 @@ public class AnnotatedPDBFileInputTest sq = sq.getDatasetSequence(); } assertNotNull(sq.getAllPDBEntries()); - assertEquals("Expected only one PDB ID", - sq.getAllPDBEntries().size(), 1); + assertEquals("Expected only one PDB ID", 1, sq.getAllPDBEntries() + .size()); for (PDBEntry pdbentry : sq.getAllPDBEntries()) { System.err.println("PDB Entry " + pdbentry.getId() + " "