093702fe6c4a95acd7448147e3a8434cd0888337
[jalview.git] / test / jalview / datamodel / PDBEntryTest.java
1 package jalview.datamodel;
2
3 import static org.testng.AssertJUnit.assertTrue;
4
5 import org.testng.annotations.AfterMethod;
6 import org.testng.annotations.BeforeMethod;
7 import org.testng.annotations.Test;
8
9 public class PDBEntryTest
10 {
11
12   @BeforeMethod
13   public void setUp() throws Exception
14   {
15   }
16
17   @AfterMethod
18   public void tearDown() throws Exception
19   {
20   }
21
22   @Test
23   public void test()
24   {
25     try
26     {
27
28     PDBEntry pdbEntry = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB,
29             "x/y/z/File");
30
31     PDBEntry case1 = new PDBEntry("1XYZ", "A", PDBEntry.Type.PDB,
32             "x/y/z/File");
33     PDBEntry case2 = new PDBEntry("1xyz", "a", PDBEntry.Type.PDB,
34             "x/y/z/File");
35     PDBEntry case3 = new PDBEntry("1xyz", "A", PDBEntry.Type.FILE,
36             "x/y/z/File");
37     PDBEntry case4 = new PDBEntry(null, null, null, null);
38     PDBEntry case5 = new PDBEntry(null, "A", PDBEntry.Type.PDB,
39             "x/y/z/File");
40     PDBEntry case6 = new PDBEntry("1xyz", null, PDBEntry.Type.PDB,
41             "x/y/z/File");
42     PDBEntry case7 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
43     PDBEntry case8 = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB, null);
44       PDBEntry case9 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
45
46     
47       // System.out.println(">>>> Testing case 1");
48     assertTrue(pdbEntry.equals(case1));
49       // System.out.println(">>>> Testing case 2");
50     assertTrue(pdbEntry.equals(case2));
51       // System.out.println(">>>> Testing case 3");
52     assertTrue(!pdbEntry.equals(case3));
53       // System.out.println(">>>> Testing case 4");
54     assertTrue(!pdbEntry.equals(case4));
55       // System.out.println(">>>> Testing case 5");
56     assertTrue(!pdbEntry.equals(case5));
57       // System.out.println(">>>> Testing case 6");
58     assertTrue(!pdbEntry.equals(case6));
59       // System.out.println(">>>> Testing case 7");
60     assertTrue(!pdbEntry.equals(case7));
61       // System.out.println(">>>> Testing case 8");
62       assertTrue(pdbEntry.equals(case8));
63       assertTrue(pdbEntry.equals(case8));
64       assertTrue(case7.equals(case9));
65     } catch (Exception e)
66     {
67       e.printStackTrace();
68     }
69
70   }
71
72 }