You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jd...@apache.org on 2012/11/12 18:58:33 UTC
svn commit: r1408380 -
/lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java
Author: jdyer
Date: Mon Nov 12 17:58:32 2012
New Revision: 1408380
URL: http://svn.apache.org/viewvc?rev=1408380&view=rev
Log:
SOLR-2045: suppress creation of derby.log during test
Modified:
lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java
Modified: lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java?rev=1408380&r1=1408379&r2=1408380&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java (original)
+++ lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHJdbcTestCase.java Mon Nov 12 17:58:32 2012
@@ -65,7 +65,12 @@ public abstract class AbstractDIHJdbcTes
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 AbstractDIHJdbcTes
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 {