From: Jim Procter Date: Tue, 9 May 2017 15:51:46 +0000 (+0100) Subject: JAL-2507 simplify round trip test via AppletFormatAdapter X-Git-Tag: Release_2_10_2~3^2~88^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0f8f1bcdbdaac7c16ecb4a7949d71ad502c5312f;p=jalview.git JAL-2507 simplify round trip test via AppletFormatAdapter --- diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index 3c6c4e1..185eedf 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -30,7 +30,6 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; -import jalview.gui.AlignFrame; import jalview.gui.JvOptionPane; import java.io.File; @@ -447,20 +446,23 @@ public class StockholmFileTest @Test(groups = { "Functional" }) public void secondaryStructureForRNASequence() throws Exception { - AlignFrame al = new FileLoader(false).LoadFileWaitTillLoaded(aliFile, - DataSourceType.PASTE); - al.loadJalviewDataFile(annFile, DataSourceType.PASTE, null, null); + AlignmentI al = new AppletFormatAdapter().readFile(aliFile, + DataSourceType.PASTE, jalview.io.FileFormat.Fasta); + AnnotationFile aaf = new AnnotationFile(); + aaf.readAnnotationFile(al, annFile, DataSourceType.PASTE); + al.getAlignmentAnnotation()[0].visible = true; // TODO: create a better 'save as ' pattern - String stockholmFile = new jalview.io.StockholmFile(al.getViewport() - .getAlignment()).print(al.getViewport().getAlignment() - .getSequencesArray(), true); + StockholmFile sf = new StockholmFile(al); - AlignFrame newAl = new FileLoader(false).LoadFileWaitTillLoaded( - stockholmFile, DataSourceType.PASTE); + String stockholmFile = sf.print(al.getSequencesArray(), true); - testAlignmentEquivalence(al.getViewport().getAlignment(), newAl - .getViewport().getAlignment(), true, true); + AlignmentI newAl = new AppletFormatAdapter().readFile(stockholmFile, + DataSourceType.PASTE, jalview.io.FileFormat.Stockholm); + // AlignmentUtils.showOrHideSequenceAnnotations(newAl.getViewport() + // .getAlignment(), Arrays.asList("Secondary Structure"), newAl + // .getViewport().getAlignment().getSequences(), true, true); + testAlignmentEquivalence(al, newAl, true, true); } }