Modified:
trunk/src/testsuite/regression/MetaDataRegressionTest.java
Log:
Can't store some characters in tablenames on the Mac, so we have to account for that.
Modified: trunk/src/testsuite/regression/MetaDataRegressionTest.java
===================================================================
--- trunk/src/testsuite/regression/MetaDataRegressionTest.java 2008-05-29 02:29:23 UTC (rev 6783)
+++ trunk/src/testsuite/regression/MetaDataRegressionTest.java 2008-05-29 02:38:47 UTC (rev 6784)
@@ -36,6 +36,8 @@
import java.util.HashMap;
import java.util.Properties;
+import junit.framework.ComparisonFailure;
+
import testsuite.BaseTestCase;
import com.mysql.jdbc.Driver;
@@ -2086,7 +2088,18 @@
// demonstrate that these are all in the Cp1252 encoding
for (int i = 0; i < fields.length; i++) {
- assertEquals(fields[i], new String(fields[i].getBytes("Cp1252"), "Cp1252"));
+ try {
+ assertEquals(fields[i], new String(fields[i].getBytes("Cp1252"), "Cp1252"));
+ } catch (ComparisonFailure cfEx) {
+ if (i == 3) {
+ // If we're on a mac, we're out of luck
+ // we can't store this in the filesystem...
+
+ if (!System.getProperty("os.name").startsWith("Mac")) {
+ throw cfEx;
+ }
+ }
+ }
}
byte[] asBytes = fields[0].getBytes("utf-8");
@@ -2098,8 +2111,19 @@
int j = 0;
while (this.rs.next()) {
- assertEquals("Wrong column name:" + this.rs.getString(4),
+ try {
+ assertEquals("Wrong column name:" + this.rs.getString(4),
fields[j++], this.rs.getString(4));
+ } catch (ComparisonFailure cfEx) {
+ if (j == 3) {
+ // If we're on a mac, we're out of luck
+ // we can't store this in the filesystem...
+
+ if (!System.getProperty("os.name").startsWith("Mac")) {
+ throw cfEx;
+ }
+ }
+ }
}
this.rs.close();
@@ -2109,8 +2133,19 @@
ResultSetMetaData rsmd = this.rs.getMetaData();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
- assertEquals("Wrong column name:" + rsmd.getColumnName(i),
+ try {
+ assertEquals("Wrong column name:" + rsmd.getColumnName(i),
fields[i - 1], rsmd.getColumnName(i));
+ } catch (ComparisonFailure cfEx) {
+ if (i - 1 == 3) {
+ // If we're on a mac, we're out of luck
+ // we can't store this in the filesystem...
+
+ if (!System.getProperty("os.name").startsWith("Mac")) {
+ throw cfEx;
+ }
+ }
+ }
}
} finally {
closeMemberJDBCResources();
| Thread |
|---|
| • Connector/J commit: r6784 - trunk/src/testsuite/regression | mmatthews | 29 May |