From 3becb23b055e6b17b372c04be015bb205251ae9f Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 13 Sep 2016 15:51:58 +0100 Subject: [PATCH] JAL-1803 tests added for PDBEntry.Type --- test/jalview/datamodel/PDBEntryTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 ")); + } } -- 1.7.10.2