mirror of https://github.com/apache/lucene.git
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:
parent
0de0c53e35
commit
b87c71a09b
|
@ -65,7 +65,12 @@ public abstract class AbstractDIHJdbcTestCase extends AbstractDataImportHandlerT
|
||||||
public static void beforeClassDihJdbcTest() throws Exception {
|
public static void beforeClassDihJdbcTest() throws Exception {
|
||||||
try {
|
try {
|
||||||
Class.forName("org.hsqldb.jdbcDriver").newInstance();
|
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();
|
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
|
||||||
|
if(oldProp!=null) {
|
||||||
|
System.setProperty("derby.stream.error.field", oldProp);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -326,13 +331,8 @@ public abstract class AbstractDIHJdbcTestCase extends AbstractDataImportHandlerT
|
||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
Timestamp theTime = new Timestamp(System.currentTimeMillis() - 10000); //10 seconds ago
|
Timestamp theTime = new Timestamp(System.currentTimeMillis() - 10000); //10 seconds ago
|
||||||
try {
|
try {
|
||||||
if(dbToUse==Database.DERBY) {
|
if(dbToUse==Database.DERBY) {
|
||||||
String oldProp = System.getProperty("derby.stream.error.field");
|
|
||||||
System.setProperty("derby.stream.error.field", "DerbyUtil.DEV_NULL");
|
|
||||||
conn = DriverManager.getConnection("jdbc:derby:memory:derbyDB;create=true");
|
conn = DriverManager.getConnection("jdbc:derby:memory:derbyDB;create=true");
|
||||||
if(oldProp!=null) {
|
|
||||||
System.setProperty("derby.stream.error.field", oldProp);
|
|
||||||
}
|
|
||||||
} else if(dbToUse==Database.HSQLDB) {
|
} else if(dbToUse==Database.HSQLDB) {
|
||||||
conn = DriverManager.getConnection("jdbc:hsqldb:mem:.");
|
conn = DriverManager.getConnection("jdbc:hsqldb:mem:.");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue