3 import static org.testng.Assert.assertEquals;
4 import static org.testng.Assert.assertNull;
6 import jalview.datamodel.PDBEntry;
7 import jalview.datamodel.PDBEntry.Type;
9 import org.testng.annotations.BeforeClass;
10 import org.testng.annotations.Test;
12 public class StructureViewerTest
15 @BeforeClass(alwaysRun = true)
16 public void setUpJvOptionPane()
18 JvOptionPane.setInteractiveMode(false);
19 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
22 @Test(groups = "Functional")
23 public void testGetUniquePdbFiles()
25 assertNull(StructureViewer.getUniquePdbFiles(null));
27 PDBEntry pdbe1 = new PDBEntry("1A70", "A", Type.PDB, "path1");
28 PDBEntry pdbe2 = new PDBEntry("3A6S", "A", Type.PDB, "path2");
29 PDBEntry pdbe3 = new PDBEntry("1A70", "B", Type.PDB, "path1");
30 PDBEntry pdbe4 = new PDBEntry("1GAQ", "A", Type.PDB, null);
31 PDBEntry pdbe5 = new PDBEntry("3A6S", "B", Type.PDB, "path2");
32 PDBEntry pdbe6 = new PDBEntry("1GAQ", "B", Type.PDB, null);
35 * pdbe2 and pdbe5 get removed as having a duplicate file path
37 PDBEntry[] uniques = StructureViewer.getUniquePdbFiles(new PDBEntry[] {
38 pdbe1, pdbe2, pdbe3, pdbe4, pdbe5, pdbe6 });
40 new PDBEntry[] { pdbe1, pdbe2, pdbe4, pdbe6 });