- @Test(groups = { "Functional" })
- public void testCollateForPdb()
- {
- // JBP: What behaviour is this supposed to test ?
- /*
- * Set up sequence pdb ids
- */
- PDBEntry pdb1 = new PDBEntry("1ABC", "B", Type.PDB, "1ABC.pdb");
- PDBEntry pdb2 = new PDBEntry("2ABC", "C", Type.PDB, "2ABC.pdb");
- PDBEntry pdb3 = new PDBEntry("3ABC", "D", Type.PDB, "3ABC.pdb");
-
- /*
- * seq1 and seq3 refer to 1abcB, seq2 to 2abcC, none to 3abcD
- */
- al.getSequenceAt(0).getDatasetSequence()
- .addPDBId(new PDBEntry("1ABC", "B", Type.PDB, "1ABC.pdb"));
- al.getSequenceAt(2).getDatasetSequence()
- .addPDBId(new PDBEntry("1ABC", "B", Type.PDB, "1ABC.pdb"));
- al.getSequenceAt(1).getDatasetSequence()
- .addPDBId(new PDBEntry("2ABC", "C", Type.PDB, "2ABC.pdb"));
- /*
- * Add a second chain PDB xref to Seq2 - should not result in a duplicate in
- * the results
- */
- al.getSequenceAt(1).getDatasetSequence()
- .addPDBId(new PDBEntry("2ABC", "D", Type.PDB, "2ABC.pdb"));
- /*
- * Seq3 refers to 3abc - this does not match 3ABC (as the code stands)
- */
- al.getSequenceAt(2).getDatasetSequence()
- .addPDBId(new PDBEntry("3abc", "D", Type.PDB, "3ABC.pdb"));
-
- /*
- * run method under test
- */
- SequenceI[][] seqs = testee.collateForPDB(new PDBEntry[] { pdb1, pdb2,
- pdb3 });
-
- // seq1 and seq3 refer to PDBEntry[0]
- assertEquals(2, seqs[0].length);
- assertSame(al.getSequenceAt(0), seqs[0][0]);
- assertSame(al.getSequenceAt(2), seqs[0][1]);
-
- // seq2 refers to PDBEntry[1]
- assertEquals(1, seqs[1].length);
- assertSame(al.getSequenceAt(1), seqs[1][0]);
-
- // no sequence refers to PDBEntry[2]
- assertEquals(0, seqs[2].length);
- }
-