Apache Lucene open-source search software
SOLR-2739: try to clean up TestSqlEntityProcessorDelta
Chris M. Hostetterc20cbcf2f85f
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.javaindex 71c2c4f5687..901414c58d3 100644--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java@@ -105,23 +105,25 @@ public class TestSqlEntityProcessorDelta extends AbstractDataImportHandlerTestCafilePath += File.separator;filePath += "dataimport.properties";File f = new File(filePath);- // execute the test only if we are able to set file to read only mode- if ((f.exists() || f.createNewFile()) && f.setReadOnly()) {- try {- List parentRow = new ArrayList();- parentRow.add(createMap("id", "1"));- MockDataSource.setIterator(FULLIMPORT_QUERY, parentRow.iterator());-- List childRow = new ArrayList();- childRow.add(createMap("desc", "hello"));- MockDataSource.setIterator("select * from y where y.A='1'", childRow- .iterator());-- runFullImport(dataConfig_delta);- assertQ(req("id:1"), "//*[@numFound='0']");- } finally {- f.delete();- }++ try {+ // execute the test only if we are able to set file to read only mode+ assumeTrue("No dataimport.properties file", f.exists() || f.createNewFile());+ assumeTrue("dataimport.proprties can't be set read only", f.setReadOnly());++ List parentRow = new ArrayList();+ parentRow.add(createMap("id", "1"));+ MockDataSource.setIterator(FULLIMPORT_QUERY, parentRow.iterator());++ List childRow = new ArrayList();+ childRow.add(createMap("desc", "hello"));+ MockDataSource.setIterator("select * from y where y.A='1'",+ childRow.iterator());++ runFullImport(dataConfig_delta);+ assertQ(req("id:1"), "//*[@numFound='0']");+ } finally {+ f.delete();}}