fe2c35633bfbe068cd919835fc469a8888607b50
[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(alwaysRun = true)
13   public void setUp() throws Exception
14   {
15   }
16
17   @AfterMethod
18   public void tearDown() throws Exception
19   {
20   }
21
22   @Test(groups = { "Functional" })
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       // System.out.println(">>>> Testing case 1");
47       assertTrue(pdbEntry.equals(case1));
48       // System.out.println(">>>> Testing case 2");
49       assertTrue(pdbEntry.equals(case2));
50       // System.out.println(">>>> Testing case 3");
51       assertTrue(!pdbEntry.equals(case3));
52       // System.out.println(">>>> Testing case 4");
53       assertTrue(!pdbEntry.equals(case4));
54       // System.out.println(">>>> Testing case 5");
55       assertTrue(!pdbEntry.equals(case5));
56       // System.out.println(">>>> Testing case 6");
57       assertTrue(!pdbEntry.equals(case6));
58       // System.out.println(">>>> Testing case 7");
59       assertTrue(!pdbEntry.equals(case7));
60       // System.out.println(">>>> Testing case 8");
61       assertTrue(pdbEntry.equals(case8));
62       assertTrue(pdbEntry.equals(case8));
63       assertTrue(case7.equals(case9));
64     } catch (Exception e)
65     {
66       e.printStackTrace();
67     }
68
69   }
70
71 }