lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1358636 - /lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java
Date Sat, 07 Jul 2012 20:24:09 GMT
Author: rmuir
Date: Sat Jul  7 20:24:09 2012
New Revision: 1358636

URL: http://svn.apache.org/viewvc?rev=1358636&view=rev
Log:
LUCENE-4199: fix test

Modified:
    lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java

Modified: lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java?rev=1358636&r1=1358635&r2=1358636&view=diff
==============================================================================
--- lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java
(original)
+++ lucene/dev/branches/lucene4199/lucene/core/src/test/org/apache/lucene/search/spans/TestBasics.java
Sat Jul  7 20:24:09 2012
@@ -81,7 +81,7 @@ public class TestBasics extends LuceneTe
     @Override
     public boolean incrementToken() throws IOException {
       if (input.incrementToken()) {
-        payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes()));
+        payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes("UTF-8")));
         pos++;
         return true;
       } else {
@@ -411,7 +411,7 @@ public class TestBasics extends LuceneTe
   @Test
   public void testSpanPayloadCheck() throws Exception {
     SpanTermQuery term1 = new SpanTermQuery(new Term("field", "five"));
-    BytesRef pay = new BytesRef(("pos: " + 5).getBytes());
+    BytesRef pay = new BytesRef(("pos: " + 5).getBytes("UTF-8"));
     SpanQuery query = new SpanPayloadCheckQuery(term1, Collections.singletonList(pay.bytes));
     checkHits(query, new int[]
       {1125, 1135, 1145, 1155, 1165, 1175, 1185, 1195, 1225, 1235, 1245, 1255, 1265, 1275,
1285, 1295, 1325, 1335, 1345, 1355, 1365, 1375, 1385, 1395, 1425, 1435, 1445, 1455, 1465,
1475, 1485, 1495, 1525, 1535, 1545, 1555, 1565, 1575, 1585, 1595, 1625, 1635, 1645, 1655,
1665, 1675, 1685, 1695, 1725, 1735, 1745, 1755, 1765, 1775, 1785, 1795, 1825, 1835, 1845,
1855, 1865, 1875, 1885, 1895, 1925, 1935, 1945, 1955, 1965, 1975, 1985, 1995});
@@ -426,8 +426,8 @@ public class TestBasics extends LuceneTe
     clauses[0] = term1;
     clauses[1] = term2;
     snq = new SpanNearQuery(clauses, 0, true);
-    pay = new BytesRef(("pos: " + 0).getBytes());
-    pay2 = new BytesRef(("pos: " + 1).getBytes());
+    pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
+    pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
     list = new ArrayList<byte[]>();
     list.add(pay.bytes);
     list.add(pay2.bytes);
@@ -439,9 +439,9 @@ public class TestBasics extends LuceneTe
     clauses[1] = term2;
     clauses[2] = new SpanTermQuery(new Term("field", "five"));
     snq = new SpanNearQuery(clauses, 0, true);
-    pay = new BytesRef(("pos: " + 0).getBytes());
-    pay2 = new BytesRef(("pos: " + 1).getBytes());
-    BytesRef pay3 = new BytesRef(("pos: " + 2).getBytes());
+    pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
+    pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
+    BytesRef pay3 = new BytesRef(("pos: " + 2).getBytes("UTF-8"));
     list = new ArrayList<byte[]>();
     list.add(pay.bytes);
     list.add(pay2.bytes);
@@ -470,10 +470,10 @@ public class TestBasics extends LuceneTe
     checkHits(query, new int[]{1103, 1203,1303,1403,1503,1603,1703,1803,1903});
 
     Collection<byte[]> payloads = new ArrayList<byte[]>();
-    BytesRef pay = new BytesRef(("pos: " + 0).getBytes());
-    BytesRef pay2 = new BytesRef(("pos: " + 1).getBytes());
-    BytesRef pay3 = new BytesRef(("pos: " + 3).getBytes());
-    BytesRef pay4 = new BytesRef(("pos: " + 4).getBytes());
+    BytesRef pay = new BytesRef(("pos: " + 0).getBytes("UTF-8"));
+    BytesRef pay2 = new BytesRef(("pos: " + 1).getBytes("UTF-8"));
+    BytesRef pay3 = new BytesRef(("pos: " + 3).getBytes("UTF-8"));
+    BytesRef pay4 = new BytesRef(("pos: " + 4).getBytes("UTF-8"));
     payloads.add(pay.bytes);
     payloads.add(pay2.bytes);
     payloads.add(pay3.bytes);



Mime
View raw message