From 195cc12bf3e78c312b9d7fbfb3aa86b4659684b7 Mon Sep 17 00:00:00 2001 From: James Procter Date: Wed, 17 May 2023 10:26:36 +0100 Subject: [PATCH] JAL-4184 failing test for description export and re-import from stockholm --- test/jalview/io/StockholmFileTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 1.7.10.2