From 0e07457ca16b632091d64ec76934b6bf772b180c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 6 Apr 2018 11:00:02 +0100 Subject: [PATCH] failing test for JAL-2223 --- test/jalview/io/Jalview2xmlTests.java | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 6abb7e5..c0eb8c5 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -247,6 +247,31 @@ public class Jalview2xmlTests extends Jalview2xmlBase } + /** + * Test for JAL-2223 - multiple mappings in View Mapping report + * + * @throws Exception + */ + @Test(groups = { "Functional" }) + public void noDuplicatePdbMappingsMade() throws Exception + { + StructureImportSettings.setProcessSecondaryStructure(true); + StructureImportSettings.setVisibleChainAnnotation(true); + AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( + "examples/exampleFile_2_7.jar", DataSourceType.FILE); + assertNotNull(af, "Didn't read in the example file correctly."); + + // locate Jmol viewer + // count number of PDB mappings the structure selection manager holds - + String pdbFile = af.getCurrentView().getStructureSelectionManager() + .findFileForPDBId("1A70"); + assertEquals( + af.getCurrentView().getStructureSelectionManager() + .getMapping(pdbFile).length, + 2, "Expected only two mappings for 1A70"); + + } + @Test(groups = { "Functional" }) public void viewRefPdbAnnotation() throws Exception { @@ -413,7 +438,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase String afid = af.getViewport().getSequenceSetId(); // remember reference sequence for each panel - Map refseqs = new HashMap(); + Map refseqs = new HashMap<>(); /* * mark sequence 2, 3, 4.. in panels 1, 2, 3... @@ -551,8 +576,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase * remember representative and hidden sequences marked * on each panel */ - Map repSeqs = new HashMap(); - Map> hiddenSeqNames = new HashMap>(); + Map repSeqs = new HashMap<>(); + Map> hiddenSeqNames = new HashMap<>(); /* * mark sequence 2, 3, 4.. in panels 1, 2, 3... @@ -568,7 +593,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase repIndex = Math.max(repIndex, 1); SequenceI repSeq = alignment.getSequenceAt(repIndex); repSeqs.put(ap.getViewName(), repSeq); - List hiddenNames = new ArrayList(); + List hiddenNames = new ArrayList<>(); hiddenSeqNames.put(ap.getViewName(), hiddenNames); /* -- 1.7.10.2