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 2011/08/22 22:57:26 UTC

svn commit: r1160433 - in /db/derby/code/branches/10.8: ./ java/testing/org/apache/derbyTesting/functionTests/tests/i18n/ java/testing/org/apache/derbyTesting/functionTests/tests/tools/ java/testing/org/apache/derbyTesting/functionTests/util/

Author: myrnavl
Date: Mon Aug 22 20:57:26 2011
New Revision: 1160433

URL: http://svn.apache.org/viewvc?rev=1160433&view=rev
Log:
DERBY-5287; tasks for 10.8.2. release
  backporting fixes for DERBY-5217 (1137213) and DERBY-5312 (1145057).

Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedAttributeScriptTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/_Suite.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 22 20:57:26 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.7:1061570,1061578,1082235
-/db/derby/code/trunk:1063809,1088633,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1141924,1142583,1142635,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612
+/db/derby/code/trunk:1063809,1088633,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1095247,1096741,1096890,1097247,1097249,1097460,1097469,1097471,1098033,1101059,1101839,1102620,1102826,1103681,1103718,1103742,1125305,1126358,1126468,1127825,1127883,1128243,1128942,1129136,1129764,1129797,1130077,1130084,1130632,1130895,1131030,1131272,1132546,1132664,1132860,1132928,1133304,1133317,1133741,1133752,1134139,1136363,1136371,1136397,1136844,1137213,1138201,1138341,1138444,1138787,1138795,1139449,1139451,1141924,1142583,1142635,1145057,1146644,1146915,1146962,1147219,1147242,1147335,1148344,1148354,1148429,1148658,1149054,1149090,1149270,1149482,1149662,1151101,1151612

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedAttributeScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedAttributeScriptTest.java?rev=1160433&r1=1160432&r2=1160433&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedAttributeScriptTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedAttributeScriptTest.java Mon Aug 22 20:57:26 2011
@@ -24,7 +24,6 @@ import java.io.File;
 import java.security.AccessController;
 import java.util.Properties;
 
-import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
@@ -171,15 +170,6 @@ public final class LocalizedAttributeScr
                 //assertTrue(dir.getPath(), dir.delete());
             }
         });
-        LocalizedResource.resetLocalizedResourceCache();
         super.tearDown();
     }    
-    
-    /**
-     * Set up the test environment.
-     */
-    protected void setUp() {
-        super.setUp();
-        LocalizedResource.resetLocalizedResourceCache();
-    }
 }
\ No newline at end of file

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java?rev=1160433&r1=1160432&r2=1160433&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/LocalizedDisplayScriptTest.java Mon Aug 22 20:57:26 2011
@@ -23,7 +23,6 @@ package org.apache.derbyTesting.function
 import java.util.Properties;
 import java.util.TimeZone;
 
-import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
@@ -125,12 +124,10 @@ public final class LocalizedDisplayScrip
         // 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();
     }    
 }

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/_Suite.java?rev=1160433&r1=1160432&r2=1160433&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/_Suite.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/_Suite.java Mon Aug 22 20:57:26 2011
@@ -50,12 +50,7 @@ public class _Suite extends BaseTestCase
 	public static Test suite() {
 
 		TestSuite suite = new TestSuite("i18n");
-        
-        // First ensure that we are running in english locale; the output
-        // master has been created in that locale, and thus, running in any
-        // other locale will fail.
-        if (!getSystemProperty("user.language").equalsIgnoreCase("en"))
-            return suite;
+
         // Also, both these tests won't run with JSR169.
         if (JDBC.vmSupportsJSR169())
             return suite;

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java?rev=1160433&r1=1160432&r2=1160433&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportIJTest.java Mon Aug 22 20:57:26 2011
@@ -20,12 +20,16 @@
 
 package org.apache.derbyTesting.functionTests.tests.tools;
 
+import java.util.Locale;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.functionTests.util.ScriptTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.LocaleTestSetup;
 import org.apache.derbyTesting.junit.SupportFilesSetup;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 /**
  *	Test that runs the importExportThruIJ.sql script and compares the output 
@@ -39,7 +43,7 @@ public final class ImportExportIJTest ex
 	 * @param script - the name of the script
 	 */
 	private ImportExportIJTest(String script) {
-		super(script);
+		super(script, true);
 	}
 
 	
@@ -73,7 +77,12 @@ public final class ImportExportIJTest ex
             "functionTests/testData/ImportExport/derby-2193-linenumber.txt"
             }
         );
-        return tst;
-//		return suite;
+
+        // This test should run in English locale since it compares error
+        // messages against a canon based on the English message text. Also,
+        // run the test in a fresh database, since the language of the message
+        // text is determined when the database is created.
+        tst = TestConfiguration.singleUseDatabaseDecorator(tst);
+        return new LocaleTestSetup(tst, Locale.ENGLISH);
 	}
 }

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java?rev=1160433&r1=1160432&r2=1160433&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java Mon Aug 22 20:57:26 2011
@@ -25,6 +25,7 @@ import java.security.AccessController;
 import java.sql.Connection;
 import java.util.Locale;
 
+import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derbyTesting.junit.Derby;
 
 import junit.framework.Test;
@@ -213,6 +214,10 @@ public abstract class ScriptTestCase ext
                 return null;
             }
         });
+
+        // Reset IJ's locale to allow it to pick up the new locale from
+        // the environment.
+        LocalizedResource.resetLocalizedResourceCache();
     }
 
     /**
@@ -227,5 +232,8 @@ public abstract class ScriptTestCase ext
                 return null;
             }
         });
+
+        // Forget the locale used by this test.
+        LocalizedResource.resetLocalizedResourceCache();
     }
 }