From: Jim Procter Date: Fri, 14 Dec 2018 16:13:26 +0000 (+0000) Subject: JAL-3171 more complex project test - where sequences were copied from one alignment... X-Git-Tag: Release_2_11_1_0~78^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8a6ddd92f9f3573caf58ff9060347a9d4afdbd00;p=jalview.git JAL-3171 more complex project test - where sequences were copied from one alignment view into a new alignment and more views created. --- diff --git a/examples/testdata/projects/manyViews.jvp b/examples/testdata/projects/manyViews.jvp new file mode 100644 index 0000000..065b29c Binary files /dev/null and b/examples/testdata/projects/manyViews.jvp differ diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java index 72cbc50..5dd3040 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -1045,10 +1045,46 @@ public class Jalview2xmlTests extends Jalview2xmlBase */ public void testMergeDatasetsforViews() throws IOException { + // simple project - two views on one alignment AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded( "examples/testdata/projects/twoViews.jvp", DataSourceType.FILE); assertNotNull(af); assertTrue(af.getAlignPanels().size() > 1); + verifyDs(af); + } + + /** + * 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 This + * is a more complex project + */ + public void testMergeDatasetsforManyViews() throws IOException + { + Desktop.instance.closeAll_actionPerformed(null); + + // complex project - one dataset, several views on several alignments + AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded( + "examples/testdata/projects/manyViews.jvp", + DataSourceType.FILE); + assertNotNull(af); + + AlignmentI ds = null; + for (AlignFrame alignFrame : Desktop.getAlignFrames()) + { + if (ds == null) + { + ds = verifyDs(alignFrame); + } + else + { + // check that this frame's dataset matches the last + assertTrue(ds == verifyDs(alignFrame)); + } + } + } + + private AlignmentI verifyDs(AlignFrame af) + { AlignmentI ds = null; for (AlignmentViewPanel ap : af.getAlignPanels()) { @@ -1062,5 +1098,6 @@ public class Jalview2xmlTests extends Jalview2xmlBase "Dataset was not the same for imported 2.10.5 project with several alignment views"); } } + return ds; } }