Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A72D102E9 for ; Tue, 12 Nov 2013 01:34:53 +0000 (UTC) Received: (qmail 46789 invoked by uid 500); 12 Nov 2013 01:34:53 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 46773 invoked by uid 500); 12 Nov 2013 01:34:53 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 46766 invoked by uid 99); 12 Nov 2013 01:34:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2013 01:34:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2013 01:34:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7B0E423888A6; Tue, 12 Nov 2013 01:34:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: derby-commits@db.apache.org From: myrnavl@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131112013431.7B0E423888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 * @@ -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(); }