file format enum wip changes
[jalview.git] / test / jalview / io / Jalview2xmlTests.java
index 38153df..3281db1 100644 (file)
@@ -104,7 +104,7 @@ public class Jalview2xmlTests
     String tfile = File.createTempFile("JalviewTest", ".jvp")
             .getAbsolutePath();
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            inFile, FormatAdapter.FILE);
+            inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
     int olddsann = countDsAnn(af.getViewport());
     assertTrue("Didn't find any dataset annotations", olddsann > 0);
@@ -113,11 +113,11 @@ public class Jalview2xmlTests
             "Couldn't apply RNA helices colourscheme",
             af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
     assertTrue("Failed to store as a project.",
-            af.saveAlignment(tfile, "Jalview"));
+            af.saveAlignment(tfile, FileFormat.Jalview));
     af.closeMenuItem_actionPerformed(true);
     af = null;
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     assertTrue("Failed to import new project", af != null);
     int newdsann = countDsAnn(af.getViewport());
     assertTrue(
@@ -139,9 +139,9 @@ public class Jalview2xmlTests
     String tfile = File.createTempFile("JalviewTest", ".jvp")
             .getAbsolutePath();
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            inFile, FormatAdapter.FILE);
+            inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
-    af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null, null);
+    af.loadJalviewDataFile(inAnnot, DataSourceType.FILE, null, null);
     assertTrue(
             "Didn't set T-coffee colourscheme",
             af.getViewport().getGlobalColourScheme().getClass()
@@ -154,11 +154,11 @@ public class Jalview2xmlTests
                             .getViewport().getGlobalColourScheme())) != null);
 
     assertTrue("Failed to store as a project.",
-            af.saveAlignment(tfile, "Jalview"));
+            af.saveAlignment(tfile, FileFormat.Jalview));
     af.closeMenuItem_actionPerformed(true);
     af = null;
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     assertTrue("Failed to import new project", af != null);
     assertTrue(
             "Didn't set T-coffee colourscheme for imported project.",
@@ -175,9 +175,9 @@ public class Jalview2xmlTests
     String tfile = File.createTempFile("JalviewTest", ".jvp")
             .getAbsolutePath();
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            inFile, FormatAdapter.FILE);
+            inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
-    af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null, null);
+    af.loadJalviewDataFile(inAnnot, DataSourceType.FILE, null, null);
     AlignmentAnnotation[] aa = af.getViewport().getAlignment()
             .getSequenceAt(0).getAnnotation("IUPredWS (Short)");
     assertTrue(
@@ -199,11 +199,11 @@ public class Jalview2xmlTests
     sg.addSequence(af.getViewport().getAlignment().getSequenceAt(2), true);
     af.alignPanel.alignmentChanged();
     assertTrue("Failed to store as a project.",
-            af.saveAlignment(tfile, "Jalview"));
+            af.saveAlignment(tfile, FileFormat.Jalview));
     af.closeMenuItem_actionPerformed(true);
     af = null;
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
-            FormatAdapter.FILE);
+            DataSourceType.FILE);
     assertTrue("Failed to import new project", af != null);
 
     // check for group and alignment colourschemes
@@ -260,7 +260,7 @@ public class Jalview2xmlTests
     int origCount = Desktop.getAlignFrames() == null ? 0 : Desktop
             .getAlignFrames().length;
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     assertTrue("Didn't gather the views in the example file.",
             Desktop.getAlignFrames().length == 1 + origCount);
@@ -275,7 +275,7 @@ public class Jalview2xmlTests
     Cache.applicationProperties.setProperty("ADD_SS_ANN",
             Boolean.TRUE.toString());
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     AlignmentViewPanel sps = null;
     for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
@@ -334,7 +334,7 @@ public class Jalview2xmlTests
   public void testCopyViewSettings() throws Exception
   {
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     AlignmentViewPanel sps = null, groups = null;
     for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
@@ -374,7 +374,7 @@ public class Jalview2xmlTests
   public void testStoreAndRecoverExpandedviews() throws Exception
   {
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     String afid = af.getViewport().getSequenceSetId();
     {
@@ -415,7 +415,7 @@ public class Jalview2xmlTests
       Assert.assertEquals(Desktop.getAlignFrames().length, 0);
     }
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            tfile.getAbsolutePath(), FormatAdapter.FILE);
+            tfile.getAbsolutePath(), DataSourceType.FILE);
     Assert.assertNotNull(af);
     Assert.assertEquals(
             Desktop.getAlignFrames().length,
@@ -436,7 +436,7 @@ public class Jalview2xmlTests
   {
     Desktop.instance.closeAll_actionPerformed(null);
     AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
-            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+            "examples/exampleFile_2_7.jar", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     String afid = af.getViewport().getSequenceSetId();
 
@@ -480,7 +480,7 @@ public class Jalview2xmlTests
     }
 
     af = new FileLoader().LoadFileWaitTillLoaded(
-            tfile.getAbsolutePath(), FormatAdapter.FILE);
+            tfile.getAbsolutePath(), DataSourceType.FILE);
     afid = af.getViewport().getSequenceSetId();
 
     for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
@@ -569,7 +569,7 @@ public class Jalview2xmlTests
   {
     Desktop.instance.closeAll_actionPerformed(null);
     AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
-            "examples/uniref50.fa", FormatAdapter.FILE);
+            "examples/uniref50.fa", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     String afid = af.getViewport().getSequenceSetId();
     // make a second view of the alignment
@@ -649,7 +649,7 @@ public class Jalview2xmlTests
     }
   
     af = new FileLoader().LoadFileWaitTillLoaded(
-            tfile.getAbsolutePath(), FormatAdapter.FILE);
+            tfile.getAbsolutePath(), DataSourceType.FILE);
     afid = af.getViewport().getSequenceSetId();
   
     for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))