X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fparadise%2FTestAnnotate3D.java;h=7d0916bd6967ebb229b786415ca24c00c9d8ccd3;hb=ab0e5f2223a993371761baf240d815abdfcbb950;hp=e2b6e0ffbcefe19f20f95b802891cca392212670;hpb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;p=jalview.git diff --git a/test/jalview/ext/paradise/TestAnnotate3D.java b/test/jalview/ext/paradise/TestAnnotate3D.java index e2b6e0f..7d0916b 100644 --- a/test/jalview/ext/paradise/TestAnnotate3D.java +++ b/test/jalview/ext/paradise/TestAnnotate3D.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -24,7 +24,10 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; import jalview.io.FastaFile; +import jalview.io.FileFormat; import jalview.io.FormatAdapter; import java.io.BufferedReader; @@ -34,16 +37,23 @@ import java.util.Iterator; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import MCview.PDBfile; - import compbio.util.FileUtil; +import mc_view.PDBfile; public class TestAnnotate3D { - @Test(groups = { "Functional" }, enabled = false) + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + + @Test(groups = { "Network" }, enabled = true) public void test1GIDbyId() throws Exception { // use same ID as standard tests given at @@ -53,7 +63,7 @@ public class TestAnnotate3D testRNAMLcontent(ids, null); } - @Test(groups = { "Functional" }, enabled = false) + @Test(groups = { "Network" }, enabled = true) public void testIdVsContent2GIS() throws Exception { Iterator ids = Annotate3D.getRNAMLForPDBId("2GIS"); @@ -97,11 +107,11 @@ public class TestAnnotate3D * * @throws Exception */ - @Test(groups = { "Functional" }, enabled = false) + @Test(groups = { "Network" }, enabled = true) public void testPDBfileVsRNAML() throws Exception { PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb", - FormatAdapter.FILE); + DataSourceType.FILE); Assert.assertTrue(pdbf.isValid()); // Comment - should add new FileParse constructor like new FileParse(Reader // ..). for direct reading @@ -111,7 +121,6 @@ public class TestAnnotate3D testRNAMLcontent(readers, pdbf); } - @Test(groups = { "Functional" }, enabled = false) private void testRNAMLcontent(Iterator readers, PDBfile pdbf) throws Exception { @@ -129,7 +138,7 @@ public class TestAnnotate3D assertTrue("No data returned by Annotate3D", sb.length() > 0); final String lines = sb.toString(); AlignmentI al = new FormatAdapter().readFile(lines, - FormatAdapter.PASTE, "RNAML"); + DataSourceType.PASTE, FileFormat.Rnaml); if (al == null || al.getHeight() == 0) { System.out.println(lines); @@ -142,10 +151,10 @@ public class TestAnnotate3D { { SequenceI struseq = null; - String sq_ = new String(sq.getSequence()).toLowerCase(); + String sq_ = sq.getSequenceAsString().toLowerCase(); for (SequenceI _struseq : pdbf.getSeqsAsArray()) { - final String lowerCase = new String(_struseq.getSequence()) + final String lowerCase = _struseq.getSequenceAsString() .toLowerCase(); if (lowerCase.equals(sq_)) { @@ -157,11 +166,11 @@ public class TestAnnotate3D { AssertJUnit .fail("Couldn't find this sequence in original input:\n" - + new FastaFile() - .print(new SequenceI[] { sq }) + + new FastaFile().print( + new SequenceI[] { sq }, true) + "\n\nOriginal input:\n" - + new FastaFile().print(pdbf.getSeqsAsArray()) - + "\n"); + + new FastaFile().print( + pdbf.getSeqsAsArray(), true) + "\n"); } } }