Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-486: Remove test->demo dependencies.

Michael Buschb9bf270b0124
diff --git a/CHANGES.txt b/CHANGES.txt
index 8cf1a2d869d..57c1bbdb4f2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -41,6 +41,8 @@ Documentation
Build
+* LUCENE-486: Remove test->demo dependencies. (Michael Busch)
+
Test Cases
======================= Release 2.9.0 2009-09-23 =======================
diff --git a/build.xml b/build.xml
index b23feae8826..d32ef60169a 100644
--- a/build.xml
+++ b/build.xml
@@ -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 -->
<!-- ================================================================== -->
diff --git a/src/test/org/apache/lucene/index/TestDoc.java b/src/test/org/apache/lucene/index/TestDoc.java
index a0509e8a2ad..5087a3df559 100644
--- a/src/test/org/apache/lucene/index/TestDoc.java
+++ b/src/test/org/apache/lucene/index/TestDoc.java
@@ -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();