git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2326 added setup method for JvOptionPane in all Jalveiw test classes to enable...
[jalview.git]
/
test
/
jalview
/
ext
/
paradise
/
TestAnnotate3D.java
diff --git
a/test/jalview/ext/paradise/TestAnnotate3D.java
b/test/jalview/ext/paradise/TestAnnotate3D.java
index
d2322ef
..
1b70e8d
100644
(file)
--- 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.8.2)
- * Copyright (C) 2014 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.
*
*
* This file is part of Jalview.
*
@@
-20,11
+20,11
@@
*/
package jalview.ext.paradise;
*/
package jalview.ext.paradise;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
-import jalview.ext.paradise.Annotate3D;
+import jalview.gui.JvOptionPane;
import jalview.io.FastaFile;
import jalview.io.FormatAdapter;
import jalview.io.FastaFile;
import jalview.io.FormatAdapter;
@@
-33,8
+33,10
@@
import java.io.File;
import java.io.Reader;
import java.util.Iterator;
import java.io.Reader;
import java.util.Iterator;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
import MCview.PDBfile;
import MCview.PDBfile;
@@
-43,7
+45,14
@@
import compbio.util.FileUtil;
public class TestAnnotate3D
{
public class TestAnnotate3D
{
- @Test
+ @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
public void test1GIDbyId() throws Exception
{
// use same ID as standard tests given at
@@
-53,7
+62,7
@@
public class TestAnnotate3D
testRNAMLcontent(ids, null);
}
testRNAMLcontent(ids, null);
}
- @Test
+ @Test(groups = { "Network" }, enabled = true)
public void testIdVsContent2GIS() throws Exception
{
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
public void testIdVsContent2GIS() throws Exception
{
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("2GIS");
@@
-72,9
+81,13
@@
public class TestAnnotate3D
iline = id.readLine();
fline = file.readLine();
if (iline != null)
iline = id.readLine();
fline = file.readLine();
if (iline != null)
+ {
System.out.println(iline);
System.out.println(iline);
+ }
if (fline != null)
if (fline != null)
+ {
System.out.println(fline);
System.out.println(fline);
+ }
// next assert fails for latest RNAview - because the XMLID entries
// change between file and ID based RNAML generation.
assertTrue(
// next assert fails for latest RNAview - because the XMLID entries
// change between file and ID based RNAML generation.
assertTrue(
@@
-93,10
+106,11
@@
public class TestAnnotate3D
*
* @throws Exception
*/
*
* @throws Exception
*/
- @Test
+ @Test(groups = { "Network" }, enabled = true)
public void testPDBfileVsRNAML() throws Exception
{
public void testPDBfileVsRNAML() throws Exception
{
- PDBfile pdbf = new PDBfile(true,true,"examples/2GIS.pdb", FormatAdapter.FILE);
+ PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
+ FormatAdapter.FILE);
Assert.assertTrue(pdbf.isValid());
// Comment - should add new FileParse constructor like new FileParse(Reader
// ..). for direct reading
Assert.assertTrue(pdbf.isValid());
// Comment - should add new FileParse constructor like new FileParse(Reader
// ..). for direct reading
@@
-121,11
+135,12
@@
public class TestAnnotate3D
sb.append(line + "\n");
}
assertTrue("No data returned by Annotate3D", sb.length() > 0);
sb.append(line + "\n");
}
assertTrue("No data returned by Annotate3D", sb.length() > 0);
- AlignmentI al = new FormatAdapter().readFile(sb.toString(),
+ final String lines = sb.toString();
+ AlignmentI al = new FormatAdapter().readFile(lines,
FormatAdapter.PASTE, "RNAML");
if (al == null || al.getHeight() == 0)
{
FormatAdapter.PASTE, "RNAML");
if (al == null || al.getHeight() == 0)
{
- System.out.println(sb.toString());
+ System.out.println(lines);
}
assertTrue("No alignment returned.", al != null);
assertTrue("No sequences in returned alignment.", al.getHeight() > 0);
}
assertTrue("No alignment returned.", al != null);
assertTrue("No sequences in returned alignment.", al.getHeight() > 0);
@@
-138,8
+153,9
@@
public class TestAnnotate3D
String sq_ = new String(sq.getSequence()).toLowerCase();
for (SequenceI _struseq : pdbf.getSeqsAsArray())
{
String sq_ = new String(sq.getSequence()).toLowerCase();
for (SequenceI _struseq : pdbf.getSeqsAsArray())
{
- if (new String(_struseq.getSequence()).toLowerCase().equals(
- sq_))
+ final String lowerCase = new String(_struseq.getSequence())
+ .toLowerCase();
+ if (lowerCase.equals(sq_))
{
struseq = _struseq;
break;
{
struseq = _struseq;
break;
@@
-147,11
+163,13
@@
public class TestAnnotate3D
}
if (struseq == null)
{
}
if (struseq == null)
{
- Assert.fail("Couldn't find this sequence in original input:\n"
- + new FastaFile().print(new SequenceI[]
- { sq })
- + "\n\nOriginal input:\n"
- + new FastaFile().print(pdbf.getSeqsAsArray()) + "\n");
+ AssertJUnit
+ .fail("Couldn't find this sequence in original input:\n"
+ + new FastaFile()
+ .print(new SequenceI[] { sq })
+ + "\n\nOriginal input:\n"
+ + new FastaFile().print(pdbf.getSeqsAsArray())
+ + "\n");
}
}
}
}
}
}