X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FFeatureSettingsTest.java;h=1b988ec61d547f4aa13c7152720a6c8738e6cb72;hb=279c6495df1a0de231600a2d283098c7411c4730;hp=f09c7c799081e8cd61f57ce8ffdbaf6b02226a58;hpb=06ab16e2f61b0d30302e645be386ce02c26086b4;p=jalview.git diff --git a/test/jalview/gui/FeatureSettingsTest.java b/test/jalview/gui/FeatureSettingsTest.java index f09c7c7..1b988ec 100644 --- a/test/jalview/gui/FeatureSettingsTest.java +++ b/test/jalview/gui/FeatureSettingsTest.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ 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.gui; import static org.testng.Assert.assertEquals; @@ -9,9 +29,13 @@ import java.io.File; import java.io.IOException; import java.util.HashMap; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import jalview.api.FeatureColourI; +import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.datamodel.features.FeatureMatcher; @@ -26,6 +50,23 @@ import jalview.viewmodel.seqfeatures.FeatureRendererModel; public class FeatureSettingsTest { + @BeforeClass(alwaysRun = true) + public static void setUpBeforeClass() throws Exception + { + /* + * use read-only test properties file + */ + Cache.loadProperties("test/jalview/io/testProps.jvprops"); + Jalview.main(new String[] { "-nonews" }); + } + + @AfterMethod(alwaysRun = true) + public void tearDown() + { + if (Desktop.instance != null) + Desktop.instance.closeAll_actionPerformed(null); + } + /** * Test a roundtrip of save and reload of feature colours and filters as XML * @@ -156,7 +197,8 @@ public class FeatureSettingsTest assertTrue(fc.isBelowThreshold()); assertEquals(fc.getThreshold(), 3f); - assertEquals(fr.getFeatureFilter("type1").toStableString(), "Label Contains x"); + assertEquals(fr.getFeatureFilter("type1").toStableString(), + "Label Contains x"); assertEquals(fr.getFeatureFilter("type2").toStableString(), "(Score LE 2.4) AND (Score GT 1.1)"); assertEquals(fr.getFeatureFilter("type3").toStableString(),