X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fparadise%2FTestAnnotate3D.java;h=679385ac5f04acf15ece7518642a4f609d11051e;hb=db4eacee27b836db4126dca551887bfc6652d72a;hp=896b60cc71a664ae456c888181546ba40147de43;hpb=69fff62bcf225887bbee81057099317a647be9be;p=jalview.git
diff --git a/test/jalview/ext/paradise/TestAnnotate3D.java b/test/jalview/ext/paradise/TestAnnotate3D.java
index 896b60c..679385a 100644
--- a/test/jalview/ext/paradise/TestAnnotate3D.java
+++ b/test/jalview/ext/paradise/TestAnnotate3D.java
@@ -1,10 +1,29 @@
+/*
+ * 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.paradise;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
-import jalview.ext.paradise.Annotate3D;
import jalview.io.FastaFile;
import jalview.io.FormatAdapter;
@@ -13,8 +32,9 @@ import java.io.File;
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.Test;
import MCview.PDBfile;
@@ -23,16 +43,17 @@ import compbio.util.FileUtil;
public class TestAnnotate3D
{
- @Test
+ @Test(groups = { "Functional" }, enabled = false)
public void test1GIDbyId() throws Exception
{
- // use same ID as standard tests given at https://bitbucket.org/fjossinet/pyrna-rest-clients
+ // use same ID as standard tests given at
+ // https://bitbucket.org/fjossinet/pyrna-rest-clients
Iterator ids = Annotate3D.getRNAMLForPDBId("1GID");
assertTrue("Didn't retrieve 1GID by id.", ids != null);
- testRNAMLcontent(ids,null);
+ testRNAMLcontent(ids, null);
}
- @Test
+ @Test(groups = { "Functional" }, enabled = false)
public void testIdVsContent2GIS() throws Exception
{
Iterator ids = Annotate3D.getRNAMLForPDBId("2GIS");
@@ -51,9 +72,13 @@ public class TestAnnotate3D
iline = id.readLine();
fline = file.readLine();
if (iline != null)
+ {
System.out.println(iline);
+ }
if (fline != null)
+ {
System.out.println(fline);
+ }
// next assert fails for latest RNAview - because the XMLID entries
// change between file and ID based RNAML generation.
assertTrue(
@@ -72,10 +97,11 @@ public class TestAnnotate3D
*
* @throws Exception
*/
- @Test
+ @Test(groups = { "Functional" }, enabled = false)
public void testPDBfileVsRNAML() throws Exception
{
- PDBfile pdbf = new PDBfile("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
@@ -85,6 +111,7 @@ public class TestAnnotate3D
testRNAMLcontent(readers, pdbf);
}
+ @Test(groups = { "Functional" }, enabled = false)
private void testRNAMLcontent(Iterator readers, PDBfile pdbf)
throws Exception
{
@@ -100,10 +127,12 @@ public class TestAnnotate3D
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) {
- System.out.println(sb.toString());
+ if (al == null || al.getHeight() == 0)
+ {
+ System.out.println(lines);
}
assertTrue("No alignment returned.", al != null);
assertTrue("No sequences in returned alignment.", al.getHeight() > 0);
@@ -116,8 +145,9 @@ public class TestAnnotate3D
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;
@@ -125,11 +155,13 @@ public class TestAnnotate3D
}
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");
}
}
}