db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
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 GMT
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 
      * <code>
@@ -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);



Mime
View raw message