/** @title expected NullPointerException */ public void testE2() { T_aput_boolean_1 t = new T_aput_boolean_1(); try { t.run(null, 2, true); fail("expected NullPointerException"); } catch (NullPointerException aie) { // expected } }
/** @title expected ArrayIndexOutOfBoundsException (negative index) */ public void testE3() { T_aput_boolean_1 t = new T_aput_boolean_1(); boolean[] arr = new boolean[2]; try { t.run(arr, -1, true); fail("expected ArrayIndexOutOfBoundsException"); } catch (ArrayIndexOutOfBoundsException aie) { // expected } }
/** @title put boolean into array */ public void testN2() { T_aput_boolean_1 t = new T_aput_boolean_1(); boolean[] arr = new boolean[2]; t.run(arr, 0, true); assertEquals(true, arr[0]); }