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/09/30 20:01:50 UTC
svn commit: r1527688 - in /db/derby/code/branches/10.10: ./
java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
Author: myrnavl
Date: Mon Sep 30 18:01:49 2013
New Revision: 1527688
URL: http://svn.apache.org/r1527688
Log:
DERBY-6356; java.security.AccessControlException in i18n.LocalizedDisplayScriptTest
merge of revision 1527143 from trunk; use TimeZoneTestSetup instead of local setUp and teardown.
Modified:
db/derby/code/branches/10.10/ (props changed)
db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
Propchange: db/derby/code/branches/10.10/
------------------------------------------------------------------------------
Merged /db/derby/code/trunk:r1527143
Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1527688&r1=1527687&r2=1527688&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java (original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Mon Sep 30 18:01:49 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();
- }
}