JAL-1354 use i18n text for expected value
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 16 Dec 2016 08:55:13 +0000 (08:55 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 16 Dec 2016 08:55:13 +0000 (08:55 +0000)
test/jalview/gui/PopupMenuTest.java

index 922d457..335240b 100644 (file)
@@ -321,7 +321,8 @@ public class PopupMenuTest
 
     assertEquals(4, showOptions.length); // includes 'All' and separator
     assertEquals(4, hideOptions.length);
-    assertEquals("All", ((JMenuItem) showOptions[0]).getText());
+    String all = MessageManager.getString("label.all");
+    assertEquals(all, ((JMenuItem) showOptions[0]).getText());
     assertTrue(showOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) showOptions[1]).getOrientation());
@@ -331,7 +332,7 @@ public class PopupMenuTest
     assertEquals("SSP", ((JMenuItem) showOptions[3]).getText());
     assertEquals("JPred", ((JMenuItem) showOptions[3]).getToolTipText());
 
-    assertEquals("All", ((JMenuItem) hideOptions[0]).getText());
+    assertEquals(all, ((JMenuItem) hideOptions[0]).getText());
     assertTrue(hideOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) hideOptions[1]).getOrientation());
@@ -383,12 +384,13 @@ public class PopupMenuTest
 
     assertEquals(2, showOptions.length); // includes 'All' and separator
     assertEquals(4, hideOptions.length);
-    assertEquals("All", ((JMenuItem) showOptions[0]).getText());
+    String all = MessageManager.getString("label.all");
+    assertEquals(all, ((JMenuItem) showOptions[0]).getText());
     assertTrue(showOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) showOptions[1]).getOrientation());
 
-    assertEquals("All", ((JMenuItem) hideOptions[0]).getText());
+    assertEquals(all, ((JMenuItem) hideOptions[0]).getText());
     assertTrue(hideOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) hideOptions[1]).getOrientation());
@@ -440,7 +442,8 @@ public class PopupMenuTest
 
     assertEquals(4, showOptions.length); // includes 'All' and separator
     assertEquals(2, hideOptions.length);
-    assertEquals("All", ((JMenuItem) showOptions[0]).getText());
+    String all = MessageManager.getString("label.all");
+    assertEquals(all, ((JMenuItem) showOptions[0]).getText());
     assertTrue(showOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) showOptions[1]).getOrientation());
@@ -450,7 +453,7 @@ public class PopupMenuTest
     assertEquals("Temp", ((JMenuItem) showOptions[3]).getText());
     assertEquals("PDB2", ((JMenuItem) showOptions[3]).getToolTipText());
 
-    assertEquals("All", ((JMenuItem) hideOptions[0]).getText());
+    assertEquals(all, ((JMenuItem) hideOptions[0]).getText());
     assertTrue(hideOptions[1] instanceof JPopupMenu.Separator);
     assertEquals(JSeparator.HORIZONTAL,
             ((JSeparator) hideOptions[1]).getOrientation());