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:07:03 UTC

svn commit: r1540863 - in /db/derby/code/branches/10.9: ./ java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java

Author: myrnavl
Date: Mon Nov 11 22:07:02 2013
New Revision: 1540863

URL: http://svn.apache.org/r1540863
Log:
DERBY-6356; java.security.AccessControlException in i18n.LocalizedDisplayScriptTest
   merge of revision 1527143 from trunk

Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1527143

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1540863&r1=1540862&r2=1540863&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java (original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Mon Nov 11 22:07:02 2013
@@ -22,12 +22,12 @@ package org.apache.derbyTesting.function
 
 import java.nio.charset.Charset;
 import java.util.Properties;
-import java.util.TimeZone;
 
 import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
 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 +44,6 @@ import junit.framework.TestSuite;
  */
 public final class LocalizedDisplayScriptTest extends ScriptTestCase {
 
-    private static TimeZone defaultTimeZone;
-
     /** The character encoding used in the script. */
     private static final String ENCODING = "EUC_JP";
 
@@ -117,6 +115,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() {
@@ -124,24 +123,10 @@ public final class LocalizedDisplayScrip
         Properties uiProps = new Properties();
         uiProps.put("derby.ui.locale","es_AR");
         uiProps.put("derby.ui.codeset", ENCODING);
-        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();
-    }    
 }