import org.testng.Assert;
import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(singleThreaded = true)
public class Jalview2xmlTests extends Jalview2xmlBase
{
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
+ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
@Override
@BeforeClass(alwaysRun = true)
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
- assertTrue(Desktop.getAlignFrames().length == 1 + origCount,
+ assertEquals(Desktop.getAlignFrames().length,
+ 1 + origCount,
"Didn't gather the views in the example file.");
-
}
/**
@Test(groups = { "Functional" }, enabled = true)
public void testStoreAndRecoverExpandedviews() throws Exception
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverReferenceSeqSettings() throws Exception
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverGroupRepSeqs() throws Exception
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverPDBEntry() throws Exception
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
String exampleFile = "examples/3W5V.pdb";
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile,
DataSourceType.FILE);
{
Assert.fail("Didn't save the state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
if (Desktop.getAlignFrames() != null)
{
Assert.assertEquals(Desktop.getAlignFrames().length, 0);
@Test(groups = { "Functional" })
public void testStoreAndRecoverColourThresholds() throws IOException
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
".jvp");
tfile.deleteOnExit();
new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
Assert.assertNotNull(af, "Failed to reload project");
@Test(groups = { "Functional" })
public void testStoreAndRecoverHmmProfile() throws IOException
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
".jvp");
tfile.deleteOnExit();
new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
Assert.assertNotNull(af, "Failed to reload project");
@Test(groups = { "Functional" })
public void testMergeDatasetsforManyViews() throws IOException
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
// complex project - one dataset, several views on several alignments
AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
@Test(groups = "Functional")
public void testPcaViewAssociation() throws IOException
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
final String PCAVIEWNAME = "With PCA";
// create a new tempfile
File tempfile = File.createTempFile("jvPCAviewAssoc", "jvp");
}
// load again.
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
tempfile.getCanonicalPath(), DataSourceType.FILE);
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
+ JInternalFrame[] frames = Desktop.getInstance().getAllFrames();
// PCA and the tabbed alignment view should be the only two windows on the
// desktop
assertEquals(frames.length, 2,
@Test(groups = { "Functional" })
public void testStoreAndRecoverGeneLocus() throws Exception
{
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
String seqData = ">P30419\nACDE\n>X1235\nGCCTGTGACGAA";
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(seqData,
DataSourceType.PASTE);
{
Assert.fail("Didn't save the state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);