X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FStructureViewerTest.java;h=ace3c9dc6b1462947d812591795063622b84d093;hb=279c6495df1a0de231600a2d283098c7411c4730;hp=335863ba315ed441716c3a14b893adbec219b3ae;hpb=cfa72c2cceb390460b4f08c320146bd6910d8484;p=jalview.git
diff --git a/test/jalview/gui/StructureViewerTest.java b/test/jalview/gui/StructureViewerTest.java
index 335863b..ace3c9d 100644
--- a/test/jalview/gui/StructureViewerTest.java
+++ b/test/jalview/gui/StructureViewerTest.java
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.gui;
import static org.testng.Assert.assertEquals;
@@ -29,7 +49,9 @@ public class StructureViewerTest
@Test(groups = "Functional")
public void testGetSequencesForPdbs()
{
- assertNull(StructureViewer.getSequencesForPdbs(null, null));
+ StructureViewer sv = new StructureViewer(null);
+
+ assertNull(sv.getSequencesForPdbs(null, null));
PDBEntry pdbe1 = new PDBEntry("1A70", "A", Type.PDB, "path1");
PDBEntry pdbe2 = new PDBEntry("3A6S", "A", Type.PDB, "path2");
@@ -37,8 +59,10 @@ public class StructureViewerTest
PDBEntry pdbe4 = new PDBEntry("1GAQ", "A", Type.PDB, null);
PDBEntry pdbe5 = new PDBEntry("3A6S", "B", Type.PDB, "path2");
PDBEntry pdbe6 = new PDBEntry("1GAQ", "B", Type.PDB, null);
+ PDBEntry pdbe7 = new PDBEntry("1FOO", "Q", Type.PDB, null);
+
PDBEntry[] pdbs = new PDBEntry[] { pdbe1, pdbe2, pdbe3, pdbe4, pdbe5,
- pdbe6 };
+ pdbe6, pdbe7 };
/*
* seq1 ... seq6 associated with pdbe1 ... pdbe6
@@ -52,14 +76,14 @@ public class StructureViewerTest
/*
* pdbe3/5/6 should get removed as having a duplicate file path
*/
- Map uniques = StructureViewer
- .getSequencesForPdbs(pdbs, seqs);
+ Map uniques = sv.getSequencesForPdbs(pdbs, seqs);
assertTrue(uniques.containsKey(pdbe1));
assertTrue(uniques.containsKey(pdbe2));
assertFalse(uniques.containsKey(pdbe3));
assertTrue(uniques.containsKey(pdbe4));
assertFalse(uniques.containsKey(pdbe5));
assertFalse(uniques.containsKey(pdbe6));
+ assertTrue(uniques.containsKey(pdbe7));
// 1A70 associates with seq1 and seq3
SequenceI[] ss = uniques.get(pdbe1);
@@ -78,5 +102,10 @@ public class StructureViewerTest
assertEquals(ss.length, 2);
assertSame(seqs[3], ss[0]);
assertSame(seqs[5], ss[1]);
+
+ // 1FOO has seq7
+ ss = uniques.get(pdbe7);
+ assertEquals(ss.length, 1);
+ assertSame(seqs[6], ss[0]);
}
}