From: gmungoc Date: Tue, 13 Sep 2016 14:51:58 +0000 (+0100) Subject: JAL-1803 tests added for PDBEntry.Type X-Git-Tag: Release_2_10_0~41^2~10 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3becb23b055e6b17b372c04be015bb205251ae9f;p=jalview.git JAL-1803 tests added for PDBEntry.Type --- diff --git a/test/jalview/datamodel/PDBEntryTest.java b/test/jalview/datamodel/PDBEntryTest.java index 1195393..cf944b2 100644 --- a/test/jalview/datamodel/PDBEntryTest.java +++ b/test/jalview/datamodel/PDBEntryTest.java @@ -23,7 +23,10 @@ package jalview.datamodel; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotEquals; +import static org.testng.Assert.assertNotSame; import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertSame; +import static org.testng.Assert.assertTrue; //import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -100,4 +103,23 @@ public class PDBEntryTest pdbEntry.setChainCode(null); assertNull(pdbEntry.getChainCode()); } + + @Test(groups = { "Functional" }) + public void testGetType() + { + assertSame(PDBEntry.Type.FILE, PDBEntry.Type.getType("FILE")); + assertSame(PDBEntry.Type.FILE, PDBEntry.Type.getType("File")); + assertSame(PDBEntry.Type.FILE, PDBEntry.Type.getType("file")); + assertNotSame(PDBEntry.Type.FILE, PDBEntry.Type.getType("file ")); + } + + @Test(groups = { "Functional" }) + public void testTypeMatches() + { + // TODO Type.matches() is not used - delete? + assertTrue(PDBEntry.Type.FILE.matches("FILE")); + assertTrue(PDBEntry.Type.FILE.matches("File")); + assertTrue(PDBEntry.Type.FILE.matches("file")); + assertFalse(PDBEntry.Type.FILE.matches("FILE ")); + } }