SOLR-2367: use ignoreException for DIH tests that expect exceptions

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1071594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-02-17 12:26:11 +00:00
parent 28cf54a4cc
commit d964adafe9
5 changed files with 10 additions and 5 deletions

View File

@ -17,6 +17,7 @@
package org.apache.solr.handler.dataimport;
import org.apache.solr.common.SolrException;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.IndexSchema;
@ -336,7 +337,7 @@ public class DataImporter {
if (!requestParams.debug)
cumulativeStatistics.add(docBuilder.importStatistics);
} catch (Throwable t) {
LOG.error("Full Import failed", t);
SolrException.log(LOG, "Full Import failed", t);
docBuilder.rollback();
} finally {
setStatus(Status.IDLE);

View File

@ -17,6 +17,7 @@
package org.apache.solr.handler.dataimport;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrCore;
import static org.apache.solr.handler.dataimport.SolrWriter.LAST_INDEX_KEY;
@ -490,7 +491,7 @@ public class DocBuilder {
importStatistics.skipDocCount.getAndIncrement();
exception = null;//should not propogate up
} else {
LOG.error("Exception while processing: "
SolrException.log(LOG, "Exception while processing: "
+ entity.name + " document : " + docWrapper, dihe);
}
if (dihe.getErrCode() == DataImportHandlerException.SEVERE)
@ -649,7 +650,7 @@ public class DocBuilder {
importStatistics.skipDocCount.getAndIncrement();
doc = null;
} else {
LOG.error("Exception while processing: "
SolrException.log(LOG, "Exception while processing: "
+ entity.name + " document : " + doc, e);
}
if (e.getErrCode() == DataImportHandlerException.SEVERE)

View File

@ -16,6 +16,7 @@
*/
package org.apache.solr.handler.dataimport;
import org.apache.solr.common.SolrException;
import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -79,7 +80,7 @@ public class EntityProcessorBase extends EntityProcessor {
rowIterator = null;
return null;
} catch (Exception e) {
log.error("getNext() failed for query '" + query + "'", e);
SolrException.log(log, "getNext() failed for query '" + query + "'", e);
query = null;
rowIterator = null;
wrapAndThrow(DataImportHandlerException.WARN, e);

View File

@ -16,6 +16,7 @@
*/
package org.apache.solr.handler.dataimport;
import org.apache.solr.common.SolrException;
import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
import static org.apache.solr.handler.dataimport.EntityProcessorBase.*;
import static org.apache.solr.handler.dataimport.EntityProcessorBase.SKIP;
@ -240,7 +241,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
wrapAndThrow(SEVERE, e);
} else {
//SKIP is not really possible. If this calls the nextRow() again the Entityprocessor would be in an inconisttent state
log.error("Exception in entity : "+ entityName, e);
SolrException.log(log, "Exception in entity : "+ entityName, e);
return null;
}
}

View File

@ -37,6 +37,7 @@ public class TestErrorHandling extends AbstractDataImportHandlerTestCase {
@BeforeClass
public static void beforeClass() throws Exception {
initCore("dataimport-solrconfig.xml", "dataimport-schema.xml");
ignoreException("Unexpected close tag");
}
@Before @Override