* Test the method execute() with a normal array object, the method name
* "set" and invalid arguments.
*/
public void testExecute_ArrayInvalidSet() throws Exception {
Object[] array = new Object[] { "test" };
Statement t = new Statement(array, "set", new Object[] {
new Integer(0), "test2" });
t.execute();
assertEquals("test2", array[0]);
try {
t = new Statement(array, "set", new Object[] { "testtest", "test2",
new Object() });
t.execute();
fail("Should throw ClassCastException!");
} catch (ClassCastException ex) {
// expected
}
t = new Statement(array, "set", new Object[] { new Integer(0) });
try {
t.execute();
fail("Should throw ArrayIndexOutOfBoundsException!");
} catch (ArrayIndexOutOfBoundsException ex) {
// expected
}
}