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:
Robert Muir 2010-07-22 09:08:01 +00:00
parent 40028d3f1a
commit 907cd33672
2 changed files with 6 additions and 6 deletions

View File

@ -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));
}
}
}

View File

@ -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));
}
}
}