From: Jim Procter Date: Sun, 24 Apr 2016 10:12:20 +0000 (+0100) Subject: JAL-2075 refactor FeatureScoreModel to native testNG asserts X-Git-Tag: Release_2_10_0~249^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a8ab01a310aa5c5cbbceef54f6ea6705fe427853;p=jalview.git JAL-2075 refactor FeatureScoreModel to native testNG asserts --- diff --git a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java index 2dc2ac3..7776ccb 100644 --- a/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureScoreModelTest.java @@ -27,7 +27,7 @@ import jalview.gui.AlignFrame; import jalview.io.FileLoader; import jalview.io.FormatAdapter; -import org.testng.AssertJUnit; +import org.testng.Assert; import org.testng.annotations.Test; public class FeatureScoreModelTest @@ -46,8 +46,8 @@ public class FeatureScoreModelTest AlignFrame alf = new FileLoader(false).LoadFileWaitTillLoaded( alntestFile, FormatAdapter.PASTE); AlignmentI al = alf.getViewport().getAlignment(); - AssertJUnit.assertEquals(4, al.getHeight()); - AssertJUnit.assertEquals(5, al.getWidth()); + Assert.assertEquals(al.getHeight(), 4); + Assert.assertEquals(al.getWidth(), 5); for (int i = 0; i < 4; i++) { SequenceI ds = al.getSequenceAt(i).getDatasetSequence(); @@ -72,21 +72,19 @@ public class FeatureScoreModelTest alf.getFeatureRenderer().setVisible("sf2"); alf.getFeatureRenderer().setVisible("sf3"); alf.getFeatureRenderer().findAllFeatures(true); - AssertJUnit.assertEquals("Number of feature types", 3, alf - .getFeatureRenderer().getDisplayedFeatureTypes().size()); - AssertJUnit.assertTrue(alf.getCurrentView().areFeaturesDisplayed()); + Assert.assertEquals(alf.getFeatureRenderer().getDisplayedFeatureTypes() + .size(), 3, "Number of feature types"); + Assert.assertTrue(alf.getCurrentView().areFeaturesDisplayed()); FeatureScoreModel fsm = new FeatureScoreModel(); - AssertJUnit.assertTrue(fsm.configureFromAlignmentView(alf + Assert.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]); + Assert.assertTrue(dm[0][2] == 0f, + "FER1_MESCR (0) should be identical with RAPSA (2)"); + Assert.assertTrue(dm[0][1] > dm[0][2], + "FER1_MESCR (0) should be further from SPIOL (1) than it is from RAPSA (2)"); } }