mirror of https://github.com/apache/lucene.git
SOLR-13988: Harden CreateCollectionCleanupTest. Incorporate Dawid Weiss' suggestion for windows
This commit is contained in:
parent
155ab116a2
commit
7d5d44a3c4
|
@ -21,6 +21,7 @@ import static org.hamcrest.CoreMatchers.hasItem;
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.hamcrest.CoreMatchers.not;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
|
import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
|
||||||
|
@ -78,7 +79,8 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
Path tmpDir = createTempDir();
|
Path tmpDir = createTempDir();
|
||||||
tmpDir.toFile().setWritable(false);
|
tmpDir = tmpDir.resolve("foo");
|
||||||
|
Files.createFile(tmpDir);
|
||||||
properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
|
properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
|
||||||
create.setProperties(properties);
|
create.setProperties(properties);
|
||||||
expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
|
expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
|
||||||
|
@ -102,7 +104,8 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
Path tmpDir = createTempDir();
|
Path tmpDir = createTempDir();
|
||||||
tmpDir.toFile().setWritable(false);
|
tmpDir = tmpDir.resolve("foo");
|
||||||
|
Files.createFile(tmpDir);
|
||||||
properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
|
properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
|
||||||
create.setProperties(properties);
|
create.setProperties(properties);
|
||||||
create.setAsyncId("testAsyncCreateCollectionCleanup");
|
create.setAsyncId("testAsyncCreateCollectionCleanup");
|
||||||
|
|
Loading…
Reference in New Issue