db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1540913 - /db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
Date Tue, 12 Nov 2013 01:34:31 GMT
Author: myrnavl
Date: Tue Nov 12 01:34:31 2013
New Revision: 1540913

URL: http://svn.apache.org/r1540913
Log:
DERBY-6356; java.security.AccessControlException in i18n.LocalizedDisplayScriptTest
  backport of the fix to make use of the TimeZoneTestSetup which has privileged code for TimeZone.setDefault()

Modified:
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1540913&r1=1540912&r2=1540913&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
Tue Nov 12 01:34:31 2013
@@ -28,6 +28,7 @@ import org.apache.derbyTesting.functionT
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
+import org.apache.derbyTesting.junit.TimeZoneTestSetup;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -44,8 +45,6 @@ import junit.framework.TestSuite;
  */
 public final class LocalizedDisplayScriptTest extends ScriptTestCase {
 
-    private static TimeZone defaultTimeZone;
-    
     /**
      * Run LocalizedDisplay.sql 
      * <code>
@@ -104,6 +103,7 @@ public final class LocalizedDisplayScrip
      * Return a localized test based on the script name. 
      * The test is surrounded in a decorator that sets up the
      * desired properties which is wrapped in a decorator
+     * which setups up the timezone wrapped in a decorator
      * that cleans the database.
      */
     private static Test getSuite() {
@@ -111,8 +111,9 @@ public final class LocalizedDisplayScrip
         Properties uiProps = new Properties();
         uiProps.put("derby.ui.locale","es_AR");
         uiProps.put("derby.ui.codeset","EUC_JP");
-        suite.addTest(new SystemPropertyTestSetup(
-                new LocalizedDisplayScriptTest("LocalizedDisplay"), uiProps));
+        suite.addTest(new TimeZoneTestSetup(new SystemPropertyTestSetup(
+                new LocalizedDisplayScriptTest("LocalizedDisplay"), uiProps),
+                "America/Los_Angeles"));
         return getIJConfig(suite);
     }
     
@@ -122,13 +123,10 @@ public final class LocalizedDisplayScrip
     protected void setUp() {
         // the canon contains time columns, which would display localized -
         // and so cause errors. Thus, run this with timezone PST.
-        defaultTimeZone = TimeZone.getDefault(); 
-        TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); 
         LocalizedResource.resetLocalizedResourceCache();
     }
     
     public void tearDown() throws Exception {
-        TimeZone.setDefault(defaultTimeZone); 
         LocalizedResource.resetLocalizedResourceCache();
         super.tearDown();
     }    



Mime
View raw message