// expected
}
}
public void testOverrideEmbeddings() {
bd = new Bidi(new char[] { 's', 's', 's' }, 0, new byte[] { (byte) -7,
(byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
assertTrue(bd.baseIsLeftToRight());
assertEquals(0, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(7, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(0, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 7 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { 's', 's', 's' }, 0, new byte[] { (byte) -1,
(byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);
assertTrue(bd.baseIsLeftToRight());
assertEquals(0, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(0, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 1 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { 's', 's', 's' }, 0, new byte[] { (byte) -1,
(byte) -2, (byte) -3 }, 0, 3, Bidi.DIRECTION_LEFT_TO_RIGHT);
assertTrue(bd.baseIsLeftToRight());
assertEquals(0, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(0, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 1 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { 's', 's', 's' }, 0, new byte[] { (byte) -1,
(byte) -2, (byte) -3 }, 0, 3, Bidi.DIRECTION_RIGHT_TO_LEFT);
assertFalse(bd.baseIsLeftToRight());
assertEquals(1, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));