From c19a5527d86e8558b4b196195db474b8a542df9d Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Tue, 6 Aug 2013 22:13:40 +0000 Subject: [PATCH] SOLR-4952: get SolrCoreCheckLockOnStartupTest using solrconfig.snippet.randomindexconfig.xml git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1511134 13f79535-47bb-0310-9956-ffa450edef68 --- .../conf/solrconfig-nativelock.xml | 34 ------------------- .../conf/solrconfig-simplelock.xml | 34 ------------------- .../solrconfig.snippet.randomindexconfig.xml | 7 +++- .../core/SolrCoreCheckLockOnStartupTest.java | 8 +++-- 4 files changed, 12 insertions(+), 71 deletions(-) delete mode 100644 solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml delete mode 100644 solr/core/src/test-files/solr/collection1/conf/solrconfig-simplelock.xml diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml deleted file mode 100644 index 7b5b6f7de93..00000000000 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - ${solr.data.dir:} - - ${tests.luceneMatchVersion:LUCENE_CURRENT} - - - ${useCompoundFile:false} - native - - diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-simplelock.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-simplelock.xml deleted file mode 100644 index 7981b846850..00000000000 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-simplelock.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - ${solr.data.dir:} - - ${tests.luceneMatchVersion:LUCENE_CURRENT} - - - ${useCompoundFile:false} - simple - - diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml index 0733d5c19dd..7514aa4788b 100644 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml +++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml @@ -38,5 +38,10 @@ A solrconfig.xml snippet containing indexConfig settings for randomized testing. 1000 10000 - single + + + ${solr.tests.lockType:single} diff --git a/solr/core/src/test/org/apache/solr/core/SolrCoreCheckLockOnStartupTest.java b/solr/core/src/test/org/apache/solr/core/SolrCoreCheckLockOnStartupTest.java index e6ce1da1ff0..e07b5ed6b75 100644 --- a/solr/core/src/test/org/apache/solr/core/SolrCoreCheckLockOnStartupTest.java +++ b/solr/core/src/test/org/apache/solr/core/SolrCoreCheckLockOnStartupTest.java @@ -62,12 +62,14 @@ public class SolrCoreCheckLockOnStartupTest extends SolrTestCaseJ4 { ignoreException("locked"); try { + System.setProperty("solr.tests.lockType","simple"); //opening a new core on the same index - initCore("solrconfig-simplelock.xml", "schema.xml"); + initCore("solrconfig-basic.xml", "schema.xml"); if (checkForCoreInitException(LockObtainFailedException.class)) return; fail("Expected " + LockObtainFailedException.class.getSimpleName()); } finally { + System.clearProperty("solr.tests.lockType"); unIgnoreException("locked"); indexWriter.close(); directory.close(); @@ -86,13 +88,15 @@ public class SolrCoreCheckLockOnStartupTest extends SolrTestCaseJ4 { ignoreException("locked"); try { + System.setProperty("solr.tests.lockType","native"); //opening a new core on the same index - initCore("solrconfig-nativelock.xml", "schema.xml"); + initCore("solrconfig-basic.xml", "schema.xml"); CoreContainer cc = h.getCoreContainer(); if (checkForCoreInitException(LockObtainFailedException.class)) return; fail("Expected " + LockObtainFailedException.class.getSimpleName()); } finally { + System.clearProperty("solr.tests.lockType"); unIgnoreException("locked"); indexWriter.close(); directory.close();