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 bp...@apache.org on 2011/05/29 21:53:41 UTC

svn commit: r1128942 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java

Author: bpendleton
Date: Sun May 29 19:53:41 2011
New Revision: 1128942

URL: http://svn.apache.org/viewvc?rev=1128942&view=rev
Log:
DERBY-5251: make ErrorCodeTest pass in non-English locale

This change was contributed by Houx Zhang (houx.zhang at gmail.com)

This change modifies ErrorCodeTest to use LocaleTestSetup to
force the test to run in English locale. Since the point of
this test is to test the behavior of syscs_diag.error_messages,
by comparing the contents of the messages to hard-coded English
strings, the test needs to run in the matching locale.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java?rev=1128942&r1=1128941&r2=1128942&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ErrorCodeTest.java Sun May 29 19:53:41 2011
@@ -25,10 +25,13 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.LocaleTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 import java.sql.ResultSet;
 import java.sql.Statement;
+import java.util.Locale;
+
 import org.apache.derbyTesting.junit.JDBC;
 
 public final class ErrorCodeTest extends BaseJDBCTestCase {
@@ -44,8 +47,10 @@ public final class ErrorCodeTest extends
     public static Test suite()
     {
         TestSuite suite = new TestSuite("errorcode Test");
+        
         suite.addTest(TestConfiguration.embeddedSuite(ErrorCodeTest.class));
-        return suite;
+        
+        return new LocaleTestSetup(suite, Locale.ENGLISH);
     }
 
     public void test_errorcode() throws Exception