mirror of https://github.com/apache/lucene.git
fix some bytesref abuse in these tests
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@966546 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
40028d3f1a
commit
907cd33672
|
@ -35,7 +35,7 @@ public class TestDeterminizeLexicon extends LuceneTestCase {
|
|||
private List<String> terms = new ArrayList<String>();
|
||||
private Random random;
|
||||
|
||||
public void testLexicon() {
|
||||
public void testLexicon() throws Exception {
|
||||
random = newRandom();
|
||||
for (int i = 0; i < 3*_TestUtil.getRandomMultiplier(); i++) {
|
||||
automata.clear();
|
||||
|
@ -49,7 +49,7 @@ public class TestDeterminizeLexicon extends LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void assertLexicon() {
|
||||
public void assertLexicon() throws Exception {
|
||||
Collections.shuffle(automata, random);
|
||||
final Automaton lex = BasicOperations.union(automata);
|
||||
lex.determinize();
|
||||
|
@ -59,8 +59,8 @@ public class TestDeterminizeLexicon extends LuceneTestCase {
|
|||
}
|
||||
final ByteRunAutomaton lexByte = new ByteRunAutomaton(lex);
|
||||
for (String s : terms) {
|
||||
BytesRef termByte = new BytesRef(s);
|
||||
assertTrue(lexByte.run(termByte.bytes, 0, termByte.length));
|
||||
byte bytes[] = s.getBytes("UTF-8");
|
||||
assertTrue(lexByte.run(bytes, 0, bytes.length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,8 +193,8 @@ public class TestUTF32ToUTF8 extends LuceneTestCase {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
BytesRef bytesRef = new BytesRef(string);
|
||||
assertEquals(cra.run(string), bra.run(bytesRef.bytes, 0, bytesRef.length));
|
||||
byte bytes[] = string.getBytes("UTF-8");
|
||||
assertEquals(cra.run(string), bra.run(bytes, 0, bytes.length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue