diff --git a/dev-tools/scripts/SOLR-2452.patch.hack.pl b/dev-tools/scripts/SOLR-2452.patch.hack.pl index 873cbad35ff..3b1d1d6582c 100755 --- a/dev-tools/scripts/SOLR-2452.patch.hack.pl +++ b/dev-tools/scripts/SOLR-2452.patch.hack.pl @@ -30,11 +30,20 @@ use strict; use warnings; my @moves = ( + 'solr/contrib/analysis-extras/src/test-files/solr-analysis-extras' + => 'solr/contrib/analysis-extras/src/test-files/analysis-extras/solr', + + 'solr/contrib/analysis-extras/src/test-files' + => 'solr/contrib/analysis-extras/src/test-files/analysis-extras', + 'solr/contrib/clustering/src/test/java' => 'solr/contrib/clustering/src/test', + 'solr/contrib/clustering/src/test/resources/solr-clustering' + => 'solr/contrib/clustering/src/test-files/clustering/solr', + 'solr/contrib/clustering/src/test/resources' - => 'solr/contrib/clustering/src/test-files', + => 'solr/contrib/clustering/src/test-files/clustering', 'solr/contrib/clustering/src/main/java' => 'solr/contrib/clustering/src/java', @@ -42,8 +51,11 @@ my @moves = ( 'solr/contrib/dataimporthandler/src/test/java' => 'solr/contrib/dataimporthandler/src/test', + 'solr/contrib/dataimporthandler/src/test/resources/solr-dih' + => 'solr/contrib/dataimporthandler/src/test-files/dih/solr', + 'solr/contrib/dataimporthandler/src/test/resources' - => 'solr/contrib/dataimporthandler/src/test-files', + => 'solr/contrib/dataimporthandler/src/test-files/dih', 'solr/contrib/dataimporthandler/src/main/java' => 'solr/contrib/dataimporthandler/src/java', @@ -54,8 +66,11 @@ my @moves = ( 'solr/contrib/dataimporthandler/src/extras/test/java' => 'solr/contrib/dataimporthandler-extras/src/test', + 'solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras' + => 'solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr', + 'solr/contrib/dataimporthandler/src/extras/test/resources' - => 'solr/contrib/dataimporthandler-extras/src/test-files', + => 'solr/contrib/dataimporthandler-extras/src/test-files/dihextras', 'solr/contrib/dataimporthandler/src/extras/main/java' => 'solr/contrib/dataimporthandler-extras/src/java', @@ -63,8 +78,11 @@ my @moves = ( 'solr/contrib/extraction/src/test/java' => 'solr/contrib/extraction/src/test', + 'solr/contrib/extraction/src/test/resources/solr-extraction' + => 'solr/contrib/extraction/src/test-files/extraction/solr', + 'solr/contrib/extraction/src/test/resources' - => 'solr/contrib/extraction/src/test-files', + => 'solr/contrib/extraction/src/test-files/extraction', 'solr/contrib/extraction/src/main/java' => 'solr/contrib/extraction/src/java', @@ -72,8 +90,11 @@ my @moves = ( 'solr/contrib/uima/src/test/java' => 'solr/contrib/uima/src/test', + 'solr/contrib/uima/src/test/resources/solr-uima' + => 'solr/contrib/uima/src/test-files/uima/solr', + 'solr/contrib/uima/src/test/resources' - => 'solr/contrib/uima/src/test-files', + => 'solr/contrib/uima/src/test-files/uima', 'solr/contrib/uima/src/main/java' => 'solr/contrib/uima/src/java', @@ -82,13 +103,13 @@ my @moves = ( => 'solr/contrib/uima/src/resources', 'solr/src/test-files/books.csv' - => 'solr/solrj/src/test-files/books.csv', + => 'solr/solrj/src/test-files/solrj/books.csv', 'solr/src/test-files/sampleDateFacetResponse.xml' - => 'solr/solrj/src/test-files/sampleDateFacetResponse.xml', + => 'solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml', 'solr/src/test-files/solr/shared' - => 'solr/solrj/src/test-files/solr/shared', + => 'solr/solrj/src/test-files/solrj/solr/shared', 'solr/src/solrj' => 'solr/solrj/src/java', @@ -150,19 +171,19 @@ my @moves = ( my @copies = ( 'solr/core/src/test-files/README' - => 'solr/solrj/src/test-files/README', + => 'solr/solrj/src/test-files/solrj/README', 'solr/core/src/test-files/solr/crazy-path-to-schema.xml' - => 'solr/solrj/src/test-files/solr/crazy-path-to-schema.xml', + => 'solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml', 'solr/core/src/test-files/solr/conf/schema.xml' - => 'solr/solrj/src/test-files/solr/conf/schema.xml', + => 'solr/solrj/src/test-files/solrj/solr/conf/schema.xml', 'solr/core/src/test-files/solr/conf/schema-replication1.xml' - => 'solr/solrj/src/test-files/solr/conf/schema-replication1.xml', + => 'solr/solrj/src/test-files/solrj/solr/conf/schema-replication1.xml', 'solr/core/src/test-files/solr/conf/solrconfig-slave1.xml' - => 'solr/solrj/src/test-files/solr/conf/solrconfig-slave1.xml', + => 'solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml', ); my $diff; diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 5922eca3d7c..eab05b7b15c 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -373,11 +373,12 @@ Bug Fixes Build ---------------------- -* SOLR-2452: Rewrote the Solr build system: +* SOLR-2452,SOLR-2653,LUCENE-3323,SOLR-2659,LUCENE-3329,SOLR-2666: + Rewrote the Solr build system: - Integrated more fully with the Lucene build system: generalized the Lucene build system and eliminated duplication. - Converted all Solr contribs to the Lucene/Solr conventional src/ layout: - java/, resources/, test/, and test-files/. + java/, resources/, test/, and test-files/. - Created a new Solr-internal module named "core" by moving the java/, test/, and test-files/ directories from solr/src/ to solr/core/src/. - Merged solr/src/webapp/src/ into solr/core/src/java/. diff --git a/solr/contrib/analysis-extras/src/test-files/solr-analysis-extras/conf/schema-icucollate.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/conf/schema-icucollate.xml similarity index 100% rename from solr/contrib/analysis-extras/src/test-files/solr-analysis-extras/conf/schema-icucollate.xml rename to solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/conf/schema-icucollate.xml diff --git a/solr/contrib/analysis-extras/src/test-files/solr-analysis-extras/conf/solrconfig-icucollate.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/conf/solrconfig-icucollate.xml similarity index 100% rename from solr/contrib/analysis-extras/src/test-files/solr-analysis-extras/conf/solrconfig-icucollate.xml rename to solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/conf/solrconfig-icucollate.xml diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java index ddf9d0f4f95..63fcfbc3820 100644 --- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java +++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java @@ -74,8 +74,8 @@ public class TestICUCollationField extends SolrTestCaseJ4 { confDir.mkdir(); // copy over configuration files - FileUtils.copyFile(getFile("solr-analysis-extras/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml")); - FileUtils.copyFile(getFile("solr-analysis-extras/conf/schema-icucollate.xml"), new File(confDir, "schema.xml")); + FileUtils.copyFile(getFile("analysis-extras/solr/conf/solrconfig-icucollate.xml"), new File(confDir, "solrconfig.xml")); + FileUtils.copyFile(getFile("analysis-extras/solr/conf/schema-icucollate.xml"), new File(confDir, "schema.xml")); // generate custom collation rules (DIN 5007-2), saving to customrules.dat RuleBasedCollator baseCollator = (RuleBasedCollator) Collator.getInstance(new ULocale("de", "DE")); diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/carrot2/stoplabels.mt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/carrot2/stoplabels.mt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/carrot2/stoplabels.mt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/carrot2/stoplabels.mt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/carrot2/stopwords.mt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/carrot2/stopwords.mt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/carrot2/stopwords.mt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/carrot2/stopwords.mt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/custom/stoplabels.mt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/custom/stoplabels.mt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/custom/stoplabels.mt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/custom/stoplabels.mt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/custom/stopwords.mt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/custom/stopwords.mt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/clustering/custom/stopwords.mt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/clustering/custom/stopwords.mt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/mapping-ISOLatin1Accent.txt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/mapping-ISOLatin1Accent.txt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/mapping-ISOLatin1Accent.txt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/mapping-ISOLatin1Accent.txt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/protwords.txt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/protwords.txt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/protwords.txt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/protwords.txt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/schema.xml b/solr/contrib/clustering/src/test-files/clustering/solr/conf/schema.xml similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/schema.xml rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/schema.xml diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/solrconfig.xml b/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/solrconfig.xml rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/spellings.txt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/spellings.txt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/spellings.txt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/spellings.txt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/stopwords.txt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/stopwords.txt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/stopwords.txt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/stopwords.txt diff --git a/solr/contrib/clustering/src/test-files/solr-clustering/conf/synonyms.txt b/solr/contrib/clustering/src/test-files/clustering/solr/conf/synonyms.txt similarity index 100% rename from solr/contrib/clustering/src/test-files/solr-clustering/conf/synonyms.txt rename to solr/contrib/clustering/src/test-files/clustering/solr/conf/synonyms.txt diff --git a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java index c4fec5e0a53..5e570178433 100644 --- a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java +++ b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java @@ -28,7 +28,7 @@ public abstract class AbstractClusteringTestCase extends SolrTestCaseJ4 { @BeforeClass public static void beforeClass() throws Exception { - initCore("solrconfig.xml", "schema.xml", "solr-clustering"); + initCore("solrconfig.xml", "schema.xml", "clustering/solr"); numberOfDocs = 0; for (String[] doc : DOCUMENTS) { assertNull(h.validateUpdate(adoc("id", Integer.toString(numberOfDocs), "url", doc[0], "title", doc[1], "snippet", doc[2]))); diff --git a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java index 758d829f7cd..41ccf23beb1 100644 --- a/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java +++ b/solr/contrib/clustering/src/test/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java @@ -25,8 +25,7 @@ public class DistributedClusteringComponentTest extends @Override public String getSolrHome() { - // TODO: this should work with just "solr-clustering"... - return getFile("solr-clustering").getAbsolutePath(); + return "clustering/solr"; } @Override diff --git a/solr/contrib/dataimporthandler-extras/src/test-files/solr-word.pdf b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr-word.pdf similarity index 100% rename from solr/contrib/dataimporthandler-extras/src/test-files/solr-word.pdf rename to solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr-word.pdf diff --git a/solr/contrib/dataimporthandler-extras/src/test-files/solr-dihextras/conf/dataimport-schema-no-unique-key.xml b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-schema-no-unique-key.xml similarity index 100% rename from solr/contrib/dataimporthandler-extras/src/test-files/solr-dihextras/conf/dataimport-schema-no-unique-key.xml rename to solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-schema-no-unique-key.xml diff --git a/solr/contrib/dataimporthandler-extras/src/test-files/solr-dihextras/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml similarity index 100% rename from solr/contrib/dataimporthandler-extras/src/test-files/solr-dihextras/conf/dataimport-solrconfig.xml rename to solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml diff --git a/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java index 7912c5f92d8..61a0a09d4a2 100644 --- a/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java +++ b/solr/contrib/dataimporthandler-extras/src/test/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java @@ -40,7 +40,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase { "" + " " + " " + - " " + + " " + " " + " " + " " + @@ -58,7 +58,7 @@ public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase { @BeforeClass public static void beforeClass() throws Exception { - initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", getFile("solr-dihextras").getAbsolutePath()); + initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", getFile("dihextras/solr").getAbsolutePath()); } @Test diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/contentstream-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/contentstream-solrconfig.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/data-config-with-datasource.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/data-config-with-datasource.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/data-config-with-datasource.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/data-config-with-datasource.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/data-config-with-transformer.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/data-config-with-transformer.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/data-config-with-transformer.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/data-config-with-transformer.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataconfig-contentstream.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataconfig-contentstream.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataconfig-contentstream.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataconfig-contentstream.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-nodatasource-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-nodatasource-solrconfig.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-schema.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-schema.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-schema.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-schema.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-solr_id-schema.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solr_id-schema.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-solr_id-schema.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solr_id-schema.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/dataimport-solrconfig.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/protwords.txt b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/protwords.txt similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/protwords.txt rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/protwords.txt diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/single-entity-data-config.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/single-entity-data-config.xml similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/single-entity-data-config.xml rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/single-entity-data-config.xml diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/stopwords.txt b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/stopwords.txt similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/stopwords.txt rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/stopwords.txt diff --git a/solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/synonyms.txt b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/synonyms.txt similarity index 100% rename from solr/contrib/dataimporthandler/src/test-files/solr-dih/conf/synonyms.txt rename to solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/synonyms.txt diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java index f4ebad9e8d3..af1a3b2538a 100644 --- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java +++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java @@ -54,7 +54,7 @@ public abstract class AbstractDataImportHandlerTestCase extends // note, a little twisted that we shadow this static method public static void initCore(String config, String schema) throws Exception { - initCore(config, schema, getFile("solr-dih").getAbsolutePath()); + initCore(config, schema, getFile("dih/solr").getAbsolutePath()); } @Override diff --git a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java index 0ea8b1db84c..b7ea4ec2c98 100644 --- a/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java +++ b/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java @@ -39,7 +39,7 @@ import java.util.List; * @since solr 1.4 */ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCase { - private static final String CONF_DIR = "." + File.separator + "solr-dih" + File.separator + "conf" + File.separator; + private static final String CONF_DIR = "dih/solr/conf/"; SolrInstance instance = null; JettySolrRunner jetty; diff --git a/solr/contrib/extraction/src/test-files/arabic.pdf b/solr/contrib/extraction/src/test-files/extraction/arabic.pdf similarity index 100% rename from solr/contrib/extraction/src/test-files/arabic.pdf rename to solr/contrib/extraction/src/test-files/extraction/arabic.pdf diff --git a/solr/contrib/extraction/src/test-files/example.html b/solr/contrib/extraction/src/test-files/extraction/example.html similarity index 100% rename from solr/contrib/extraction/src/test-files/example.html rename to solr/contrib/extraction/src/test-files/extraction/example.html diff --git a/solr/contrib/extraction/src/test-files/password-is-solrcell.docx b/solr/contrib/extraction/src/test-files/extraction/password-is-solrcell.docx similarity index 100% rename from solr/contrib/extraction/src/test-files/password-is-solrcell.docx rename to solr/contrib/extraction/src/test-files/extraction/password-is-solrcell.docx diff --git a/solr/contrib/extraction/src/test-files/simple.html b/solr/contrib/extraction/src/test-files/extraction/simple.html similarity index 100% rename from solr/contrib/extraction/src/test-files/simple.html rename to solr/contrib/extraction/src/test-files/extraction/simple.html diff --git a/solr/contrib/extraction/src/test-files/solr-word.pdf b/solr/contrib/extraction/src/test-files/extraction/solr-word.pdf similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-word.pdf rename to solr/contrib/extraction/src/test-files/extraction/solr-word.pdf diff --git a/solr/contrib/extraction/src/test-files/solr-extraction/conf/protwords.txt b/solr/contrib/extraction/src/test-files/extraction/solr/conf/protwords.txt similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-extraction/conf/protwords.txt rename to solr/contrib/extraction/src/test-files/extraction/solr/conf/protwords.txt diff --git a/solr/contrib/extraction/src/test-files/solr-extraction/conf/schema.xml b/solr/contrib/extraction/src/test-files/extraction/solr/conf/schema.xml similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-extraction/conf/schema.xml rename to solr/contrib/extraction/src/test-files/extraction/solr/conf/schema.xml diff --git a/solr/contrib/extraction/src/test-files/solr-extraction/conf/solrconfig.xml b/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-extraction/conf/solrconfig.xml rename to solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml diff --git a/solr/contrib/extraction/src/test-files/solr-extraction/conf/stopwords.txt b/solr/contrib/extraction/src/test-files/extraction/solr/conf/stopwords.txt similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-extraction/conf/stopwords.txt rename to solr/contrib/extraction/src/test-files/extraction/solr/conf/stopwords.txt diff --git a/solr/contrib/extraction/src/test-files/solr-extraction/conf/synonyms.txt b/solr/contrib/extraction/src/test-files/extraction/solr/conf/synonyms.txt similarity index 100% rename from solr/contrib/extraction/src/test-files/solr-extraction/conf/synonyms.txt rename to solr/contrib/extraction/src/test-files/extraction/solr/conf/synonyms.txt diff --git a/solr/contrib/extraction/src/test-files/version_control.txt b/solr/contrib/extraction/src/test-files/extraction/version_control.txt similarity index 100% rename from solr/contrib/extraction/src/test-files/version_control.txt rename to solr/contrib/extraction/src/test-files/extraction/version_control.txt diff --git a/solr/contrib/extraction/src/test-files/version_control.xml b/solr/contrib/extraction/src/test-files/extraction/version_control.xml similarity index 100% rename from solr/contrib/extraction/src/test-files/version_control.xml rename to solr/contrib/extraction/src/test-files/extraction/version_control.xml diff --git a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java index f42b2d4df3d..4b57a60e0d8 100644 --- a/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java +++ b/solr/contrib/extraction/src/test/org/apache/solr/handler/extraction/ExtractingRequestHandlerTest.java @@ -41,7 +41,7 @@ import org.junit.Test; public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { @BeforeClass public static void beforeClass() throws Exception { - initCore("solrconfig.xml", "schema.xml", "solr-extraction"); + initCore("solrconfig.xml", "schema.xml", getFile("extraction/solr").getAbsolutePath()); } @Override @@ -56,7 +56,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { public void testExtraction() throws Exception { ExtractingRequestHandler handler = (ExtractingRequestHandler) h.getCore().getRequestHandler("/update/extract"); assertTrue("handler is null and it shouldn't be", handler != null); - loadLocal("solr-word.pdf", + loadLocal("extraction/solr-word.pdf", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", @@ -73,7 +73,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("title:solr-word"), "//*[@numFound='1']"); - loadLocal("simple.html", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/simple.html", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "fmap.language", "extractedLanguage", @@ -86,7 +86,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("title:Welcome"), "//*[@numFound='1']"); - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple2", "uprefix", "t_", "lowernames", "true", @@ -105,7 +105,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("+id:simple2 +t_abcxyz:[* TO *]"), "//*[@numFound='1']"); // load again in the exact same way, but boost one field - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple3", "uprefix", "t_", "lowernames", "true", @@ -120,7 +120,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("+id:simple3 +t_content_type:[* TO *]"), "//*[@numFound='1']");//test lowercase and then uprefix // test capture - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple4", "uprefix", "t_", "capture","p", // capture only what is in the title element @@ -129,7 +129,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("+id:simple4 +t_content:Solr"), "//*[@numFound='1']"); assertQ(req("+id:simple4 +t_p:\"here is some text\""), "//*[@numFound='1']"); - loadLocal("version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "literal.id", "three", @@ -152,7 +152,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { try { ignoreException("unknown field 'a'"); ignoreException("unknown field 'meta'"); // TODO: should this exception be happening? - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple2", "lowernames", "true", "captureAttr", "true", @@ -168,7 +168,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { } - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple2", ExtractingParams.DEFAULT_FIELD, "defaultExtr",//test that unmapped fields go to the text field when no uprefix is specified "lowernames", "true", @@ -180,7 +180,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("defaultExtr:http\\://www.apache.org"), "//*[@numFound='1']"); //Test when both uprefix and default are specified. - loadLocal("simple.html", + loadLocal("extraction/simple.html", "literal.id","simple2", ExtractingParams.DEFAULT_FIELD, "defaultExtr",//test that unmapped fields go to the text field when no uprefix is specified ExtractingParams.UNKNOWN_FIELD_PREFIX, "t_", @@ -198,7 +198,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { ExtractingRequestHandler handler = (ExtractingRequestHandler) h.getCore().getRequestHandler("/update/extract"); assertTrue("handler is null and it shouldn't be", handler != null); //test literal - loadLocal("version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "fmap.content", "extractedContent", @@ -217,7 +217,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertQ(req("extractionLiteralMV:two"), "//*[@numFound='1']"); try { - loadLocal("version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "fmap.content", "extractedContent", @@ -233,7 +233,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { //nothing to see here, move along } - loadLocal("version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.xml", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "fmap.content", "extractedContent", @@ -253,7 +253,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertTrue("handler is null and it shouldn't be", handler != null); // Load plain text specifying MIME type: - loadLocal("version_control.txt", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.txt", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "literal.id", "one", @@ -272,13 +272,13 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertTrue("handler is null and it shouldn't be", handler != null); // Load plain text specifying filename - loadLocal("version_control.txt", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", + loadLocal("extraction/version_control.txt", "fmap.created", "extractedDate", "fmap.producer", "extractedProducer", "fmap.creator", "extractedCreator", "fmap.Keywords", "extractedKeywords", "fmap.Author", "extractedAuthor", "literal.id", "one", "fmap.language", "extractedLanguage", "fmap.content", "extractedContent", - ExtractingParams.RESOURCE_NAME, "version_control.txt" + ExtractingParams.RESOURCE_NAME, "extraction/version_control.txt" ); assertQ(req("extractedContent:Apache"), "//*[@numFound='0']"); assertU(commit()); @@ -292,7 +292,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { public void testExtractOnly() throws Exception { ExtractingRequestHandler handler = (ExtractingRequestHandler) h.getCore().getRequestHandler("/update/extract"); assertTrue("handler is null and it shouldn't be", handler != null); - SolrQueryResponse rsp = loadLocal("solr-word.pdf", ExtractingParams.EXTRACT_ONLY, "true"); + SolrQueryResponse rsp = loadLocal("extraction/solr-word.pdf", ExtractingParams.EXTRACT_ONLY, "true"); assertTrue("rsp is null and it shouldn't be", rsp != null); NamedList list = rsp.getValues(); @@ -306,7 +306,7 @@ public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 { assertTrue("title is null and it shouldn't be", title != null); assertTrue(extraction.indexOf(" 3 - /TestAE.xml + /uima/TestAE.xml false @@ -1001,7 +1001,7 @@ 3 - /TestAE.xml + /uima/TestAE.xml false @@ -1031,7 +1031,7 @@ 3 - /TestExceptionAE.xml + /uima/TestExceptionAE.xml false false @@ -1051,7 +1051,7 @@ 3 - /TestExceptionAE.xml + /uima/TestExceptionAE.xml true id diff --git a/solr/contrib/uima/src/test-files/solr-uima/conf/spellings.txt b/solr/contrib/uima/src/test-files/uima/solr/conf/spellings.txt similarity index 100% rename from solr/contrib/uima/src/test-files/solr-uima/conf/spellings.txt rename to solr/contrib/uima/src/test-files/uima/solr/conf/spellings.txt diff --git a/solr/contrib/uima/src/test-files/solr-uima/conf/stopwords.txt b/solr/contrib/uima/src/test-files/uima/solr/conf/stopwords.txt similarity index 100% rename from solr/contrib/uima/src/test-files/solr-uima/conf/stopwords.txt rename to solr/contrib/uima/src/test-files/uima/solr/conf/stopwords.txt diff --git a/solr/contrib/uima/src/test-files/solr-uima/conf/synonyms.txt b/solr/contrib/uima/src/test-files/uima/solr/conf/synonyms.txt similarity index 100% rename from solr/contrib/uima/src/test-files/solr-uima/conf/synonyms.txt rename to solr/contrib/uima/src/test-files/uima/solr/conf/synonyms.txt diff --git a/solr/contrib/uima/src/test/org/apache/solr/uima/processor/UIMAUpdateRequestProcessorTest.java b/solr/contrib/uima/src/test/org/apache/solr/uima/processor/UIMAUpdateRequestProcessorTest.java index 74164a54aef..eba0e09298e 100644 --- a/solr/contrib/uima/src/test/org/apache/solr/uima/processor/UIMAUpdateRequestProcessorTest.java +++ b/solr/contrib/uima/src/test/org/apache/solr/uima/processor/UIMAUpdateRequestProcessorTest.java @@ -50,7 +50,7 @@ public class UIMAUpdateRequestProcessorTest extends SolrTestCaseJ4 { @BeforeClass public static void beforeClass() throws Exception { - initCore("solrconfig.xml", "schema.xml", "solr-uima"); + initCore("solrconfig.xml", "schema.xml", getFile("uima/solr").getAbsolutePath()); } @Override diff --git a/solr/solrj/src/test-files/README b/solr/solrj/src/test-files/solrj/README similarity index 100% rename from solr/solrj/src/test-files/README rename to solr/solrj/src/test-files/solrj/README diff --git a/solr/solrj/src/test-files/books.csv b/solr/solrj/src/test-files/solrj/books.csv similarity index 100% rename from solr/solrj/src/test-files/books.csv rename to solr/solrj/src/test-files/solrj/books.csv diff --git a/solr/solrj/src/test-files/docs1.xml b/solr/solrj/src/test-files/solrj/docs1.xml similarity index 100% rename from solr/solrj/src/test-files/docs1.xml rename to solr/solrj/src/test-files/solrj/docs1.xml diff --git a/solr/solrj/src/test-files/docs2.xml b/solr/solrj/src/test-files/solrj/docs2.xml similarity index 100% rename from solr/solrj/src/test-files/docs2.xml rename to solr/solrj/src/test-files/solrj/docs2.xml diff --git a/solr/solrj/src/test-files/sampleDateFacetResponse.xml b/solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml similarity index 100% rename from solr/solrj/src/test-files/sampleDateFacetResponse.xml rename to solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml diff --git a/solr/solrj/src/test-files/solr/conf/schema-replication1.xml b/solr/solrj/src/test-files/solrj/solr/conf/schema-replication1.xml similarity index 100% rename from solr/solrj/src/test-files/solr/conf/schema-replication1.xml rename to solr/solrj/src/test-files/solrj/solr/conf/schema-replication1.xml diff --git a/solr/solrj/src/test-files/solr/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/conf/schema.xml similarity index 100% rename from solr/solrj/src/test-files/solr/conf/schema.xml rename to solr/solrj/src/test-files/solrj/solr/conf/schema.xml diff --git a/solr/solrj/src/test-files/solr/conf/solrconfig-slave1.xml b/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml similarity index 100% rename from solr/solrj/src/test-files/solr/conf/solrconfig-slave1.xml rename to solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml diff --git a/solr/solrj/src/test-files/solr/crazy-path-to-schema.xml b/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml similarity index 100% rename from solr/solrj/src/test-files/solr/crazy-path-to-schema.xml rename to solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml diff --git a/solr/solrj/src/test-files/solr/shared/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/shared/conf/schema.xml similarity index 100% rename from solr/solrj/src/test-files/solr/shared/conf/schema.xml rename to solr/solrj/src/test-files/solrj/solr/shared/conf/schema.xml diff --git a/solr/solrj/src/test-files/solr/shared/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml similarity index 100% rename from solr/solrj/src/test-files/solr/shared/conf/solrconfig.xml rename to solr/solrj/src/test-files/solrj/solr/shared/conf/solrconfig.xml diff --git a/solr/solrj/src/test-files/solr/shared/conf/stopwords-en.txt b/solr/solrj/src/test-files/solrj/solr/shared/conf/stopwords-en.txt similarity index 100% rename from solr/solrj/src/test-files/solr/shared/conf/stopwords-en.txt rename to solr/solrj/src/test-files/solrj/solr/shared/conf/stopwords-en.txt diff --git a/solr/solrj/src/test-files/solr/shared/conf/stopwords-fr.txt b/solr/solrj/src/test-files/solrj/solr/shared/conf/stopwords-fr.txt similarity index 100% rename from solr/solrj/src/test-files/solr/shared/conf/stopwords-fr.txt rename to solr/solrj/src/test-files/solrj/solr/shared/conf/stopwords-fr.txt diff --git a/solr/solrj/src/test-files/solr/shared/solr.xml b/solr/solrj/src/test-files/solrj/solr/shared/solr.xml similarity index 100% rename from solr/solrj/src/test-files/solr/shared/solr.xml rename to solr/solrj/src/test-files/solrj/solr/shared/solr.xml diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index 60cad11f534..30e074d7901 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -441,7 +441,7 @@ abstract public class SolrExampleTests extends SolrJettyTestBase Assert.assertEquals( 0, rsp.getResults().getNumFound() ); ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/csv"); - up.addFile(getFile("books.csv")); + up.addFile(getFile("solrj/books.csv")); up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true); NamedList result = server.request(up); assertNotNull("Couldn't upload books.csv", result); @@ -458,8 +458,8 @@ abstract public class SolrExampleTests extends SolrJettyTestBase Assert.assertEquals( 0, rsp.getResults().getNumFound() ); ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update"); - up.addFile(getFile("docs1.xml")); // 2 - up.addFile(getFile("docs2.xml")); // 3 + up.addFile(getFile("solrj/docs1.xml")); // 2 + up.addFile(getFile("solrj/docs2.xml")); // 3 up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true); NamedList result = server.request(up); assertNotNull("Couldn't upload xml files", result); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java index fd38bcaac82..d5f3a598733 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java @@ -214,7 +214,7 @@ public class TestLBHttpSolrServer extends LuceneTestCase { } public String getSchemaFile() { - return "." + File.separator + "solr" + File.separator + "conf" + File.separator + "schema-replication1.xml"; + return "solrj/solr/conf/schema-replication1.xml"; } public String getConfDir() { @@ -226,9 +226,7 @@ public class TestLBHttpSolrServer extends LuceneTestCase { } public String getSolrConfigFile() { - String fname = ""; - fname = "." + File.separator + "solr" + File.separator + "conf" + File.separator + "solrconfig-slave1.xml"; - return fname; + return "solrj/solr/conf/solrconfig-slave1.xml"; } public void setUp() throws Exception { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java index bf3c1687162..89905a9795d 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java @@ -62,7 +62,7 @@ public class TestSolrProperties extends LuceneTestCase { private static final XPathFactory xpathFactory = XPathFactory.newInstance(); public String getSolrHome() { - return "solr/shared"; + return "solrj/solr/shared"; } public String getOrigSolrXml() { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java index 06fa8093bed..75d814161eb 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java @@ -39,7 +39,7 @@ public class QueryResponseTest extends LuceneTestCase { @Test public void testDateFacets() throws Exception { XMLResponseParser parser = new XMLResponseParser(); - InputStream is = new SolrResourceLoader(null, null).openResource("sampleDateFacetResponse.xml"); + InputStream is = new SolrResourceLoader(null, null).openResource("solrj/sampleDateFacetResponse.xml"); assertNotNull(is); Reader in = new InputStreamReader(is, "UTF-8"); NamedList response = parser.processResponse(in); diff --git a/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java b/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java index ec989f8a0c9..566233ed40f 100755 --- a/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/util/ContentStreamTest.java @@ -49,7 +49,7 @@ public class ContentStreamTest extends LuceneTestCase public void testFileStream() throws IOException { - InputStream is = new SolrResourceLoader(null, null).openResource( "README" ); + InputStream is = new SolrResourceLoader(null, null).openResource( "solrj/README" ); assertNotNull( is ); File file = new File(TEMP_DIR, "README"); FileOutputStream os = new FileOutputStream(file); diff --git a/solr/solrj/src/test/org/apache/solr/common/util/TestSystemIdResolver.java b/solr/solrj/src/test/org/apache/solr/common/util/TestSystemIdResolver.java index d8ffdebfaf8..c40ed4dd410 100644 --- a/solr/solrj/src/test/org/apache/solr/common/util/TestSystemIdResolver.java +++ b/solr/solrj/src/test/org/apache/solr/common/util/TestSystemIdResolver.java @@ -38,9 +38,10 @@ public class TestSystemIdResolver extends LuceneTestCase { } public void testResolving() throws Exception { - final ResourceLoader loader = new SolrResourceLoader(SolrTestCaseJ4.TEST_HOME(), this.getClass().getClassLoader()); + final String testHome = SolrTestCaseJ4.getFile("solrj/solr/conf").getParent(); + final ResourceLoader loader = new SolrResourceLoader(testHome, 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(testHome+"/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 +61,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(testHome+"/conf/schema.xml"), + SystemIdResolver.createSystemIdFromResourceName(testHome+"/conf/solrconfig.xml"), "schema.xml"); + assertEntityResolving(resolver, SystemIdResolver.createSystemIdFromResourceName(testHome+"/crazy-path-to-schema.xml"), + SystemIdResolver.createSystemIdFromResourceName(testHome+"/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));