SOLR-6269

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1613619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2014-07-26 13:06:10 +00:00
parent 5cd69d47e1
commit bcfb420558
5 changed files with 8 additions and 19 deletions

View File

@ -74,7 +74,7 @@ public abstract class AbstractDIHJdbcTestCase extends
@AfterClass
public static void afterClassDihJdbcTest() throws Exception {
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
DriverManager.getConnection("jdbc:derby:;shutdown=true;territory=en_US");
} catch (SQLException e) {
// ignore...we might not even be using derby this time...
}
@ -109,7 +109,7 @@ public abstract class AbstractDIHJdbcTestCase extends
if (dbToUse == Database.DERBY) {
try {
conn = DriverManager
.getConnection("jdbc:derby:memory:derbyDB;drop=true");
.getConnection("jdbc:derby:memory:derbyDB;drop=true;territory=en_US");
} catch (SQLException e) {
if (!"08006".equals(e.getSQLState())) {
throw e;
@ -136,7 +136,7 @@ public abstract class AbstractDIHJdbcTestCase extends
protected Connection newConnection() throws Exception {
if (dbToUse == Database.DERBY) {
return DriverManager.getConnection("jdbc:derby:memory:derbyDB;");
return DriverManager.getConnection("jdbc:derby:memory:derbyDB;territory=en_US");
} else if (dbToUse == Database.HSQLDB) {
return DriverManager.getConnection("jdbc:hsqldb:mem:.");
}
@ -148,7 +148,7 @@ public abstract class AbstractDIHJdbcTestCase extends
try {
if (dbToUse == Database.DERBY) {
conn = DriverManager
.getConnection("jdbc:derby:memory:derbyDB;create=true");
.getConnection("jdbc:derby:memory:derbyDB;create=true;territory=en_US");
} else if (dbToUse == Database.HSQLDB) {
conn = DriverManager.getConnection("jdbc:hsqldb:mem:.");
} else {
@ -160,17 +160,6 @@ public abstract class AbstractDIHJdbcTestCase extends
while(cause.getCause()!=null) {
cause = cause.getCause();
}
String message = cause.getMessage();
if(cause instanceof StandardException) {
message = ((StandardException) cause).getMessageId();
}
//Derby INVALID_LOCALE_DESCRIPTION
if("XBM0X.D".equals(message)) {
log.warn("Skipping test because Database " + dbToUse + " does not support the locale " + Locale.getDefault());
skipThisTest = true;
Assume.assumeNoException(sqe);
throw sqe;
}
} finally {
try {
conn.close();

View File

@ -565,7 +565,7 @@ public abstract class AbstractSqlEntityProcessorTestCase extends
sb.append("\n<dataConfig> \n");
sb.append("<propertyWriter type=''SimplePropertiesWriter'' directory=''" + fileLocation + "'' filename=''" + fileName + "'' />\n");
sb.append("<dataSource name=''hsqldb'' driver=''org.hsqldb.jdbcDriver'' url=''jdbc:hsqldb:mem:.'' /> \n");
sb.append("<dataSource name=''derby'' driver=''org.apache.derby.jdbc.EmbeddedDriver'' url=''jdbc:derby:memory:derbyDB;'' /> \n");
sb.append("<dataSource name=''derby'' driver=''org.apache.derby.jdbc.EmbeddedDriver'' url=''jdbc:derby:memory:derbyDB;territory=en_US'' /> \n");
sb.append("<document name=''TestSqlEntityProcessor''> \n");
sb.append("<entity name=''People'' ");
sb.append("pk=''" + (random().nextBoolean() ? "ID" : "People.ID") + "'' ");

View File

@ -52,7 +52,7 @@ public class TestJdbcDataSourceConvertType extends AbstractDataImportHandlerTest
JdbcDataSource dataSource = new JdbcDataSource();
Properties p = new Properties();
p.put("driver", "org.apache.derby.jdbc.EmbeddedDriver");
p.put("url", "jdbc:derby:memory:tempDB;create=true");
p.put("url", "jdbc:derby:memory:tempDB;create=true;territory=en_US");
p.put("convertType", convertType);
List<Map<String, String>> flds = new ArrayList<>();

View File

@ -32,7 +32,7 @@ public class TestNestedChildren extends AbstractDIHJdbcTestCase {
protected String generateConfig() {
StringBuilder sb = new StringBuilder();
sb.append("<dataConfig> \n");
sb.append("<dataSource name=\"derby\" driver=\"org.apache.derby.jdbc.EmbeddedDriver\" url=\"jdbc:derby:memory:derbyDB;\" /> \n");
sb.append("<dataSource name=\"derby\" driver=\"org.apache.derby.jdbc.EmbeddedDriver\" url=\"jdbc:derby:memory:derbyDB;territory=en_US\" /> \n");
sb.append("<document name=\"TestSimplePropertiesWriter\"> \n");
sb.append("<entity name=\"FIRST\" processor=\"SqlEntityProcessor\" dataSource=\"derby\" ");
sb.append(" query=\"select 1 as id, 'PORK' as FIRST_S from sysibm.sysdummy1 \" >\n");

View File

@ -131,7 +131,7 @@ public class TestSimplePropertiesWriter extends AbstractDIHJdbcTestCase {
String q = useJdbcEscapeSyntax ? "" : "'";
sb.append("<dataConfig> \n");
sb.append("<propertyWriter dateFormat=\"" + dateFormat + "\" type=\"SimplePropertiesWriter\" directory=\"" + fileLocation + "\" filename=\"" + fileName + "\" />\n");
sb.append("<dataSource name=\"derby\" driver=\"org.apache.derby.jdbc.EmbeddedDriver\" url=\"jdbc:derby:memory:derbyDB;\" /> \n");
sb.append("<dataSource name=\"derby\" driver=\"org.apache.derby.jdbc.EmbeddedDriver\" url=\"jdbc:derby:memory:derbyDB;territory=en_US\" /> \n");
sb.append("<document name=\"TestSimplePropertiesWriter\"> \n");
sb.append("<entity name=\"SomeDates\" processor=\"SqlEntityProcessor\" dataSource=\"derby\" ");
sb.append("query=\"select 1 as id, YEAR(" + q + "${dih.last_index_time}" + q + ") as AYEAR_S from sysibm.sysdummy1 \" >\n");