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 8CA5F96F6 for ; Mon, 2 Apr 2012 17:23:32 +0000 (UTC) Received: (qmail 11625 invoked by uid 500); 2 Apr 2012 17:23:32 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 11598 invoked by uid 500); 2 Apr 2012 17:23:32 -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 11591 invoked by uid 99); 2 Apr 2012 17:23:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 17:23:32 +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; Mon, 02 Apr 2012 17:23:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CD4072388A3D; Mon, 2 Apr 2012 17:23:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1308436 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Date: Mon, 02 Apr 2012 17:23:08 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120402172308.CD4072388A3D@eris.apache.org> Author: kahatlen Date: Mon Apr 2 17:23:08 2012 New Revision: 1308436 URL: http://svn.apache.org/viewvc?rev=1308436&view=rev Log: DERBY-5678: LocalizedDisplayScriptTest fails on JVMs that don't support EUC_JP encoding Skip the test on platforms that don't support EUC_JP. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1308436&r1=1308435&r2=1308436&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Mon Apr 2 17:23:08 2012 @@ -20,6 +20,7 @@ package org.apache.derbyTesting.functionTests.tests.i18n; +import java.nio.charset.Charset; import java.util.Properties; import java.util.TimeZone; @@ -44,7 +45,10 @@ 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"; + /** * Run LocalizedDisplay.sql * @@ -70,6 +74,16 @@ public final class LocalizedDisplayScrip // (See DERBY-470). if (JDBC.vmSupportsJSR169()) return suite; + + // DERBY-5678: This test uses EUC_JP encoding. Implementations of the + // Java platform are not required to support that encoding. Skip the + // test if the encoding is not supported. + if (!Charset.isSupported(ENCODING)) { + println("Skip LocalizedDisplayScriptTest because the encoding " + + ENCODING + " is not supported"); + return suite; + } + TestSuite localizedEmbeddedTests = new TestSuite("LocalizedDisplay:embedded"); localizedEmbeddedTests.addTest(getSuite()); Test embeddedrun = TestConfiguration.singleUseDatabaseDecorator(localizedEmbeddedTests); @@ -96,7 +110,7 @@ public final class LocalizedDisplayScrip * A single JUnit test that runs a single Localized script. */ private LocalizedDisplayScriptTest(String localizedTest){ - super(localizedTest, "EUC_JP"); + super(localizedTest, ENCODING); } /** @@ -109,7 +123,7 @@ public final class LocalizedDisplayScrip TestSuite suite = new TestSuite("localized Display"); Properties uiProps = new Properties(); uiProps.put("derby.ui.locale","es_AR"); - uiProps.put("derby.ui.codeset","EUC_JP"); + uiProps.put("derby.ui.codeset", ENCODING); suite.addTest(new SystemPropertyTestSetup( new LocalizedDisplayScriptTest("LocalizedDisplay"), uiProps)); return getIJConfig(suite);