From: Jim Procter Date: Fri, 14 Dec 2018 12:28:24 +0000 (+0000) Subject: JAL-3171 failing test for legacy projects and fixing multiple dataset references X-Git-Tag: Release_2_11_1_0~78^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9d727ef14287371b709fb56423d4dc07114764d8;p=jalview.git JAL-3171 failing test for legacy projects and fixing multiple dataset references --- diff --git a/examples/testdata/projects/twoViews.jvp b/examples/testdata/projects/twoViews.jvp new file mode 100644 index 0000000..80333cd Binary files /dev/null and b/examples/testdata/projects/twoViews.jvp differ diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java index f0fc3fd..72cbc50 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -1038,4 +1038,29 @@ public class Jalview2xmlTests extends Jalview2xmlBase addFeature(seq, featureType, score++); addFeature(seq, featureType, score); } + + /** + * pre 2.11 - jalview 2.10 erroneously created new dataset entries for each + * view (JAL-3171) this test ensures we can import and merge those views + */ + public void testMergeDatasetsforViews() throws IOException + { + AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded( + "examples/testdata/projects/twoViews.jvp", DataSourceType.FILE); + assertNotNull(af); + assertTrue(af.getAlignPanels().size() > 1); + AlignmentI ds = null; + for (AlignmentViewPanel ap : af.getAlignPanels()) + { + if (ds == null) + { + ds = ap.getAlignment().getDataset(); + } + else + { + assertTrue(ap.getAlignment().getDataset() == ds, + "Dataset was not the same for imported 2.10.5 project with several alignment views"); + } + } + } }