JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / test / jalview / datamodel / PDBEntryTest.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
3  * Copyright (C) 2015 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.datamodel;
22
23 import static org.testng.AssertJUnit.assertTrue;
24
25 import org.testng.annotations.AfterMethod;
26 import org.testng.annotations.BeforeMethod;
27 import org.testng.annotations.Test;
28
29 public class PDBEntryTest
30 {
31
32   @BeforeMethod(alwaysRun = true)
33   public void setUp() throws Exception
34   {
35   }
36
37   @AfterMethod
38   public void tearDown() throws Exception
39   {
40   }
41
42   @Test(groups = { "Functional" })
43   public void test()
44   {
45     try
46     {
47
48       PDBEntry pdbEntry = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB,
49               "x/y/z/File");
50
51       PDBEntry case1 = new PDBEntry("1XYZ", "A", PDBEntry.Type.PDB,
52               "x/y/z/File");
53       PDBEntry case2 = new PDBEntry("1xyz", "a", PDBEntry.Type.PDB,
54               "x/y/z/File");
55       PDBEntry case3 = new PDBEntry("1xyz", "A", PDBEntry.Type.FILE,
56               "x/y/z/File");
57       PDBEntry case4 = new PDBEntry(null, null, null, null);
58       PDBEntry case5 = new PDBEntry(null, "A", PDBEntry.Type.PDB,
59               "x/y/z/File");
60       PDBEntry case6 = new PDBEntry("1xyz", null, PDBEntry.Type.PDB,
61               "x/y/z/File");
62       PDBEntry case7 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
63       PDBEntry case8 = new PDBEntry("1xyz", "A", PDBEntry.Type.PDB, null);
64       PDBEntry case9 = new PDBEntry("1xyz", "A", null, "x/y/z/File");
65
66       // System.out.println(">>>> Testing case 1");
67       assertTrue(pdbEntry.equals(case1));
68       // System.out.println(">>>> Testing case 2");
69       assertTrue(pdbEntry.equals(case2));
70       // System.out.println(">>>> Testing case 3");
71       assertTrue(!pdbEntry.equals(case3));
72       // System.out.println(">>>> Testing case 4");
73       assertTrue(!pdbEntry.equals(case4));
74       // System.out.println(">>>> Testing case 5");
75       assertTrue(!pdbEntry.equals(case5));
76       // System.out.println(">>>> Testing case 6");
77       assertTrue(!pdbEntry.equals(case6));
78       // System.out.println(">>>> Testing case 7");
79       assertTrue(!pdbEntry.equals(case7));
80       // System.out.println(">>>> Testing case 8");
81       assertTrue(pdbEntry.equals(case8));
82       assertTrue(pdbEntry.equals(case8));
83       assertTrue(case7.equals(case9));
84     } catch (Exception e)
85     {
86       e.printStackTrace();
87     }
88
89   }
90
91 }