X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FColourMenuHelperTest.java;h=89e3ad8ef435f78ca4a46c5681ac771a96c93df9;hb=e9a1c2c372f4bbf6cf658de3dba73ef326b20c20;hp=9d4ed6cde4d9239d8dad7c8bbfb4dbb05e592811;hpb=2118127751e6cc5450b6bda3cc8329b286d3bae8;p=jalview.git diff --git a/test/jalview/gui/ColourMenuHelperTest.java b/test/jalview/gui/ColourMenuHelperTest.java index 9d4ed6c..89e3ad8 100644 --- a/test/jalview/gui/ColourMenuHelperTest.java +++ b/test/jalview/gui/ColourMenuHelperTest.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; @@ -34,13 +54,13 @@ public class ColourMenuHelperTest /** * Use a properties file with a user-defined colour scheme */ - @BeforeClass + @BeforeClass(alwaysRun = true) public void setUp() { Cache.loadProperties("test/jalview/io/testProps.jvprops"); } - @Test + @Test(groups = "Functional") public void testAddMenuItems_peptide() { SequenceI s1 = new Sequence("s1", "KFRQSILM"); @@ -94,7 +114,7 @@ public class ColourMenuHelperTest * check i18n for display name */ String label = MessageManager.getStringOrReturn("label.colourScheme_", - name.toLowerCase().replace(" ", "_")); + name); assertEquals(item.getText(), label); } @@ -105,7 +125,7 @@ public class ColourMenuHelperTest assertFalse(bgElements.hasMoreElements()); } - @Test + @Test(groups = "Functional") public void testAddMenuItems_nucleotide() { SequenceI s1 = new Sequence("s1", "GAATAATCCATAACAG"); @@ -119,7 +139,7 @@ public class ColourMenuHelperTest PopupMenu popup = new PopupMenu(af.alignPanel, s1, null); ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, popup, al, false); Enumeration bgElements = bg.getElements(); - + /* * first entry is 'No Colour' option */ @@ -128,7 +148,7 @@ public class ColourMenuHelperTest assertEquals(item.getText(), MessageManager.getString("label.none")); AbstractButton bgItem = bgElements.nextElement(); assertSame(bgItem, item); - + /* * check that each registered colour scheme is in the menu, * and in the button group; @@ -159,15 +179,15 @@ public class ColourMenuHelperTest { assertTrue(enabled); } - + /* * check i18n for display name */ String label = MessageManager.getStringOrReturn("label.colourScheme_", - name.toLowerCase().replace(" ", "_")); + name); assertEquals(item.getText(), label); } - + /* * check nothing left over */ @@ -182,16 +202,16 @@ public class ColourMenuHelperTest *
  • only simple colour schemes (colour per residue)
  • * */ - @Test + @Test(groups = "Functional") public void testAddMenuItems_simpleOnly() { SequenceI s1 = new Sequence("s1", "KFRQSILM"); AlignmentI al = new Alignment(new SequenceI[] { s1 }); JMenu menu = new JMenu(); - + ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, null, al, true); Enumeration bgElements = bg.getElements(); - + /* * check that only 'simple' colour schemes are included */ @@ -209,7 +229,7 @@ public class ColourMenuHelperTest AbstractButton bgItem = bgElements.nextElement(); assertSame(bgItem, item); } - + /* * check nothing left over */ @@ -220,17 +240,17 @@ public class ColourMenuHelperTest /* * menu for AlignFrame includes 'User Defined Colour' */ - @Test + @Test(groups = "Functional") public void testAddMenuItems_forAlignFrame() { SequenceI s1 = new Sequence("s1", "KFRQSILM"); AlignmentI al = new Alignment(new SequenceI[] { s1 }); AlignFrame af = new AlignFrame(al, 500, 500); JMenu menu = new JMenu(); - + ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, af, al, false); Enumeration bgElements = bg.getElements(); - + /* * check that each registered colour scheme is in the menu, * (skipping over No Colour which is the first menu item), @@ -248,7 +268,7 @@ public class ColourMenuHelperTest ColourSchemeI cs = colourSchemes.next(); assertEquals(item.getName(), cs.getSchemeName()); } - + /* * check menu also has User Defined Colour */