db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r1134139 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
Date Fri, 10 Jun 2011 00:17:49 GMT
Author: bpendleton
Date: Fri Jun 10 00:17:49 2011
New Revision: 1134139

URL: http://svn.apache.org/viewvc?rev=1134139&view=rev
Log:
DERBY-5252: make GrantRevokeTest pass in non-English locale

This patch was contributed by Houx Zhang (houxzhang at gmail dot com)

This change adjusts 4 places in the test to compare the actual
error message text only if the test is running in the English locale.

This enables the test to pass when run in non-English locales, while
also preserving the error message text validation for runs of the
test in the English locale.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java?rev=1134139&r1=1134138&r2=1134139&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeTest.java
Fri Jun 10 00:17:49 2011
@@ -31,6 +31,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayList;
+import java.util.Locale;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
@@ -624,7 +625,9 @@ public class GrantRevokeTest extends Bas
             grant("execute", "function s1", "nosuch", users[1]);
     	} catch (SQLException e) {
         	assertSQLState("42Y03", e);
-            assertEquals("'S1.NOSUCH' is not recognized as a function.", e.getMessage());
+        	if ( Locale.getDefault().getLanguage().equals("en") ) {
+        	    assertEquals("'S1.NOSUCH' is not recognized as a function.", e.getMessage());
+        	}
         }
     }
     
@@ -633,7 +636,9 @@ public class GrantRevokeTest extends Bas
             grant("execute", "function s1", "p1", users[1]);
     	} catch (SQLException e) {
         	assertSQLState("42Y03", e);
-            assertEquals("'S1.P1' is not recognized as a function.", e.getMessage());
+            if ( Locale.getDefault().getLanguage().equals("en") ) {
+                assertEquals("'S1.P1' is not recognized as a function.", e.getMessage());
+            }
         }
     }
     
@@ -650,7 +655,9 @@ public class GrantRevokeTest extends Bas
             grant("execute", "procedure s1", "nosuch", users[1]);
     	} catch (SQLException e) {
         	assertSQLState("42Y03", e);
-            assertEquals("'S1.NOSUCH' is not recognized as a procedure.", e.getMessage());
+        	if ( Locale.getDefault().getLanguage().equals("en") ) {
+        	    assertEquals("'S1.NOSUCH' is not recognized as a procedure.", e.getMessage());
+        	}
         }
     }
     
@@ -659,7 +666,9 @@ public class GrantRevokeTest extends Bas
             grant("execute", "procedure s1", "f2", users[1]);
     	} catch (SQLException e) {
         	assertSQLState("42Y03", e);
-            assertEquals("'S1.F2' is not recognized as a procedure.", e.getMessage());
+        	if ( Locale.getDefault().getLanguage().equals("en") ) {
+        	    assertEquals("'S1.F2' is not recognized as a procedure.", e.getMessage());
+        	}
         }
     }
     



Mime
View raw message