X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FFileFormatsTest.java;h=781050422f805ab9dbeb5b508344e55cc597439e;hb=136c0793b90b72b928c4d77dc109dd5c644e00d3;hp=8df228f6219d7a67e260e7febeae461434d4cc90;hpb=8677e6e34e291edc58c1da2fc9c958473754143f;p=jalview.git diff --git a/test/jalview/io/FileFormatsTest.java b/test/jalview/io/FileFormatsTest.java index 8df228f..7810504 100644 --- a/test/jalview/io/FileFormatsTest.java +++ b/test/jalview/io/FileFormatsTest.java @@ -10,28 +10,39 @@ import static org.testng.Assert.assertTrue; import java.util.Iterator; import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class FileFormatsTest { - @AfterMethod() + @AfterMethod(alwaysRun = true) public void tearDown() { FileFormats.getInstance().reset(); } + @BeforeMethod(alwaysRun = true) + public void setUp() + { + FileFormats.getInstance().reset(); + } + @Test(groups = "Functional") - public void testIsDynamic() + public void testIsIdentifiable() { FileFormats formats = FileFormats.getInstance(); - for (FileFormatI ff : FileFormat.values()) - { - assertFalse(formats.isIdentifiable(ff)); - } - assertTrue(formats.isIdentifiable(null)); + assertTrue(formats.isIdentifiable(formats.forName(FileFormat.Fasta + .getName()))); + assertTrue(formats.isIdentifiable(formats.forName(FileFormat.MMCif + .getName()))); + assertTrue(formats.isIdentifiable(formats.forName(FileFormat.Jnet + .getName()))); + assertFalse(formats.isIdentifiable(formats.forName(FileFormat.Jalview + .getName()))); + assertFalse(formats.isIdentifiable(null)); /* - * remove and re-add a format: it is now considered 'dynamically added' + * remove and re-add a format: it is still 'identifiable' */ formats.deregisterFileFormat(FileFormat.Fasta.getName()); assertNull(formats.forName(FileFormat.Fasta.getName())); @@ -104,7 +115,7 @@ public class FileFormatsTest FileFormats formats = FileFormats.getInstance(); assertSame(FileFormat.MMCif, formats.forName(FileFormat.MMCif.getName())); - assertFalse(formats.isIdentifiable(FileFormat.MMCif)); + assertTrue(formats.isIdentifiable(FileFormat.MMCif)); /* * deregister mmCIF format @@ -114,7 +125,7 @@ public class FileFormatsTest /* * re-register mmCIF format - * it is reinstated (but now classed as 'dynamic') + * it is reinstated (still 'identifiable') */ formats.registerFileFormat(FileFormat.MMCif); assertSame(FileFormat.MMCif,