mirror of https://github.com/apache/lucene.git
SOLR-2061: Generate jar containing test classes
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1087722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce06cfb088
commit
0c7a172d4f
|
@ -57,6 +57,7 @@
|
|||
<classpathentry kind="src" path="solr/src/webapp/src"/>
|
||||
<classpathentry kind="src" path="solr/src/common"/>
|
||||
<classpathentry kind="src" path="solr/src/solrj"/>
|
||||
<classpathentry kind="src" path="solr/src/test-framework"/>
|
||||
<classpathentry kind="src" path="solr/src/test"/>
|
||||
<classpathentry kind="src" path="solr/src/test-files"/>
|
||||
<classpathentry kind="src" path="solr/contrib/analysis-extras/src/java"/>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test-files" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test-framework" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/lucene-libs" />
|
||||
|
|
|
@ -44,9 +44,8 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -44,9 +44,8 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -44,9 +44,8 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -43,10 +43,9 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<groupId>org.apache.solr</groupId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -47,9 +47,8 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -44,9 +44,8 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
<module>src</module>
|
||||
<module>src/solrj</module>
|
||||
<module>src/webapp</module>
|
||||
<module>src/test-framework</module>
|
||||
<module>contrib</module>
|
||||
</modules>
|
||||
<properties>
|
||||
|
|
|
@ -197,17 +197,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
|
@ -248,6 +237,24 @@
|
|||
</programs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-test-source</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>test-framework</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -42,12 +42,6 @@
|
|||
<artifactId>lucene-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-analyzers-common</artifactId>
|
||||
|
@ -88,11 +82,6 @@
|
|||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<directory>${build-directory}</directory>
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.solr</groupId>
|
||||
<artifactId>solr-parent</artifactId>
|
||||
<version>@version@</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.apache.solr</groupId>
|
||||
<artifactId>solr-test-framework</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Apache Solr Test Framework</name>
|
||||
<description>Apache Solr Test Framework</description>
|
||||
<properties>
|
||||
<module-directory>solr/src/test-framework</module-directory>
|
||||
<build-directory>../../build</build-directory>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>solr-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-test-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<directory>${build-directory}</directory>
|
||||
<outputDirectory>${build-directory}/classes/test-framework</outputDirectory>
|
||||
<sourceDirectory>.</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>.</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -176,6 +176,24 @@
|
|||
</sequential>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-test-framework" depends="compileTestFramework,javadoc-dep"
|
||||
description="Generates javadoc documentation for the Solr test-framework.">
|
||||
<sequential>
|
||||
<mkdir dir="${build.javadoc}/test-framework"/>
|
||||
|
||||
<path id="javadoc.classpath">
|
||||
<path refid="testframework.compile.classpath"/>
|
||||
</path>
|
||||
|
||||
<invoke-javadoc
|
||||
destdir="${build.javadoc}/test-framework"
|
||||
title="${Name} ${version} Test Framework API (${specversion})">
|
||||
<sources>
|
||||
<packageset dir="${src}/test-framework" />
|
||||
</sources>
|
||||
</invoke-javadoc>
|
||||
</sequential>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-all" depends="compile,javadoc-dep" description="Generate javadoc for core, client and contrib">
|
||||
<sequential>
|
||||
|
@ -221,7 +239,7 @@
|
|||
failonerror="true"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc" depends="javadoc-core, javadoc-contrib, javadoc-solrj, javadoc-all">
|
||||
<target name="javadoc" depends="javadoc-core, javadoc-test-framework, javadoc-contrib, javadoc-solrj, javadoc-all">
|
||||
</target>
|
||||
<target name="javadocs" depends="javadoc"/>
|
||||
|
||||
|
@ -320,13 +338,18 @@
|
|||
|
||||
<!-- Classpath for unit test compilation. -->
|
||||
<!-- For now, it's the same as main classpath. Later it will have JUnit, Clover, etc. -->
|
||||
<path id="test.compile.classpath">
|
||||
<path id="testframework.compile.classpath">
|
||||
<path refid="compile.classpath" />
|
||||
<path refid="compile.classpath.solrj" />
|
||||
<pathelement location="${dest}/solr"/>
|
||||
<pathelement location="${dest}/solrj"/> <!-- include solrj -->
|
||||
<pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
</path>
|
||||
|
||||
<path id="test.compile.classpath">
|
||||
<path refid="testframework.compile.classpath"/>
|
||||
<pathelement location="${dest}/test-framework"/> <!-- include some solr test code -->
|
||||
</path>
|
||||
|
||||
<path id="test.run.classpath">
|
||||
<path refid="test.compile.classpath" />
|
||||
|
@ -337,10 +360,19 @@
|
|||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
||||
<target name="compileTestFramework" depends="compile,compile-solrj">
|
||||
<mkdir dir="${dest}/test-framework"/>
|
||||
<solr-javac
|
||||
destdir="${dest}/test-framework"
|
||||
classpathref="testframework.compile.classpath">
|
||||
<src path="${src}/test-framework"/>
|
||||
</solr-javac>
|
||||
</target>
|
||||
|
||||
<!-- Compile unit tests. -->
|
||||
<target name="compileTests"
|
||||
description="Compile unit tests."
|
||||
depends="compile,compile-solrj">
|
||||
depends="compileTestFramework">
|
||||
|
||||
<mkdir dir="${dest}/tests" />
|
||||
<solr-javac
|
||||
|
@ -577,7 +609,7 @@
|
|||
<!-- Creates the Solr distribution files. -->
|
||||
<target name="dist"
|
||||
description="Creates the Solr distribution files."
|
||||
depends="dist-solrj, dist-jar, dist-contrib, dist-war" />
|
||||
depends="dist-solrj, dist-jar, dist-test-framework, dist-contrib, dist-war" />
|
||||
|
||||
<!-- Creates the Solr WAR file. -->
|
||||
<target name="dist-war"
|
||||
|
@ -625,6 +657,9 @@
|
|||
<fileset dir="${src}/webapp/src"/>
|
||||
</solr-jar>
|
||||
|
||||
<solr-jar destfile="${dist}/${fullname}-test-framework-src-${version}.jar"
|
||||
basedir="${src}/test-framework" />
|
||||
|
||||
<solr-jar destfile="${dist}/apache-solr-dataimporthandler-src-${version}.jar"
|
||||
basedir="contrib/dataimporthandler/src/main/java" />
|
||||
<solr-jar destfile="${dist}/apache-solr-dataimporthandler-extras-src-${version}.jar"
|
||||
|
@ -650,6 +685,8 @@
|
|||
basedir="${build.javadoc}/solr" />
|
||||
<solr-jar destfile="${dist}/${fullname}-solrj-docs-${version}.jar"
|
||||
basedir="${build.javadoc}/solrj" />
|
||||
<solr-jar destfile="${dist}/${fullname}-test-framework-docs-${version}.jar"
|
||||
basedir="${build.javadoc}/test-framework" />
|
||||
<solr-jar destfile="${dist}/apache-solr-dataimporthandler-docs-${version}.jar"
|
||||
basedir="${build.javadoc}/contrib-solr-dataimporthandler" />
|
||||
<solr-jar destfile="${dist}/apache-solr-clustering-docs-${version}.jar"
|
||||
|
@ -673,6 +710,16 @@
|
|||
|
||||
</target>
|
||||
|
||||
<!-- Creates the test-framework jar -->
|
||||
<target name="dist-test-framework"
|
||||
description="Creates the Solr test-framework JAR."
|
||||
depends="compileTestFramework">
|
||||
<mkdir dir="${dist}" />
|
||||
<solr-jar destfile="${dist}/${fullname}-test-framework-${version}.jar">
|
||||
<fileset dir="${dest}/test-framework" />
|
||||
</solr-jar>
|
||||
</target>
|
||||
|
||||
<!-- Creates the solr jar. -->
|
||||
<target name="dist-solrj"
|
||||
description="Creates the Solr JAR Distribution file."
|
||||
|
@ -914,6 +961,7 @@
|
|||
<sign-maven-artifacts artifact.id="solr-dataimporthandler-extras" gpg.passphrase="${gpg.passphrase}"/>
|
||||
<sign-maven-artifacts artifact.id="solr-solrj" gpg.passphrase="${gpg.passphrase}"/>
|
||||
<sign-maven-artifacts artifact.id="solr-uima" gpg.passphrase="${gpg.passphrase}"/>
|
||||
<sign-maven-artifacts artifact.id="solr-test-framework" gpg.passphrase="${gpg.passphrase}"/>
|
||||
|
||||
<!-- These are special since there are no jars, just poms -->
|
||||
<sign-artifact input.file="${maven.dist.prefix}/solr-parent/${version}/solr-parent-${version}.pom" gpg.passphrase="${gpg.passphrase}"/>
|
||||
|
@ -1054,6 +1102,14 @@
|
|||
|
||||
<m2-deploy pom.xml="src/webapp/pom.xml"
|
||||
jar.file="${dist}/apache-solr-${version}.war"/>
|
||||
|
||||
<m2-deploy pom.xml="${src}/test-framework/pom.xml"
|
||||
jar.file="${dist}/${fullname}-test-framework-${version}.jar">
|
||||
<artifact-attachments>
|
||||
<attach file="${dist}/${fullname}-test-framework-src-${version}.jar" classifier="sources"/>
|
||||
<attach file="${dist}/${fullname}-test-framework-docs-${version}.jar" classifier="javadoc"/>
|
||||
</artifact-attachments>
|
||||
</m2-deploy>
|
||||
</sequential>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<pathelement path="${dest}/classes"/>
|
||||
<pathelement path="${dest}/test-classes"/>
|
||||
<pathelement path="${java.class.path}"/>
|
||||
<pathelement location="${common-solr.dir}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${common-solr.dir}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<path refid="common.classpath"/>
|
||||
</path>
|
||||
|
@ -92,7 +92,7 @@
|
|||
<mkdir dir="${dest}/classes"/>
|
||||
|
||||
<mkdir dir="${build.javadoc}"/>
|
||||
<subant target="compileTests">
|
||||
<subant target="compileTestFramework">
|
||||
<fileset dir="${solr-path}" includes="build.xml"/>
|
||||
</subant>
|
||||
<subant target="make-manifest">
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
<pathelement path="${dest}/classes"/>
|
||||
<pathelement path="${dest}/test-classes"/>
|
||||
<pathelement path="${java.class.path}"/>
|
||||
<pathelement location="${common-solr.dir}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${common-solr.dir}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<pathelement location="${solr-path}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<path refid="common.classpath"/>
|
||||
<!-- DistributedClusteringComponentTest uses Jetty -->
|
||||
<fileset dir="${solr-path}/example/lib">
|
||||
|
@ -64,7 +64,7 @@
|
|||
<mkdir dir="${dest}/classes"/>
|
||||
|
||||
<mkdir dir="${build.javadoc}"/>
|
||||
<subant target="compileTests">
|
||||
<subant target="compileTestFramework">
|
||||
<fileset dir="${solr-path}" includes="build.xml"/>
|
||||
</subant>
|
||||
<subant target="make-manifest">
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<path refid="classpath.jetty" />
|
||||
<pathelement path="target/classes" />
|
||||
<pathelement path="target/test-classes" />
|
||||
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<pathelement path="target/extras/classes" />
|
||||
<pathelement path="target/test-classes" />
|
||||
<pathelement path="target/extras/test-classes" />
|
||||
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<target name="init">
|
||||
<mkdir dir="target/classes"/>
|
||||
<mkdir dir="${build.javadoc}" />
|
||||
<subant target="compileTests">
|
||||
<subant target="compileTestFramework">
|
||||
<fileset dir="${solr-path}" includes="build.xml"/>
|
||||
</subant>
|
||||
<subant target="make-manifest">
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<path refid="common.classpath" />
|
||||
<pathelement path="${dest}/classes" />
|
||||
<pathelement path="${dest}/test-classes" />
|
||||
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<target name="init">
|
||||
<mkdir dir="${dest}/classes"/>
|
||||
<mkdir dir="${build.javadoc}" />
|
||||
<subant target="compileTests">
|
||||
<subant target="compileTestFramework">
|
||||
<fileset dir="${solr-path}" includes="build.xml"/>
|
||||
</subant>
|
||||
<subant target="make-manifest">
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<path refid="common.classpath" />
|
||||
<pathelement path="${dest}/classes" />
|
||||
<pathelement path="${dest}/test-classes" />
|
||||
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/build/test-framework"/> <!-- include solr test code -->
|
||||
<pathelement location="${solr-path}/../lucene/build/classes/test-framework" /> <!-- include some lucene test code -->
|
||||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<target name="init">
|
||||
<mkdir dir="${dest}/classes"/>
|
||||
<mkdir dir="${build.javadoc}" />
|
||||
<subant target="compileTests">
|
||||
<subant target="compileTestFramework">
|
||||
<fileset dir="${solr-path}" includes="build.xml"/>
|
||||
</subant>
|
||||
<subant target="make-manifest">
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
|
||||
<div id="menu_1.3" class="menuitemgroup">
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
|
||||
<div id="menu_1.3" class="menuitemgroup">
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
|
||||
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
|
||||
<div id="menu_1.3" class="menuitemgroup">
|
||||
|
@ -285,6 +288,12 @@ document.write("Last Published: " + document.lastModified);
|
|||
<a href="api/solrj/index.html">SolrJ Javadoc</a> ___________________ <em>apidocs</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a> ___________________ <em>apidocs</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
/Producer (FOP 0.20.5) >>
|
||||
endobj
|
||||
5 0 obj
|
||||
<< /Length 1072 /Filter [ /ASCII85Decode /FlateDecode ]
|
||||
<< /Length 1107 /Filter [ /ASCII85Decode /FlateDecode ]
|
||||
>>
|
||||
stream
|
||||
Gatm;_/e9Q&A@rkFA*/fJ,i0S3GCY*9\O2!9lm6p*?sO27M_#;P4n@&,f]ta=;dt*+b5;qDqTQNE0a6oB46;sJ3gc:^ueu^J\g.F"jm0DO>La35S14\8Ct]PUMHjJEH$N)fR,]jPf<TiDu,0Phr`L6[HtrsWmIKeeT(('81tB,%1qrh*B4s+J3hW"V(5\+-><#4a<'r%\7O#]3ll3?=/)<tC;%`C[T4klcZl_!OL,0kl*ATV>mdgrN]c*2!g7fOI?$$Fi%0K)YttW*H1pr8je[O)Y_E&Ono&0$]eG5@$)969)!jBW;o#K.5S1`X+anr=kPFgOeTrdCYheB-kFFb#,M"DBN*BZg`TTeP-B_gp-]6U`3=rJuLu/G>KeW^%`8")Uq?6%C4XZida'DMGgO!6n$t>iq.qP4=a4#(Alc^VeKO*A!f97$sN4>?.f.ZG`']O5(\_G)E[9cM.79T">hBj5!_d;;KNk\Xu]f'GRCT33=SrsX1$$Lk8.Q^UV\sO$uHM-W%RgIpcJSI:t"rLo(`c>^6L`)mmQ):riV<%GsAcse$A-YKjN".RXK'ElE<Cl:C2tC;#O2kle2(+2c`$]&8Qm6-JXj*_EUBuWnhtW@!%'g3"a=DdTT(`J5_&p50g[XH\9sKU^4MHr]P(IED?7@^O^\E:8,7Hn4>f9^jCl:kU'!Eq%MFuE1p'/X5`%Z6eb22@/#r^Jq'uj17/%ukXa(S]:*/qk^kR]NQ]lNndAM/m&X2N1RO$CJ%>TO2k&MnJCjOs#c!%5jgPE/^D>CA4XH$8)m*m'T`WORbiJJ\kQ2X0N@au@cO]105ENJ0"8pe'@a1fL@obj)GMPR45G!L`"R$g[N`V,Y2tp4f6(\.u@Q]%IrA3mWn4A^apDgrf5cDF.U<Hu"4f+sL@lI'.V#)W+Ai3P!cGE(GCJ-P,S`XaP.2(kIJIUkOO'e"@DkEcO#tCYj6eHjAE8?&U!pXf!1S$4*Cm&crto39P&JVj)BUh*9WUR%f%a+cNM3hTC0/9fG2@kLXIJT6P(PbZ%k!g1q_5[WUE/S$^h52&DN++2n<RY5\YnG&u^~>
|
||||
Gatm;_,B#A&A@6WI"VSgOsSfL/O2*jL3?2ZPXEpa#Y-$jNYQ(Bg:sh-LKFluAdmaN,`hZ4eaD1W:=@8S/.=350M%NDf_io>0Y![H!1Fu:P%K[c#XT:3krSTZE0Y3Y(`_K_2I?qHo($\C2uQ(cD[PgB>k[2V=_^h!l7huNUuqrM"pfFo%NLHP^`_n"dT'U2-><#4^`N)r\7O#]3ll3?=/)<tEkNoT[T9E`T(-i0+__=ad]1T7XT[9r7iq(T!D0rc50'&)i%0K)YttW*H1LZ$(<XEjfY[W6rjO](SsdLGK[CWW%!E]g.:C_'+:)B=O?Q"0F+&?ZCH[t]fPY`Ro?Nr"&Si.1`iUoo@rs:0'1jpI'1Hbk*/M74Ld*Ps$=a@)Lq0!=oEireH:g<QO1V'n[eIFf(rSTk=40"aO/Ha*lc^VeKO*A!f97$sN4>?.f.ZD_Pi?qW\_G)%\R+H&$WZRUhBj5!_d;;KNh=Fp?CN^dFY:kbSrsX1$$Lk814-"oF>4qto]k,)2A<_P!nDNr$o#h/N9/@K&2QYd.SX\1<R-NmbQqT'a:<s])'*2;"P"ShX,tU;Y4K8QIQ0NDWB!92,!Hp/_]0ikC2GlB*).i7qo5!#IZR8@7pZ3iMkWG?F8isLhMsfRCl2NbipfbB.OgaNn!-3ap[e-S).=(ciZc+*-;"-H&=)Zdc4jWD8#bq5NHgYB/7^Ag<tK;N@%05!inm-MCR)T,etBr$WJdHrUI/[OTN<^Xo!'_k?]8p=[&qR_`aWS&J/M+D=#lmu?KC4MeXQ,%O$CJ%gj09H&MnK`jk9,,#+LSFC$/DpeQ,%5(!l;/g*:kuUN%))D]jePN+qL@c?IaM]+2L>l(qF$I#D]BZ"Yp&B(\t1aomL\"dp'0$gZOG<QX,BHUH.Ogf>U(FL*baFIn;5A^fJ!grf5c2Fq)_@V^ID,"ee85@8/rXi>QOC/-C)!?=uZe&d%8\85ME#Y#r2!GS5N^bek3=ACIr-dAD#S*sb^.#i47W:_K+9`\ZZ84#S:%d-f/ri5m>V>Jm,*)kA50SGS]86o@oeEM^#pA@N8ocmPhb"UCJU:lThCKoDf]1Iod=`[FHocP$CGPrV;Z(QO~>
|
||||
endstream
|
||||
endobj
|
||||
6 0 obj
|
||||
|
@ -72,17 +72,17 @@ endobj
|
|||
xref
|
||||
0 12
|
||||
0000000000 65535 f
|
||||
0000001896 00000 n
|
||||
0000001954 00000 n
|
||||
0000002004 00000 n
|
||||
0000001931 00000 n
|
||||
0000001989 00000 n
|
||||
0000002039 00000 n
|
||||
0000000015 00000 n
|
||||
0000000071 00000 n
|
||||
0000001235 00000 n
|
||||
0000001341 00000 n
|
||||
0000001453 00000 n
|
||||
0000001562 00000 n
|
||||
0000001672 00000 n
|
||||
0000001780 00000 n
|
||||
0000001270 00000 n
|
||||
0000001376 00000 n
|
||||
0000001488 00000 n
|
||||
0000001597 00000 n
|
||||
0000001707 00000 n
|
||||
0000001815 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Size 12
|
||||
|
@ -90,5 +90,5 @@ trailer
|
|||
/Info 4 0 R
|
||||
>>
|
||||
startxref
|
||||
2124
|
||||
2159
|
||||
%%EOF
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
|
||||
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
|
||||
|
|
|
@ -163,4 +163,4 @@ p {
|
|||
.codefrag {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-size: 110%;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,4 +51,4 @@ a:link, a:visited {
|
|||
|
||||
acronym {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,4 +172,4 @@ a:hover { color:#6587ff}
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -584,4 +584,4 @@ p.instruction {
|
|||
list-style-image: url('../images/instruction_arrow.png');
|
||||
list-style-position: outside;
|
||||
margin-left: 2em;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
|
||||
<div id="menu_1.3" class="menuitemgroup">
|
||||
|
|
|
@ -130,6 +130,9 @@ document.write("Last Published: " + document.lastModified);
|
|||
<div class="menuitem">
|
||||
<a href="api/solrj/index.html">SolrJ Javadoc</a>
|
||||
</div>
|
||||
<div class="menuitem">
|
||||
<a href="api/test-framework/index.html">Test Framework Javadoc</a>
|
||||
</div>
|
||||
</div>
|
||||
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
|
||||
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
|
||||
|
|
|
@ -42,12 +42,13 @@ See http://forrest.apache.org/docs/linking.html for more info
|
|||
</about>
|
||||
|
||||
<docs label="Documentation">
|
||||
<features label="Features" href="features.html" />
|
||||
<tutorial label="Tutorial" href="tutorial.html" />
|
||||
<wiki label="Docs (Wiki)" href="ext:wiki" />
|
||||
<faq label="FAQ" href="ext:faq" />
|
||||
<apidocs label="All Javadoc" href="api/index.html" />
|
||||
<apidocs label="SolrJ Javadoc" href="api/solrj/index.html" />
|
||||
<features label="Features" href="features.html" />
|
||||
<tutorial label="Tutorial" href="tutorial.html" />
|
||||
<wiki label="Docs (Wiki)" href="ext:wiki" />
|
||||
<faq label="FAQ" href="ext:faq" />
|
||||
<apidocs label="All Javadoc" href="api/index.html" />
|
||||
<apidocs label="SolrJ Javadoc" href="api/solrj/index.html" />
|
||||
<apidocs label="Test Framework Javadoc" href="api/test-framework/index.html" />
|
||||
</docs>
|
||||
|
||||
<resources label="Resources">
|
||||
|
|
|
@ -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
|
|
@ -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) {
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
|
@ -61,7 +61,7 @@ import java.util.Map;
|
|||
* writing testcases.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
|
@ -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
|
||||
|
|
|
@ -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"; }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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!!!!
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue