From d9e91b5fc027ec6099585c3c7f69c73d7832e540 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 25 Apr 2014 17:09:55 +0100 Subject: [PATCH] test for JAL-1268 --- test/jalview/io/Jalview2xmlTests.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 2e19e99..4ef038a 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -66,5 +66,32 @@ public class Jalview2xmlTests assertTrue("Differing numbers of dataset sequence annotation\nOriginally "+olddsann+" and now "+newdsann,olddsann==newdsann); System.out.println("Read in same number of annotations as originally present ("+olddsann+")"); } + @Test + public void testTCoffeeScores() throws Exception + { + String inFile = "examples/uniref50.fa",inAnnot="examples/uniref50.score_ascii"; + String tfile = File.createTempFile("JalviewTest", ".jvp").getAbsolutePath(); + AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(inFile, FormatAdapter.FILE); + assertTrue("Didn't read input file "+inFile, af!=null); + af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null,null); + assertTrue( + "Didn't set T-coffee colourscheme", + af.getViewport().getGlobalColourScheme().getClass() + .equals(jalview.schemes.TCoffeeColourScheme.class)); + assertTrue( + "Recognise T-Coffee score from string", + jalview.schemes.ColourSchemeProperty.getColour(af.getViewport() + .getAlignment(), + jalview.schemes.ColourSchemeProperty.getColourName(af + .getViewport().getGlobalColourScheme())) != null); + + assertTrue("Failed to store as a project.",af.saveAlignment(tfile, "Jalview")); + af.closeMenuItem_actionPerformed(true); + af=null; + af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile, FormatAdapter.FILE); + assertTrue("Failed to import new project", af!=null); + assertTrue("Didn't set T-coffee colourscheme for imported project.",af.getViewport().getGlobalColourScheme().getClass().equals(jalview.schemes.TCoffeeColourScheme.class)); + System.out.println("T-Coffee score shading successfully recovered from project."); + } } -- 1.7.10.2