X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fjmol%2FJmolVsJalviewPDBParserEndToEndTest.java;h=d285b04f9d04e39122e93bdb51bec6a72620db5f;hb=17fa35af8bae6956fdee231e10ef5928f34ca810;hp=c984b3a8aa53f2b2113d578822afeddbdf7fd41d;hpb=ce6f02a53c98e51cb96533d40db5f94d1bfea00a;p=jalview.git diff --git a/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java b/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java index c984b3a..d285b04 100644 --- a/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java +++ b/test/jalview/ext/jmol/JmolVsJalviewPDBParserEndToEndTest.java @@ -1,7 +1,28 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.ext.jmol; import jalview.datamodel.SequenceI; -import jalview.io.AppletFormatAdapter; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; import java.io.File; import java.io.IOException; @@ -9,6 +30,8 @@ import java.util.HashSet; import java.util.Set; import java.util.Vector; +import org.testng.annotations.BeforeClass; + import MCview.PDBfile; /** @@ -23,6 +46,13 @@ import MCview.PDBfile; public class JmolVsJalviewPDBParserEndToEndTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + public static void main(String[] args) { if (args == null || args[0] == null) @@ -51,9 +81,8 @@ public class JmolVsJalviewPDBParserEndToEndTest JmolParser jtest = null; try { - mctest = new PDBfile(false, false, false, testFile, - AppletFormatAdapter.FILE); - jtest = new JmolParser(testFile, AppletFormatAdapter.FILE); + mctest = new PDBfile(false, false, false, testFile, DataSourceType.FILE); + jtest = new JmolParser(testFile, DataSourceType.FILE); } catch (IOException e) { System.err.println("Exception thrown while parsing : " + pdbStr); @@ -65,15 +94,15 @@ public class JmolVsJalviewPDBParserEndToEndTest { try { - String testSeq = mcseqs.remove(0).getSequenceAsString(); + String testSeq = mcseqs.remove(0).getSequenceAsString(); if (!sq.getSequenceAsString().equals(testSeq)) - { - ++totalFail; + { + ++totalFail; System.err.println("Test Failed for " + pdbStr + ". Diff:"); - System.err.println(sq.getSequenceAsString()); - System.err.println(testSeq); - failedFiles.add(pdbStr); - } + System.err.println(sq.getSequenceAsString()); + System.err.println(testSeq); + failedFiles.add(pdbStr); + } ++totalSeqScanned; } catch (Exception e) {