LUCENE-486: Remove test->demo dependencies.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@822137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2009-10-06 05:57:20 +00:00
parent b3f73db537
commit b9bf270b01
3 changed files with 20 additions and 19 deletions

View File

@ -41,6 +41,8 @@ Documentation
Build
* LUCENE-486: Remove test->demo dependencies. (Michael Busch)
Test Cases
======================= Release 2.9.0 2009-09-23 =======================

View File

@ -46,7 +46,7 @@
</path>
<path id="test.classpath">
<path refid="demo.classpath"/>
<path refid="classpath"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/test"/>
</path>
@ -56,7 +56,6 @@
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/test"/>
<pathelement location="${build.dir}/classes/java"/>
<pathelement location="${build.dir}/classes/demo"/>
<pathelement path="${java.class.path}"/>
</path>
@ -88,7 +87,6 @@
<path id="tag.test.classpath">
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/demo"/>
<pathelement location="${build.dir}/${tag}/${tag}.jar"/>
</path>
@ -96,7 +94,6 @@
<path refid="junit-path"/>
<pathelement location="${build.dir}/${tag}/classes/test"/>
<pathelement location="${build.dir}/${final.name}.jar"/>
<pathelement location="${build.dir}/classes/demo"/>
<pathelement path="${java.class.path}"/>
</path>
@ -111,7 +108,7 @@
</sequential>
</target>
<target name="test-tag" depends="download-tag, compile-core, compile-demo, jar-core"
<target name="test-tag" depends="download-tag, compile-core, jar-core"
description="Runs tests of a previous Lucene version. Specify tag version like this: -Dtag=branches/lucene_2_9_back_compat_tests">
<sequential>
<available property="tag.available" file="${tags.dir}/${tag}/src/test" />
@ -220,11 +217,6 @@
</compile>
</target>
<!-- TODO: Remove dependency on demo from test -->
<target name="compile-test" depends="compile-demo,common.compile-test"/>
<!-- ================================================================== -->
<!-- D O C U M E N T A T I O N -->
<!-- ================================================================== -->

View File

@ -16,19 +16,25 @@ package org.apache.lucene.index;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.lucene.util.LuceneTestCase;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.document.Document;
import org.apache.lucene.demo.FileDocument;
import java.io.*;
import java.util.*;
import org.apache.lucene.document.Field;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.LuceneTestCase;
/** JUnit adaptation of an older test case DocTest.
@ -163,7 +169,8 @@ public class TestDoc extends LuceneTestCase {
throws Exception
{
File file = new File(workDir, fileName);
Document doc = FileDocument.Document(file);
Document doc = new Document();
doc.add(new Field("contents", new FileReader(file)));
writer.addDocument(doc);
writer.flush();
return writer.newestSegment();