lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r924781 - in /lucene/java/trunk: ./ contrib/analyzers/common/ contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/
Date Thu, 18 Mar 2010 14:03:38 GMT
Author: uschindler
Date: Thu Mar 18 14:03:37 2010
New Revision: 924781

URL: http://svn.apache.org/viewvc?rev=924781&view=rev
Log:
LUCENE-2326: Remove Snowball externals refs

Added:
    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocabData.zip
  (with props)
Modified:
    lucene/java/trunk/build.xml
    lucene/java/trunk/contrib/analyzers/common/build.xml
    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/
  (props changed)
    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java

Modified: lucene/java/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/build.xml?rev=924781&r1=924780&r2=924781&view=diff
==============================================================================
--- lucene/java/trunk/build.xml (original)
+++ lucene/java/trunk/build.xml Thu Mar 18 14:03:37 2010
@@ -54,7 +54,7 @@
 
   <patternset id="src.dist.patterns"
               includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/"
-              excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/,contrib/benchmark/temp/,contrib/benchmark/work/,contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/data/"
+              excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/,contrib/benchmark/temp/,contrib/benchmark/work/"
   />
   <patternset id="binary.build.dist.patterns"
               includes="${final.name}.jar,${demo.war.name}.war,${demo.name}.jar,docs/,contrib/*/*.jar,contrib/*/*.war,
contrib/*/*/*.jar"

Modified: lucene/java/trunk/contrib/analyzers/common/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/build.xml?rev=924781&r1=924780&r2=924781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/build.xml (original)
+++ lucene/java/trunk/contrib/analyzers/common/build.xml Thu Mar 18 14:03:37 2010
@@ -35,20 +35,4 @@
     <path refid="junit-path"/>
     <pathelement location="${build.dir}/classes/java"/>
   </path>	
-
-  <target name="compile-test" depends="download-snowball-vocab-tests, common.compile-test"
/>
-  <property name="snowball.vocab.rev" value="500"/>
-  <property name="snowball.vocab.url" 
-            value="svn://svn.tartarus.org/snowball/trunk/data"/>
-  <property name="snowball.vocab.dir" value="src/test/org/apache/lucene/analysis/snowball"/>
-		
-  <target name="download-snowball-vocab-tests" depends="compile-core"
-	      description="Downloads Snowball vocabulary tests">
-	<sequential>
-	  <mkdir dir="${snowball.vocab.dir}"/>
-	    <exec dir="${snowball.vocab.dir}" executable="${svn.exe}" failifexecutionfails="false"
failonerror="true">
-	      <arg line="checkout --trust-server-cert --non-interactive -r ${snowball.vocab.rev}
${snowball.vocab.url}"/>
-	    </exec>
-	</sequential>
-  </target>
 </project>

Propchange: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/
            ('svn:ignore' removed)

Modified: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java?rev=924781&r1=924780&r2=924781&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java
(original)
+++ lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocab.java
Thu Mar 18 14:03:37 2010
@@ -18,12 +18,11 @@ package org.apache.lucene.analysis.snowb
  */
 
 import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.StringReader;
+import java.util.zip.ZipFile;
 
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.KeywordTokenizer;
@@ -35,24 +34,25 @@ import org.apache.lucene.analysis.Tokeni
  */
 public class TestSnowballVocab extends BaseTokenStreamTestCase {
   private Tokenizer tokenizer = new KeywordTokenizer(new StringReader(""));
-  File dataRoot = null;
+  ZipFile zipFile = null;
   
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    try {
-      dataRoot = getDataFile("data");
-    } catch (IOException ioe) {
-      dataRoot = null;
-      System.err.println("WARN: This test was disabled, as the svn checkout of snowball test
files is not supported on your system!");
-    }
+    this.zipFile = new ZipFile(getDataFile("TestSnowballVocabData.zip"));
   }
   
+  @Override
+  protected void tearDown() throws Exception {
+    this.zipFile.close();
+    this.zipFile = null;
+    super.tearDown();
+  }
+
   /**
    * Run all languages against their snowball vocabulary tests.
    */
   public void testStemmers() throws IOException {
-    if (dataRoot == null) return;
     assertCorrectOutput("Danish", "danish");
     assertCorrectOutput("Dutch", "dutch");
     assertCorrectOutput("English", "english");
@@ -86,14 +86,12 @@ public class TestSnowballVocab extends B
       throws IOException {
     if (VERBOSE) System.out.println("checking snowball language: " + snowballLanguage);
     TokenStream filter = new SnowballFilter(tokenizer, snowballLanguage);
-    InputStream vocFile = new FileInputStream(new File(dataRoot, 
-        dataDirectory + "/voc.txt"));
-    InputStream outputFile = new FileInputStream(new File(dataRoot, 
-        dataDirectory + "/output.txt"));
+    InputStream voc = zipFile.getInputStream(zipFile.getEntry(dataDirectory + "/voc.txt"));
+    InputStream out = zipFile.getInputStream(zipFile.getEntry(dataDirectory + "/output.txt"));
     BufferedReader vocReader = new BufferedReader(new InputStreamReader(
-        vocFile, "UTF-8"));
+        voc, "UTF-8"));
     BufferedReader outputReader = new BufferedReader(new InputStreamReader(
-        outputFile, "UTF-8"));
+        out, "UTF-8"));
     String inputWord = null;
     while ((inputWord = vocReader.readLine()) != null) {
       String expectedWord = outputReader.readLine();

Added: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocabData.zip
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocabData.zip?rev=924781&view=auto
==============================================================================
Binary file - no diff available.

Propchange: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/snowball/TestSnowballVocabData.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message