SOLR-2045: suppress creation of derby.log during test

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1408377 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Dyer 2012-11-12 17:54:45 +00:00
parent 0de0c53e35
commit b87c71a09b
1 changed files with 6 additions and 6 deletions

View File

@ -65,7 +65,12 @@ public abstract class AbstractDIHJdbcTestCase extends AbstractDataImportHandlerT
public static void beforeClassDihJdbcTest() throws Exception {
try {
Class.forName("org.hsqldb.jdbcDriver").newInstance();
String oldProp = System.getProperty("derby.stream.error.field");
System.setProperty("derby.stream.error.field", "DerbyUtil.DEV_NULL");
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
if(oldProp!=null) {
System.setProperty("derby.stream.error.field", oldProp);
}
} catch (Exception e) {
throw e;
}
@ -326,13 +331,8 @@ public abstract class AbstractDIHJdbcTestCase extends AbstractDataImportHandlerT
PreparedStatement ps = null;
Timestamp theTime = new Timestamp(System.currentTimeMillis() - 10000); //10 seconds ago
try {
if(dbToUse==Database.DERBY) {
String oldProp = System.getProperty("derby.stream.error.field");
System.setProperty("derby.stream.error.field", "DerbyUtil.DEV_NULL");
if(dbToUse==Database.DERBY) {
conn = DriverManager.getConnection("jdbc:derby:memory:derbyDB;create=true");
if(oldProp!=null) {
System.setProperty("derby.stream.error.field", oldProp);
}
} else if(dbToUse==Database.HSQLDB) {
conn = DriverManager.getConnection("jdbc:hsqldb:mem:.");
} else {