lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r822137 - in /lucene/java/trunk: CHANGES.txt build.xml src/test/org/apache/lucene/index/TestDoc.java
Date Tue, 06 Oct 2009 05:57:20 GMT
Author: buschmi
Date: Tue Oct  6 05:57:20 2009
New Revision: 822137

URL: http://svn.apache.org/viewvc?rev=822137&view=rev
Log:
LUCENE-486: Remove test->demo dependencies.

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/build.xml
    lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=822137&r1=822136&r2=822137&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Oct  6 05:57:20 2009
@@ -41,6 +41,8 @@
 
 Build
 
+* LUCENE-486: Remove test->demo dependencies. (Michael Busch)
+
 Test Cases
 
 ======================= Release 2.9.0 2009-09-23 =======================

Modified: lucene/java/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/build.xml?rev=822137&r1=822136&r2=822137&view=diff
==============================================================================
--- lucene/java/trunk/build.xml (original)
+++ lucene/java/trunk/build.xml Tue Oct  6 05:57:20 2009
@@ -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                                          -->
   <!-- ================================================================== -->

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java?rev=822137&r1=822136&r2=822137&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java Tue Oct  6 05:57:20 2009
@@ -16,19 +16,25 @@
  * 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 @@
    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();



Mime
View raw message