*/
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())
{
"Dataset was not the same for imported 2.10.5 project with several alignment views");
}
}
+ return ds;
}
}