X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fanalysis%2Fscoremodels%2FFeatureScoreModelTest.java;h=df5502ec83df4fed7d1937f29af9eee2b4304989;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=b40382dd7cd95b5329d7b884bcbe734d1f2c9c27;hpb=3412b273e964fb1a9d22564b04a5f0c827ec2461;p=jalview.git diff --git a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java index b40382d..df5502e 100644 --- a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@ -1,7 +1,25 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.analysis.scoremodels; -import org.testng.annotations.Test; -import org.testng.AssertJUnit; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; @@ -9,24 +27,24 @@ import jalview.gui.AlignFrame; import jalview.io.FileLoader; import jalview.io.FormatAdapter; +import org.testng.AssertJUnit; +import org.testng.annotations.Test; + public class FeatureScoreModelTest { public static String alntestFile = "FER1_MESCR/72-76 DVYIL\nFER1_SPIOL/71-75 DVYIL\nFER3_RAPSA/21-25 DVYVL\nFER1_MAIZE/73-77 DVYIL\n"; - int[] sf1 = new int[] - { 74, 74, 73, 73, 23, 23, -1, -1 }; + int[] sf1 = new int[] { 74, 74, 73, 73, 23, 23, -1, -1 }; - int[] sf2 = new int[] - { -1, -1, 74, 75, -1, -1, 76, 77 }; + int[] sf2 = new int[] { -1, -1, 74, 75, -1, -1, 76, 77 }; - int[] sf3 = new int[] - { -1, -1, -1, -1, -1, -1, 76, 77 }; + int[] sf3 = new int[] { -1, -1, -1, -1, -1, -1, 76, 77 }; - @Test + @Test(groups = { "Functional" }) public void testFeatureScoreModel() throws Exception { - AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded(alntestFile, - FormatAdapter.PASTE); + AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded( + alntestFile, FormatAdapter.PASTE); AlignmentI al = alf.getViewport().getAlignment(); AssertJUnit.assertEquals(4, al.getHeight()); AssertJUnit.assertEquals(5, al.getWidth()); @@ -58,16 +76,17 @@ public class FeatureScoreModelTest .getFeatureRenderer().getDisplayedFeatureTypes().length); AssertJUnit.assertTrue(alf.getCurrentView().areFeaturesDisplayed()); FeatureScoreModel fsm = new FeatureScoreModel(); - AssertJUnit.assertTrue(fsm.configureFromAlignmentView(alf.getCurrentView() - .getAlignPanel())); + AssertJUnit.assertTrue(fsm.configureFromAlignmentView(alf + .getCurrentView().getAlignPanel())); alf.selectAllSequenceMenuItem_actionPerformed(null); float[][] dm = fsm.findDistances(alf.getViewport().getAlignmentView( true)); AssertJUnit.assertTrue("FER1_MESCR should be identical with RAPSA (2)", dm[0][2] == 0f); - AssertJUnit.assertTrue( - "FER1_MESCR should be further from SPIOL (1) than it is from RAPSA (2)", - dm[0][1] > dm[0][2]); + AssertJUnit + .assertTrue( + "FER1_MESCR should be further from SPIOL (1) than it is from RAPSA (2)", + dm[0][1] > dm[0][2]); } }