VirtualGuestsActionTest had some localized messages hardcoded in
English, I removed them to actually look up their value from
LocalizationService.

See attached patch.

Regards,
-- 
Silvio Moioli
SUSE LINUX Products GmbH
Maxfeldstraße 5, 90409 Nürnberg Germany


>From 3031c0c690d3dc363fac1f1db91b30949ee7b045 Mon Sep 17 00:00:00 2001
From: Silvio Moioli <smoi...@suse.de>
Date: Wed, 11 Sep 2013 09:42:56 +0200
Subject: [PATCH 15/22] VirtualGuestsActionTest: do not rely on translation
 messages

---
 .../systems/virtualization/test/VirtualGuestsActionTest.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
index 80bf3e9..1626d7e 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
@@ -15,6 +15,7 @@
 package com.redhat.rhn.frontend.action.systems.virtualization.test;
 
 import com.redhat.rhn.common.db.datasource.DataResult;
+import com.redhat.rhn.common.localization.LocalizationService;
 import com.redhat.rhn.domain.action.Action;
 import com.redhat.rhn.domain.action.ActionFactory;
 import com.redhat.rhn.domain.action.virtualization.VirtualizationSetMemoryAction;
@@ -46,6 +47,8 @@ import java.util.Map;
  */
 public class VirtualGuestsActionTest extends RhnPostMockStrutsTestCase {
 
+    private LocalizationService localization = LocalizationService.getInstance();
+
     private RhnSet submitVirtualGuestsForm(String dispatch, Map requestParams)
         throws Exception {
         Server guest = ServerFactoryTest.createTestServer(
@@ -90,7 +93,8 @@ public class VirtualGuestsActionTest extends RhnPostMockStrutsTestCase {
 
     public void testDeleteGuest() throws Exception {
         Map requestParams = new HashMap();
-        requestParams.put("guestAction", "Delete Systems");
+        requestParams.put("guestAction",
+                localization.getMessage("virtualguestslist.jsp.deletesystem"));
         RhnSet set = submitVirtualGuestsForm("virtualguestslist.jsp.applyaction",
                 requestParams);
 
@@ -144,7 +148,8 @@ public class VirtualGuestsActionTest extends RhnPostMockStrutsTestCase {
 
     public void testSetGuestMemory() throws Exception {
         Map requestParams = new HashMap();
-        requestParams.put("guestSettingToModify", "Memory");
+        requestParams.put("guestSettingToModify",
+                localization.getMessage("virtualguestslist.jsp.setguestmemory"));
         requestParams.put("guestSettingValue", "1000");
         submitVirtualGuestsForm("virtualguestslist.jsp.applychanges",
                 requestParams);
@@ -185,7 +190,8 @@ public class VirtualGuestsActionTest extends RhnPostMockStrutsTestCase {
 
     public void testSetGuestVcpus() throws Exception {
         Map requestParams = new HashMap();
-        requestParams.put("guestSettingToModify", "Virtual CPU");
+        requestParams.put("guestSettingToModify",
+                localization.getMessage("virtualguestslist.jsp.setguestvcpus"));
         requestParams.put("guestSettingValue", "3");
         submitVirtualGuestsForm("virtualguestslist.jsp.applychanges",
                 requestParams);
-- 
1.8.1.4



_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to