import jalview.datamodel.AlignmentI;
import jalview.gui.JvOptionPane;
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 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 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();
+
+ while (disc.isRunning())
+ {
+ // don't get services until discoverer has finished
+ Thread.sleep(100);
+ }
+
iupreds = new ArrayList<Jws2Instance>();
for (Jws2Instance svc : disc.getServices())
{
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);
}
/**
* test for patches to JAL-1294
*/
- @Test
+ @Test(groups = { "External", "Network" })
public void testDisorderAnnotExport()
{
disorderClient = new AADisorderClient(iupreds.get(0), af, null, null);
{
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(
+ "\n<<EOF\n");
AlignmentI al_new = new FormatAdapter().readFile(aligfileout,
- FormatAdapter.PASTE, "PFAM");
+ DataSourceType.PASTE, FileFormat.Pfam);
assertTrue(
"Test "
+ testname
+ "\nregenerated annotation file did not annotate alignment.",
new AnnotationFile().readAnnotationFile(al_new, anfileout,
- FormatAdapter.PASTE));
+ 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)
{