From dc58134cdc235d07a0790794a75d1e690e791460 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 1 Apr 2011 06:58:12 +0000 Subject: [PATCH] SOLR-2452: commit my state git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/solr2452@1087603 13f79535-47bb-0310-9956-ffa450edef68 --- dev-tools/eclipse/dot.classpath | 1 + lucene/common-build.xml | 5 +- solr/build.xml | 1170 ++--------------- solr/common-build.xml | 660 +--------- solr/contrib/analysis-extras/build.xml | 201 +-- solr/contrib/clustering/build.xml | 163 +-- solr/contrib/contrib-build.xml | 49 + .../dataimporthandler-extras/build.xml | 58 + .../dataimport/MailEntityProcessor.java | 0 .../dataimport/TikaEntityProcessor.java | 0 .../dataimport/TestMailEntityProcessor.java | 0 .../dataimport/TestTikaEntityProcessor.java | 0 .../conf/dataimport-schema-no-unique-key.xml | 0 .../conf/dataimport-solrconfig.xml | 0 .../src}/test/resources/solr-word.pdf | Bin solr/contrib/dataimporthandler/build.xml | 289 +--- solr/contrib/extraction/build.xml | 171 +-- solr/contrib/uima/build.xml | 167 +-- .../solr/BaseDistributedSearchTestCase.java | 2 +- .../org/apache/solr/JSONTestUtil.java | 0 .../org/apache/solr/SolrTestCaseJ4.java | 20 +- .../solr/analysis/BaseTokenTestCase.java | 0 .../solr/util/AbstractSolrTestCase.java | 2 +- .../org/apache/solr/util/TestHarness.java | 2 +- .../solrj/MergeIndexesExampleTestBase.java | 3 +- .../solrj/MultiCoreExampleTestBase.java | 3 +- .../client/solrj/SolrExampleBinaryTest.java | 3 +- .../solr/client/solrj/SolrJettyTestBase.java | 3 +- .../solr/client/solrj/TestBatchUpdate.java | 3 +- .../solrj/embedded/JettyWebappTest.java | 5 +- .../embedded/LargeVolumeBinaryJettyTest.java | 3 +- .../embedded/LargeVolumeEmbeddedTest.java | 3 +- .../solrj/embedded/LargeVolumeJettyTest.java | 3 +- .../embedded/SolrExampleEmbeddedTest.java | 3 +- .../solrj/embedded/SolrExampleJettyTest.java | 3 +- .../embedded/SolrExampleStreamingTest.java | 3 +- .../solrj/response/TermsResponseTest.java | 3 +- .../response/TestSpellCheckResponse.java | 3 +- .../solr/cloud/BasicDistributedZkTest.java | 2 +- .../common/util/TestSystemIdResolver.java | 12 +- .../solr/servlet/NoCacheHeaderTest.java | 2 +- .../spelling/suggest/PersistenceTest.java | 4 +- .../org/apache/solr/util/ExternalPaths.java | 46 + 43 files changed, 415 insertions(+), 2655 deletions(-) create mode 100644 solr/contrib/contrib-build.xml create mode 100644 solr/contrib/dataimporthandler-extras/build.xml rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/test/resources/solr-dihextras/conf/dataimport-schema-no-unique-key.xml (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml (100%) rename solr/contrib/{dataimporthandler/src/extras => dataimporthandler-extras/src}/test/resources/solr-word.pdf (100%) rename solr/src/{test => test-framework}/org/apache/solr/BaseDistributedSearchTestCase.java (99%) rename solr/src/{test => test-framework}/org/apache/solr/JSONTestUtil.java (100%) rename solr/src/{test => test-framework}/org/apache/solr/SolrTestCaseJ4.java (96%) rename solr/src/{test => test-framework}/org/apache/solr/analysis/BaseTokenTestCase.java (100%) rename solr/src/{test => test-framework}/org/apache/solr/util/AbstractSolrTestCase.java (99%) rename solr/src/{java => test-framework}/org/apache/solr/util/TestHarness.java (99%) create mode 100644 solr/src/test/org/apache/solr/util/ExternalPaths.java diff --git a/dev-tools/eclipse/dot.classpath b/dev-tools/eclipse/dot.classpath index 987ea9ffcca..a5d64f92dcc 100644 --- a/dev-tools/eclipse/dot.classpath +++ b/dev-tools/eclipse/dot.classpath @@ -57,6 +57,7 @@ + diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 3225f7e0774..5d17436f1f8 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -515,8 +515,11 @@ - + + diff --git a/solr/build.xml b/solr/build.xml index 5821f9953e6..82c1cd09094 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -17,36 +17,81 @@ limitations under the License. --> - + + Solr - - + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - @@ -64,1068 +109,45 @@ - - - - - - - + + + - - - - - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + - - + + - - - - - - - - - - - - - - - - - - - - ... - - This task requires that the property 'stub.src.path' be set. - - It must contain a "path" listing directories containing source - files that this task should use when looking for classes that - need factories created, the format is platform specific -- - typically it is colon seperated in Unix, semi-colon seperated - on windows, ie: - - ant stub-factories -Dstub.src.path="./src:../lucene/contrib:../lucene/src/java" - - FYI: The file ${stub.list} contains a list of classes - that seem to need stub factories. (if java files can be found to - use as guides for creating them). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Clover not found. Code coverage reports disabled. - - - - - - ################################################################## - Clover not found. - Please make sure clover.jar is in ANT_HOME/lib, or made available - to Ant using other mechanisms like -lib or CLASSPATH. - ################################################################## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - See ${example}/README.txt for how to run the Solr example configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uploading artifacts to ${scp.user}@people.apache.org:${remote.staging.dir} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - diff --git a/solr/common-build.xml b/solr/common-build.xml index 861ff237062..32006ba1470 100644 --- a/solr/common-build.xml +++ b/solr/common-build.xml @@ -15,624 +15,106 @@ limitations under the License. --> - + This file is designed for importing into a main build file, and not intended for standalone use. - - - - - - - + + - + + + - - - + + + + + + - - - - - - - + + + + + - + - - + - - - - - - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Building checksums for '@{file}' - - - - + + + + + + + + + + - - + + + - - - - - - - - - - - - - - - - - - - - -
- - ]]>
- - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Signing @{input.file} Sig File: @{output.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - ########################################################################## - Maven ant tasks not found. - - Please download the Maven ant tasks JAR (maven-ant-tasks-2.1.1.jar) - from http://maven.apache.org/ant-tasks/download.html and add it to your - $$HOME/.ant/lib/ directory, or to your $$ANT_HOME/lib/ directory, or - to your $$CLASSPATH, or add "-lib /path/to/maven-ant-tasks-2.1.1.jar" - to the ant command. - ########################################################################## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/solr/contrib/analysis-extras/build.xml b/solr/contrib/analysis-extras/build.xml index 1b135e3c4af..d4c455e4186 100644 --- a/solr/contrib/analysis-extras/build.xml +++ b/solr/contrib/analysis-extras/build.xml @@ -17,194 +17,43 @@ limitations under the License. --> - - - - - + Additional analysis components - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/solr/contrib/clustering/build.xml b/solr/contrib/clustering/build.xml index 7090ca710bc..799ce0f77fe 100644 --- a/solr/contrib/clustering/build.xml +++ b/solr/contrib/clustering/build.xml @@ -17,168 +17,15 @@ limitations under the License. --> - - - - - + Clustering Integraton - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/solr/contrib/contrib-build.xml b/solr/contrib/contrib-build.xml new file mode 100644 index 00000000000..252f357eb60 --- /dev/null +++ b/solr/contrib/contrib-build.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solr/contrib/dataimporthandler-extras/build.xml b/solr/contrib/dataimporthandler-extras/build.xml new file mode 100644 index 00000000000..d03b584b0e5 --- /dev/null +++ b/solr/contrib/dataimporthandler-extras/build.xml @@ -0,0 +1,58 @@ + + + + + + + + Data Import Handler Extras + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java rename to solr/contrib/dataimporthandler-extras/src/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java diff --git a/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java rename to solr/contrib/dataimporthandler-extras/src/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java diff --git a/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java rename to solr/contrib/dataimporthandler-extras/src/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java diff --git a/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java rename to solr/contrib/dataimporthandler-extras/src/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java diff --git a/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-schema-no-unique-key.xml b/solr/contrib/dataimporthandler-extras/src/test/resources/solr-dihextras/conf/dataimport-schema-no-unique-key.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-schema-no-unique-key.xml rename to solr/contrib/dataimporthandler-extras/src/test/resources/solr-dihextras/conf/dataimport-schema-no-unique-key.xml diff --git a/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler-extras/src/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml rename to solr/contrib/dataimporthandler-extras/src/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml diff --git a/solr/contrib/dataimporthandler/src/extras/test/resources/solr-word.pdf b/solr/contrib/dataimporthandler-extras/src/test/resources/solr-word.pdf similarity index 100% rename from solr/contrib/dataimporthandler/src/extras/test/resources/solr-word.pdf rename to solr/contrib/dataimporthandler-extras/src/test/resources/solr-word.pdf diff --git a/solr/contrib/dataimporthandler/build.xml b/solr/contrib/dataimporthandler/build.xml index 5b9ddc18dec..bdb0cd5e6cb 100644 --- a/solr/contrib/dataimporthandler/build.xml +++ b/solr/contrib/dataimporthandler/build.xml @@ -17,295 +17,16 @@ limitations under the License. --> - + - - - - - Data Import Handler - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/solr/contrib/extraction/build.xml b/solr/contrib/extraction/build.xml index de7542d54b4..112d1731549 100644 --- a/solr/contrib/extraction/build.xml +++ b/solr/contrib/extraction/build.xml @@ -17,177 +17,16 @@ limitations under the License. --> - + - - - - Solr Integration with Tika for extracting content from binary file formats such as Microsoft Word and Adobe PDF. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/solr/contrib/uima/build.xml b/solr/contrib/uima/build.xml index 34dbefec748..085b96c0ffb 100644 --- a/solr/contrib/uima/build.xml +++ b/solr/contrib/uima/build.xml @@ -17,173 +17,16 @@ limitations under the License. --> - + - - - - Solr Integration with UIMA for extracting metadata from arbitrary (text) fields and enrich document with features extracted from UIMA types (language, sentences, concepts, named entities, etc.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tests failed! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/src/test-framework/org/apache/solr/BaseDistributedSearchTestCase.java similarity index 99% rename from solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java rename to solr/src/test-framework/org/apache/solr/BaseDistributedSearchTestCase.java index c32ccc52920..1ec2654a6e0 100644 --- a/solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java +++ b/solr/src/test-framework/org/apache/solr/BaseDistributedSearchTestCase.java @@ -150,7 +150,7 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 { * (default is in test-files) */ public String getSolrHome() { - return SolrTestCaseJ4.TEST_HOME; + return SolrTestCaseJ4.TEST_HOME(); } @Override diff --git a/solr/src/test/org/apache/solr/JSONTestUtil.java b/solr/src/test-framework/org/apache/solr/JSONTestUtil.java similarity index 100% rename from solr/src/test/org/apache/solr/JSONTestUtil.java rename to solr/src/test-framework/org/apache/solr/JSONTestUtil.java diff --git a/solr/src/test/org/apache/solr/SolrTestCaseJ4.java b/solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java similarity index 96% rename from solr/src/test/org/apache/solr/SolrTestCaseJ4.java rename to solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java index 546850a2666..da5d837af74 100755 --- a/solr/src/test/org/apache/solr/SolrTestCaseJ4.java +++ b/solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java @@ -86,7 +86,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase { /** Call initCore in @BeforeClass to instantiate a solr core in your test class. * deleteCore will be called for you via SolrTestCaseJ4 @AfterClass */ public static void initCore(String config, String schema) throws Exception { - initCore(config, schema, TEST_HOME); + initCore(config, schema, TEST_HOME()); } /** Call initCore in @BeforeClass to instantiate a solr core in your test class. @@ -1057,22 +1057,8 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase { } } - private static final String SOURCE_HOME = determineSourceHome(); - public static String TEST_HOME = getFile("solr/conf").getParent(); - public static String WEBAPP_HOME = new File(SOURCE_HOME, "src/webapp/web").getAbsolutePath(); - public static String EXAMPLE_HOME = new File(SOURCE_HOME, "example/solr").getAbsolutePath(); - public static String EXAMPLE_MULTICORE_HOME = new File(SOURCE_HOME, "example/multicore").getAbsolutePath(); - public static String EXAMPLE_SCHEMA=EXAMPLE_HOME+"/conf/schema.xml"; - public static String EXAMPLE_CONFIG=EXAMPLE_HOME+"/conf/solrconfig.xml"; - - static String determineSourceHome() { - // ugly, ugly hack to determine the example home without depending on the CWD - // this is needed for example/multicore tests which reside outside the classpath - File base = getFile("solr/conf/").getAbsoluteFile(); - while (!new File(base, "solr/CHANGES.txt").exists()) { - base = base.getParentFile(); - } - return new File(base, "solr/").getAbsolutePath(); + public static String TEST_HOME() { + return getFile("solr/conf").getParent(); } public static Throwable getRootCause(Throwable t) { diff --git a/solr/src/test/org/apache/solr/analysis/BaseTokenTestCase.java b/solr/src/test-framework/org/apache/solr/analysis/BaseTokenTestCase.java similarity index 100% rename from solr/src/test/org/apache/solr/analysis/BaseTokenTestCase.java rename to solr/src/test-framework/org/apache/solr/analysis/BaseTokenTestCase.java diff --git a/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java b/solr/src/test-framework/org/apache/solr/util/AbstractSolrTestCase.java similarity index 99% rename from solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java rename to solr/src/test-framework/org/apache/solr/util/AbstractSolrTestCase.java index 26aa2025b6a..e26cfda594c 100644 --- a/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java +++ b/solr/src/test-framework/org/apache/solr/util/AbstractSolrTestCase.java @@ -90,7 +90,7 @@ public abstract class AbstractSolrTestCase extends LuceneTestCase { * (default is in test-files) */ public String getSolrHome() { - return SolrTestCaseJ4.TEST_HOME; + return SolrTestCaseJ4.TEST_HOME(); } /** diff --git a/solr/src/java/org/apache/solr/util/TestHarness.java b/solr/src/test-framework/org/apache/solr/util/TestHarness.java similarity index 99% rename from solr/src/java/org/apache/solr/util/TestHarness.java rename to solr/src/test-framework/org/apache/solr/util/TestHarness.java index ea5a703133c..4eee02b88cc 100644 --- a/solr/src/java/org/apache/solr/util/TestHarness.java +++ b/solr/src/test-framework/org/apache/solr/util/TestHarness.java @@ -61,7 +61,7 @@ import java.util.Map; * writing testcases. * *

- * This class lives in the main source tree (and not in the test source + * This class lives in the tests-framework source tree (and not in the test source * tree), so that it will be included with even the most minimal solr * distribution, in order to encourage plugin writers to create unit * tests for their plugins. diff --git a/solr/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java b/solr/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java index 6ff054653c1..3c6b2d13c45 100644 --- a/solr/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java +++ b/solr/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java @@ -24,6 +24,7 @@ import org.apache.solr.client.solrj.request.UpdateRequest.ACTION; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.SolrCore; +import org.apache.solr.util.ExternalPaths; /** * Abstract base class for testing merge indexes command @@ -37,7 +38,7 @@ public abstract class MergeIndexesExampleTestBase extends SolrExampleTestBase { @Override public String getSolrHome() { - return SolrJettyTestBase.EXAMPLE_MULTICORE_HOME; + return ExternalPaths.EXAMPLE_MULTICORE_HOME; } @Override diff --git a/solr/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java b/solr/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java index 6aa58516774..39fae68318b 100644 --- a/solr/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java +++ b/solr/src/test/org/apache/solr/client/solrj/MultiCoreExampleTestBase.java @@ -25,6 +25,7 @@ import org.apache.solr.client.solrj.response.CoreAdminResponse; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.SolrCore; +import org.apache.solr.util.ExternalPaths; /** @@ -36,7 +37,7 @@ public abstract class MultiCoreExampleTestBase extends SolrExampleTestBase // protected static final CoreContainer cores = new CoreContainer(); protected static CoreContainer cores; - @Override public String getSolrHome() { return SolrJettyTestBase.EXAMPLE_MULTICORE_HOME; } + @Override public String getSolrHome() { return ExternalPaths.EXAMPLE_MULTICORE_HOME; } @Override public String getSchemaFile() { return getSolrHome()+"/core0/conf/schema.xml"; } @Override public String getSolrConfigFile() { return getSolrHome()+"/core0/conf/solrconfig.xml"; } diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java b/solr/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java index 220c64c47b6..6baa3775570 100644 --- a/solr/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java @@ -22,6 +22,7 @@ import org.apache.solr.client.solrj.SolrServer; import org.apache.solr.client.solrj.impl.BinaryRequestWriter; import org.apache.solr.client.solrj.impl.BinaryResponseParser; import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; @@ -32,7 +33,7 @@ import org.junit.BeforeClass; public class SolrExampleBinaryTest extends SolrExampleTests { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } @Override diff --git a/solr/src/test/org/apache/solr/client/solrj/SolrJettyTestBase.java b/solr/src/test/org/apache/solr/client/solrj/SolrJettyTestBase.java index ad8a70aa299..4ca9a7511f3 100755 --- a/solr/src/test/org/apache/solr/client/solrj/SolrJettyTestBase.java +++ b/solr/src/test/org/apache/solr/client/solrj/SolrJettyTestBase.java @@ -24,6 +24,7 @@ import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; import org.apache.solr.client.solrj.embedded.JettySolrRunner; import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; +import org.apache.solr.util.ExternalPaths; import org.junit.AfterClass; abstract public class SolrJettyTestBase extends SolrTestCaseJ4 @@ -32,7 +33,7 @@ abstract public class SolrJettyTestBase extends SolrTestCaseJ4 // using configs in the test directory allows more flexibility to change "example" // without breaking configs. - public String getSolrHome() { return EXAMPLE_HOME; } + public String getSolrHome() { return ExternalPaths.EXAMPLE_HOME; } public static JettySolrRunner jetty; public static int port; diff --git a/solr/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java b/solr/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java index 9f5a4b50a31..69fb792a8e5 100644 --- a/solr/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java +++ b/solr/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java @@ -22,6 +22,7 @@ import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; import org.apache.solr.client.solrj.request.RequestWriter; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrInputDocument; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; import org.junit.Test; @@ -38,7 +39,7 @@ public class TestBatchUpdate extends SolrJettyTestBase { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } static final int numdocs = 1000; diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java index cce5d3dae04..ab67aad3fc2 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java @@ -26,6 +26,7 @@ import org.apache.lucene.util.LuceneTestCase; import org.apache.commons.io.IOUtils; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.SolrJettyTestBase; +import org.apache.solr.util.ExternalPaths; import org.mortbay.jetty.Connector; import org.mortbay.jetty.Server; import org.mortbay.jetty.bio.SocketConnector; @@ -47,13 +48,13 @@ public class JettyWebappTest extends LuceneTestCase public void setUp() throws Exception { super.setUp(); - System.setProperty("solr.solr.home", SolrJettyTestBase.EXAMPLE_HOME); + System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME); File dataDir = new File(SolrTestCaseJ4.TEMP_DIR, getClass().getName() + "-" + System.currentTimeMillis()); dataDir.mkdirs(); System.setProperty("solr.data.dir", dataDir.getCanonicalPath()); - String path = SolrJettyTestBase.WEBAPP_HOME; + String path = ExternalPaths.WEBAPP_HOME; server = new Server(port); // insecure: only use for tests!!!! diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java index 69b13facb3c..0e4a507cd16 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeBinaryJettyTest.java @@ -17,6 +17,7 @@ package org.apache.solr.client.solrj.embedded; import org.apache.solr.client.solrj.LargeVolumeTestBase; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; /** @@ -26,6 +27,6 @@ import org.junit.BeforeClass; public class LargeVolumeBinaryJettyTest extends LargeVolumeTestBase { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } } diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java index b72098a1c98..a01e6a7d29f 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeEmbeddedTest.java @@ -18,11 +18,12 @@ package org.apache.solr.client.solrj.embedded; import org.apache.solr.client.solrj.LargeVolumeTestBase; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; public class LargeVolumeEmbeddedTest extends LargeVolumeTestBase { @BeforeClass public static void beforeTest() throws Exception { - initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME); + initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME); } } diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java index 430316493cd..25040b06503 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/LargeVolumeJettyTest.java @@ -18,11 +18,12 @@ package org.apache.solr.client.solrj.embedded; import org.apache.solr.client.solrj.LargeVolumeTestBase; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; public class LargeVolumeJettyTest extends LargeVolumeTestBase { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } } diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleEmbeddedTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleEmbeddedTest.java index 74839724d3d..6a569bc44d6 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleEmbeddedTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleEmbeddedTest.java @@ -18,6 +18,7 @@ package org.apache.solr.client.solrj.embedded; import org.apache.solr.client.solrj.SolrExampleTests; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; /** @@ -30,6 +31,6 @@ public class SolrExampleEmbeddedTest extends SolrExampleTests { @BeforeClass public static void beforeTest() throws Exception { - initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME); + initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME); } } diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java index b18605aae12..41bbaeb29e2 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java @@ -19,6 +19,7 @@ package org.apache.solr.client.solrj.embedded; import org.apache.solr.client.solrj.SolrExampleTests; import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; +import org.apache.solr.util.ExternalPaths; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -33,7 +34,7 @@ public class SolrExampleJettyTest extends SolrExampleTests { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } @Test diff --git a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java index 66e1ed0cd02..a7747d09be8 100644 --- a/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java @@ -21,6 +21,7 @@ import org.apache.solr.client.solrj.SolrExampleTests; import org.apache.solr.client.solrj.SolrServer; import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; import org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; @@ -32,7 +33,7 @@ import org.junit.BeforeClass; public class SolrExampleStreamingTest extends SolrExampleTests { @BeforeClass public static void beforeTest() throws Exception { - createJetty(EXAMPLE_HOME, null, null); + createJetty(ExternalPaths.EXAMPLE_HOME, null, null); } @Override diff --git a/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java b/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java index 5e0eed5313b..4a599f0b1b4 100644 --- a/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java +++ b/solr/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java @@ -24,6 +24,7 @@ import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.client.solrj.request.QueryRequest; import org.apache.solr.client.solrj.response.TermsResponse.Term; +import org.apache.solr.util.ExternalPaths; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -35,7 +36,7 @@ public class TermsResponseTest extends SolrJettyTestBase { @BeforeClass public static void beforeTest() throws Exception { - initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME); + initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME); } @Before diff --git a/solr/src/test/org/apache/solr/client/solrj/response/TestSpellCheckResponse.java b/solr/src/test/org/apache/solr/client/solrj/response/TestSpellCheckResponse.java index ff789f5088e..646d8bca727 100644 --- a/solr/src/test/org/apache/solr/client/solrj/response/TestSpellCheckResponse.java +++ b/solr/src/test/org/apache/solr/client/solrj/response/TestSpellCheckResponse.java @@ -25,6 +25,7 @@ import org.apache.solr.client.solrj.response.SpellCheckResponse.Correction; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.SpellingParams; +import org.apache.solr.util.ExternalPaths; import org.junit.BeforeClass; import org.junit.Test; @@ -40,7 +41,7 @@ public class TestSpellCheckResponse extends SolrJettyTestBase { @BeforeClass public static void beforeTest() throws Exception { // createJetty(EXAMPLE_HOME, null, null); - initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME); + initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME); // initCore("solrconfig.xml", "schema.xml", null); } diff --git a/solr/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java index 2452a90f498..23b420c2aae 100644 --- a/solr/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java +++ b/solr/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java @@ -60,7 +60,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase { @BeforeClass public static void beforeClass() throws Exception { - System.setProperty("solr.solr.home", SolrTestCaseJ4.TEST_HOME); + System.setProperty("solr.solr.home", SolrTestCaseJ4.TEST_HOME()); } @Override diff --git a/solr/src/test/org/apache/solr/common/util/TestSystemIdResolver.java b/solr/src/test/org/apache/solr/common/util/TestSystemIdResolver.java index a827db9f97b..d8ffdebfaf8 100644 --- a/solr/src/test/org/apache/solr/common/util/TestSystemIdResolver.java +++ b/solr/src/test/org/apache/solr/common/util/TestSystemIdResolver.java @@ -38,9 +38,9 @@ public class TestSystemIdResolver extends LuceneTestCase { } public void testResolving() throws Exception { - final ResourceLoader loader = new SolrResourceLoader(SolrTestCaseJ4.TEST_HOME, this.getClass().getClassLoader()); + final ResourceLoader loader = new SolrResourceLoader(SolrTestCaseJ4.TEST_HOME(), this.getClass().getClassLoader()); final SystemIdResolver resolver = new SystemIdResolver(loader); - final String fileUri = new File(SolrTestCaseJ4.TEST_HOME+"/crazy-path-to-config.xml").toURI().toASCIIString(); + final String fileUri = new File(SolrTestCaseJ4.TEST_HOME()+"/crazy-path-to-config.xml").toURI().toASCIIString(); assertEquals("solrres:/test.xml", SystemIdResolver.createSystemIdFromResourceName("test.xml")); assertEquals("solrres://@/usr/local/etc/test.xml", SystemIdResolver.createSystemIdFromResourceName("/usr/local/etc/test.xml")); @@ -60,10 +60,10 @@ public class TestSystemIdResolver extends LuceneTestCase { assertEntityResolving(resolver, "solrres:/schema.xml", "solrres:/solrconfig.xml", "schema.xml"); assertEntityResolving(resolver, "solrres:/org/apache/solr/common/util/TestSystemIdResolver.class", "solrres:/org/apache/solr/common/ResourceLoader.class", "util/TestSystemIdResolver.class"); - assertEntityResolving(resolver, SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME+"/conf/schema.xml"), - SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME+"/conf/solrconfig.xml"), "schema.xml"); - assertEntityResolving(resolver, SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME+"/crazy-path-to-schema.xml"), - SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME+"/crazy-path-to-config.xml"), "crazy-path-to-schema.xml"); + assertEntityResolving(resolver, SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME()+"/conf/schema.xml"), + SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME()+"/conf/solrconfig.xml"), "schema.xml"); + assertEntityResolving(resolver, SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME()+"/crazy-path-to-schema.xml"), + SystemIdResolver.createSystemIdFromResourceName(SolrTestCaseJ4.TEST_HOME()+"/crazy-path-to-config.xml"), "crazy-path-to-schema.xml"); // test, that resolving works if somebody uses an absolute file:-URI in a href attribute, the resolver should return null (default fallback) assertNull(resolver.resolveEntity(null, null, "solrres:/solrconfig.xml", fileUri)); diff --git a/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java b/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java index e1d5bc696e0..ee360bf2f9e 100644 --- a/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java +++ b/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java @@ -31,7 +31,7 @@ import org.junit.Test; public class NoCacheHeaderTest extends CacheHeaderTestBase { @BeforeClass public static void beforeTest() throws Exception { - createJetty(TEST_HOME, "solr/conf/solrconfig-nocache.xml", null); + createJetty(TEST_HOME(), "solr/conf/solrconfig-nocache.xml", null); } // The tests diff --git a/solr/src/test/org/apache/solr/spelling/suggest/PersistenceTest.java b/solr/src/test/org/apache/solr/spelling/suggest/PersistenceTest.java index 4e4c899b1aa..58997c5730e 100644 --- a/solr/src/test/org/apache/solr/spelling/suggest/PersistenceTest.java +++ b/solr/src/test/org/apache/solr/spelling/suggest/PersistenceTest.java @@ -49,7 +49,7 @@ public class PersistenceTest extends SolrTestCaseJ4 { for (String k : keys) { lookup.add(k, new Float(k.length())); } - File storeDir = new File(TEST_HOME); + File storeDir = new File(TEST_HOME()); lookup.store(storeDir); lookup = new TSTLookup(); lookup.load(storeDir); @@ -66,7 +66,7 @@ public class PersistenceTest extends SolrTestCaseJ4 { for (String k : keys) { lookup.add(k, new Float(k.length())); } - File storeDir = new File(TEST_HOME); + File storeDir = new File(TEST_HOME()); lookup.store(storeDir); lookup = new JaspellLookup(); lookup.load(storeDir); diff --git a/solr/src/test/org/apache/solr/util/ExternalPaths.java b/solr/src/test/org/apache/solr/util/ExternalPaths.java new file mode 100644 index 00000000000..9ea244c6773 --- /dev/null +++ b/solr/src/test/org/apache/solr/util/ExternalPaths.java @@ -0,0 +1,46 @@ +package org.apache.solr.util; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.io.File; + +import org.apache.solr.SolrTestCaseJ4; + +/** + * Some tests need to reach outside the classpath to get certain resources (e.g. the example configuration). + * This class provides some paths to allow them to do this. + * @lucene.internal + */ +public class ExternalPaths { + private static final String SOURCE_HOME = determineSourceHome(); + public static String WEBAPP_HOME = new File(SOURCE_HOME, "src/webapp/web").getAbsolutePath(); + public static String EXAMPLE_HOME = new File(SOURCE_HOME, "example/solr").getAbsolutePath(); + public static String EXAMPLE_MULTICORE_HOME = new File(SOURCE_HOME, "example/multicore").getAbsolutePath(); + public static String EXAMPLE_SCHEMA=EXAMPLE_HOME+"/conf/schema.xml"; + public static String EXAMPLE_CONFIG=EXAMPLE_HOME+"/conf/solrconfig.xml"; + + static String determineSourceHome() { + // ugly, ugly hack to determine the example home without depending on the CWD + // this is needed for example/multicore tests which reside outside the classpath + File base = SolrTestCaseJ4.getFile("solr/conf").getAbsoluteFile(); + while (!new File(base, "solr/CHANGES.txt").exists()) { + base = base.getParentFile(); + } + return new File(base, "solr/").getAbsolutePath(); + } +}