From: James Procter Date: Wed, 17 May 2023 09:26:36 +0000 (+0100) Subject: JAL-4184 failing test for description export and re-import from stockholm X-Git-Tag: Release_2_11_4_0~323^2~1^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=195cc12bf3e78c312b9d7fbfb3aa86b4659684b7;p=jalview.git JAL-4184 failing test for description export and re-import from stockholm --- diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index b1995ab..6b2982d 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -136,6 +136,28 @@ public class StockholmFileTest "Couldn't find Uniprot DBRef on re-imported sequence."); } + @Test(groups = { "Functional" }) + public void descriptionLineOutput() throws Exception + { + // quick test that sequence description is exported & reimported + + SequenceI sq = new Sequence("FER2_SPIOL", "AASSDDDFFF"); + String expected_descr="This is a description !@&^%@£@"; + sq.setDescription(expected_descr); + AppletFormatAdapter af = new AppletFormatAdapter(); + String toStockholm = af.formatSequences(FileFormat.Stockholm, + new Alignment(new SequenceI[] + { sq }), false); + System.out.println(toStockholm); + + // bleh - java.util.Regex sucks + assertTrue(toStockholm.contains(expected_descr),"Couldn't locate expected description srting in generated Stockholm file."); + + AlignmentI fromStockholm = af.readFile(toStockholm, + DataSourceType.PASTE, FileFormat.Stockholm); + SequenceI importedSeq = fromStockholm.getSequenceAt(0); + assertEquals( "Description did not get reimported.",expected_descr,importedSeq.getDescription()); + } /** * test alignment data in given file can be imported, exported and reimported