You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by my...@apache.org on 2013/11/11 23:50:01 UTC

svn commit: r1540875 - /db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java

Author: myrnavl
Date: Mon Nov 11 22:50:01 2013
New Revision: 1540875

URL: http://svn.apache.org/r1540875
Log:
DERBy-6356; java.security.AccessControlException in i18n.LocalizedDisplayScriptTest
   backport of revision 1527143 from trunk

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

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1540875&r1=1540874&r2=1540875&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Mon Nov 11 22:50:01 2013
@@ -27,6 +27,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;
@@ -43,8 +44,6 @@ import junit.framework.TestSuite;
  */
 public final class LocalizedDisplayScriptTest extends ScriptTestCase {
 
-    private static TimeZone defaultTimeZone;
-    
     /**
      * Run LocalizedDisplay.sql 
      * <code>
@@ -103,6 +102,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 sets up the timezone wrapped in a decorator
      * that cleans the database.
      */
     private static Test getSuite() {
@@ -110,24 +110,11 @@ 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 SystemPropertyTestSetup(
+//                new LocalizedDisplayScriptTest("LocalizedDisplay"), uiProps));
+        suite.addTest(new TimeZoneTestSetup(new SystemPropertyTestSetup(
+                new LocalizedDisplayScriptTest("LocalizedDisplay"), uiProps),
+                "America/Los_Angeles"));
         return getIJConfig(suite);
     }
-    
-    /**
-     * Set up the test environment.
-     */
-    protected void setUp() {
-        super.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")); 
-    }
-    
-    public void tearDown() throws Exception {
-        TimeZone.setDefault(defaultTimeZone); 
-        super.tearDown();
-    }    
 }