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
Merge branch 'features/JAL-3895_alphafoldcolours' into features/r2_11_2_alphafold...
[jalview.git]
/
test
/
jalview
/
ws
/
jabaws
/
DisorderAnnotExportImport.java
diff --git
a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java
b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java
index
35d5ccd
..
629b6c3
100644
(file)
--- a/
test/jalview/ws/jabaws/DisorderAnnotExportImport.java
+++ b/
test/jalview/ws/jabaws/DisorderAnnotExportImport.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * 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.
*
*
* This file is part of Jalview.
*
@@
-20,12
+20,19
@@
*/
package jalview.ws.jabaws;
*/
package jalview.ws.jabaws;
+import java.util.Locale;
+
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
+import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.gui.JvOptionPane;
import jalview.io.AnnotationFile;
import jalview.io.AnnotationFile;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
import jalview.io.FormatAdapter;
import jalview.io.StockholmFileTest;
import jalview.ws.jws2.AADisorderClient;
import jalview.io.FormatAdapter;
import jalview.io.StockholmFileTest;
import jalview.ws.jws2.AADisorderClient;
@@
-40,9
+47,21
@@
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-@Test(groups = { "Network" })
+/*
+ * All methods in this class are set to the Network group because setUpBeforeClass will fail
+ * if there is no network.
+ */
+@Test(singleThreaded = true)
public class DisorderAnnotExportImport
{
public class DisorderAnnotExportImport
{
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
public static String testseqs = "examples/uniref50.fa";
public static Jws2Discoverer disc;
public static String testseqs = "examples/uniref50.fa";
public static Jws2Discoverer disc;
@@
-53,16
+72,24
@@
public class DisorderAnnotExportImport
public static jalview.gui.AlignFrame af = null;
public static jalview.gui.AlignFrame af = null;
- @BeforeClass(inheritGroups = true)
+ @BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
public static void setUpBeforeClass() throws Exception
{
-
- jalview.bin.Cache.initLogger();
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ Console.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
+
+ while (disc.isRunning())
+ {
+ // don't get services until discoverer has finished
+ Thread.sleep(100);
+ }
+
iupreds = new ArrayList<Jws2Instance>();
for (Jws2Instance svc : disc.getServices())
{
iupreds = new ArrayList<Jws2Instance>();
for (Jws2Instance svc : disc.getServices())
{
- if (svc.getServiceTypeURI().toLowerCase().contains("iupredws"))
+ if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT)
+ .contains("iupredws"))
{
iupreds.add(svc);
}
{
iupreds.add(svc);
}
@@
-70,7
+97,8
@@
public class DisorderAnnotExportImport
assertTrue("Couldn't discover any IUPred services to use to test.",
iupreds.size() > 0);
jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
assertTrue("Couldn't discover any IUPred services to use to test.",
iupreds.size() > 0);
jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
- af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.FormatAdapter.FILE);
+ af = fl.LoadFileWaitTillLoaded(testseqs,
+ jalview.io.DataSourceType.FILE);
assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
}
assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
}
@@
-88,7
+116,7
@@
public class DisorderAnnotExportImport
/**
* test for patches to JAL-1294
*/
/**
* test for patches to JAL-1294
*/
- @Test
+ @Test(groups = { "External", "Network" })
public void testDisorderAnnotExport()
{
disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);
public void testDisorderAnnotExport()
{
disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);
@@
-118,50
+146,44
@@
public class DisorderAnnotExportImport
{
orig_alig.deleteAnnotation(aa);
}
{
orig_alig.deleteAnnotation(aa);
}
- testAnnotationFileIO("Testing IUPred Annotation IO", orig_alig);
+ checkAnnotationFileIO("Testing IUPred Annotation IO", orig_alig);
}
}
- public static void testAnnotationFileIO(String testname, AlignmentI al)
+ static void checkAnnotationFileIO(String testname, AlignmentI al)
{
try
{
{
try
{
- String aligfileout = new FormatAdapter().formatSequences("PFAM",
- al.getSequencesArray());
+ String aligfileout = FileFormat.Pfam.getWriter(al)
+ .print(al.getSequencesArray(), true);
String anfileout = new AnnotationFile()
.printAnnotationsForAlignment(al);
String anfileout = new AnnotationFile()
.printAnnotationsForAlignment(al);
- assertTrue(
- "Test "
- + testname
- + "\nAlignment annotation file was not regenerated. Null string",
+ assertTrue("Test " + testname
+ + "\nAlignment annotation file was not regenerated. Null string",
anfileout != null);
anfileout != null);
- assertTrue(
- "Test "
- + testname
- + "\nAlignment annotation file was not regenerated. Empty string",
+ assertTrue("Test " + testname
+ + "\nAlignment annotation file was not regenerated. Empty string",
anfileout.length() > "JALVIEW_ANNOTATION".length());
anfileout.length() > "JALVIEW_ANNOTATION".length());
- System.out.println("Output annotation file:\n" + anfileout
- + "\n<<EOF\n");
+ System.out.println(
+ "Output annotation file:\n" + anfileout + "\n<<EOF\n");
AlignmentI al_new = new FormatAdapter().readFile(aligfileout,
AlignmentI al_new = new FormatAdapter().readFile(aligfileout,
- FormatAdapter.PASTE, "PFAM");
- assertTrue(
- "Test "
- + testname
- + "\nregenerated annotation file did not annotate alignment.",
+ DataSourceType.PASTE, FileFormat.Pfam);
+ assertTrue("Test " + testname
+ + "\nregenerated annotation file did not annotate alignment.",
new AnnotationFile().readAnnotationFile(al_new, anfileout,
new AnnotationFile().readAnnotationFile(al_new, anfileout,
- FormatAdapter.PASTE));
+ DataSourceType.PASTE));
// test for consistency in io
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, true);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, true, false,
+ false);
return;
} catch (Exception e)
{
e.printStackTrace();
}
return;
} catch (Exception e)
{
e.printStackTrace();
}
- Assert.fail("Test "
- + testname
+ Assert.fail("Test " + testname
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}
+ "\nCouldn't complete Annotation file roundtrip input/output/input test.");
}