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/mchmmer' into merge/wsinterfaces_mchmmer_JAL-3070_JAL-1950
[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
28a44d3
..
6698ed1
100644
(file)
--- a/
test/jalview/ws/jabaws/DisorderAnnotExportImport.java
+++ b/
test/jalview/ws/jabaws/DisorderAnnotExportImport.java
@@
-26,6
+26,7
@@
import static org.testng.AssertJUnit.assertTrue;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.gui.JvOptionPane;
import jalview.io.AnnotationFile;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.AnnotationFile;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
@@
-43,9
+44,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 = { "External" })
+/*
+ * 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;
@@
-56,16
+69,23
@@
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
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
Cache.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
public static void setUpBeforeClass() throws Exception
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
Cache.initLogger();
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
- iupreds = new ArrayList<Jws2Instance>();
+
+ while (disc.isRunning())
+ {
+ // don't get services until discoverer has finished
+ Thread.sleep(100);
+ }
+
+ iupreds = new ArrayList<>();
for (Jws2Instance svc : disc.getServices())
{
for (Jws2Instance svc : disc.getServices())
{
- if (svc.getServiceTypeURI().toLowerCase().contains("iupredws"))
+ if (svc.getNameURI().toLowerCase().contains("iupredws"))
{
iupreds.add(svc);
}
{
iupreds.add(svc);
}
@@
-91,7
+111,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);
@@
-109,7
+129,7
@@
public class DisorderAnnotExportImport
AlignmentI orig_alig = af.getViewport().getAlignment();
// NOTE: Consensus annotation row cannot be exported and reimported
// faithfully - so we remove them
AlignmentI orig_alig = af.getViewport().getAlignment();
// NOTE: Consensus annotation row cannot be exported and reimported
// faithfully - so we remove them
- List<AlignmentAnnotation> toremove = new ArrayList<AlignmentAnnotation>();
+ List<AlignmentAnnotation> toremove = new ArrayList<>();
for (AlignmentAnnotation aa : orig_alig.getAlignmentAnnotation())
{
if (aa.autoCalculated)
for (AlignmentAnnotation aa : orig_alig.getAlignmentAnnotation())
{
if (aa.autoCalculated)
@@
-121,16
+141,16
@@
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);
assertTrue(
String anfileout = new AnnotationFile()
.printAnnotationsForAlignment(al);
assertTrue(
@@
-157,7
+177,8
@@
public class DisorderAnnotExportImport
DataSourceType.PASTE));
// test for consistency in io
DataSourceType.PASTE));
// test for consistency in io
- StockholmFileTest.testAlignmentEquivalence(al, al_new, true);
+ StockholmFileTest.testAlignmentEquivalence(al, al_new, true, false,
+ false);
return;
} catch (Exception e)
{
return;
} catch (Exception e)
{