lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwe...@apache.org
Subject svn commit: r1357636 - in /lucene/dev/trunk/lucene: benchmark/src/test/org/apache/lucene/benchmark/byTask/ highlighter/src/test/org/apache/lucene/search/highlight/ queryparser/src/test/org/apache/lucene/queryparser/xml/
Date Thu, 05 Jul 2012 14:41:03 GMT
Author: dweiss
Date: Thu Jul  5 14:41:03 2012
New Revision: 1357636

URL: http://svn.apache.org/viewvc?rev=1357636&view=rev
Log:
LUCENE-4194: more encoding fixes.

Modified:
    lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
    lucene/dev/trunk/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
    lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java

Modified: lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java?rev=1357636&r1=1357635&r2=1357636&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
(original)
+++ lucene/dev/trunk/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
Thu Jul  5 14:41:03 2012
@@ -19,9 +19,12 @@ package org.apache.lucene.benchmark.byTa
 
 import java.io.File;
 import java.io.FileFilter;
+import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.StringReader;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 
 import org.apache.lucene.benchmark.byTask.feeds.AbstractQueryMaker;
@@ -113,7 +116,7 @@ public class TestPerfTasksParse extends 
       public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().endsWith(".alg");
}
     })) {
       try {
-        Config config = new Config(new FileReader(algFile));
+        Config config = new Config(new InputStreamReader(new FileInputStream(algFile), "UTF-8"));
         String contentSource = config.get("content.source", null);
         if (contentSource != null) { Class.forName(contentSource); }
         config.set("work.dir", new File(TEMP_DIR,"work").getAbsolutePath());

Modified: lucene/dev/trunk/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=1357636&r1=1357635&r2=1357636&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
(original)
+++ lucene/dev/trunk/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
Thu Jul  5 14:41:03 2012
@@ -1371,7 +1371,7 @@ public class HighlighterTest extends Bas
     // now an ugly built of XML parsing to test the snippet is encoded OK
     DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
     DocumentBuilder db = dbf.newDocumentBuilder();
-    org.w3c.dom.Document doc = db.parse(new ByteArrayInputStream(xhtml.getBytes()));
+    org.w3c.dom.Document doc = db.parse(new ByteArrayInputStream(xhtml.getBytes("UTF-8")));
     Element root = doc.getDocumentElement();
     NodeList nodes = root.getElementsByTagName("body");
     Element body = (Element) nodes.item(0);

Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1357636&r1=1357635&r2=1357636&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
(original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
Thu Jul  5 14:41:03 2012
@@ -61,7 +61,8 @@ public class TestParser extends LuceneTe
     //initialize the parser
     builder = new CorePlusExtensionsParser("contents", analyzer);
 
-    BufferedReader d = new BufferedReader(new InputStreamReader(TestParser.class.getResourceAsStream("reuters21578.txt")));
+    BufferedReader d = new BufferedReader(new InputStreamReader(
+        TestParser.class.getResourceAsStream("reuters21578.txt"), "US-ASCII"));
     dir = newDirectory();
     IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(Version.LUCENE_40, analyzer));
     String line = d.readLine();



Mime
View raw message