Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

fix test bug

James Dyerb134c54a4edb
diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
index 330965ecc77..5ffd1ad7807 100644
--- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
+++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestSimplePropertiesWriter.java
@@ -50,8 +50,12 @@ public class TestSimplePropertiesWriter extends AbstractDIHJdbcTestCase {
}
@After
public void spwAfter() throws Exception {
- new File(fileLocation + File.separatorChar + fileName).delete();
- new File(fileLocation).delete();
+ //If an Assume was tripped while setting up the test,
+ //the file might not ever have been created...
+ if(fileLocation!=null) {
+ new File(fileLocation + File.separatorChar + fileName).delete();
+ new File(fileLocation).delete();
+ }
}
@Test
public void testSimplePropertiesWriter() throws Exception {