portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r598578 - /portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
Date Tue, 27 Nov 2007 09:56:15 GMT
Author: woonsan
Date: Tue Nov 27 01:56:13 2007
New Revision: 598578

URL: http://svn.apache.org/viewvc?rev=598578&view=rev
Log:
Fixing a testcase: TestPortalSite always fails on a non-English system because it assumes
that the default locale is English on the test machine. For example, `assertEquals("Back to",
backMenu.getTitle());' always fails because backMenu.getTitle() is equivalent to backMenu.getTitle(Locale.getDefault()).
(The default locale is ko_KR in my case.)
There are too many codes assuming English locale, but keeping these as before seems better
to read.
Therefore, I added default locale setting code before testing for non-English testing environments.

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java?rev=598578&r1=598577&r2=598578&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
Tue Nov 27 01:56:13 2007
@@ -57,6 +57,11 @@
      * portalSite - PortalSite component
      */
     private PortalSite portalSite;
+    
+    /**
+     * default locale
+     */
+    private Locale defaultLocale;
 
     /* (non-Javadoc)
      * @see junit.framework.TestCase#setUp()
@@ -66,6 +71,8 @@
         super.setUp();
         this.pageManager = (PageManager) ctx.getBean("pageManager");
         this.portalSite = (PortalSite) ctx.getBean("portalSite");
+        this.defaultLocale = Locale.getDefault();
+        Locale.setDefault(Locale.ENGLISH);
     }
 
     /* (non-Javadoc)
@@ -74,6 +81,7 @@
     protected void tearDown() throws Exception
     {
         super.tearDown();
+        Locale.setDefault(this.defaultLocale);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message