Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- regression/jvm/ExceptionsTest.java | 42 +++++++++++++++++++++++++++++++++-- 1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/regression/jvm/ExceptionsTest.java b/regression/jvm/ExceptionsTest.java index b13d8bf..93c2ea0 100644 --- a/regression/jvm/ExceptionsTest.java +++ b/regression/jvm/ExceptionsTest.java @@ -166,12 +166,12 @@ public class ExceptionsTest extends TestCase { assertTrue(caught); } - public static void testArrayLoad() { + public static void testArrayLoadThrowsNullPointerException() { boolean caught = false; Object[] array = null; try { - array[0].getClass(); + takeObject(array[0]); } catch (NullPointerException e) { caught = true; } @@ -179,7 +179,25 @@ public class ExceptionsTest extends TestCase { assertTrue(caught); } - public static void testArrayStore() { + public static void testArrayLoadThrowsArrayIndexOutOfBoundsException() { + boolean caught = false; + Object[] array = new String[3]; + + try { + takeObject(array[3]); + } catch (ArrayIndexOutOfBoundsException e) { + caught = true; + } + + assertTrue(caught); + } + + public static void testArrayLoad() { + testArrayLoadThrowsNullPointerException(); + testArrayLoadThrowsArrayIndexOutOfBoundsException(); + } + + public static void testArrayStoreThrowsNullPointerException() { boolean caught = false; Object[] array = null; @@ -192,6 +210,24 @@ public class ExceptionsTest extends TestCase { assertTrue(caught); } + public static void testArrayStoreThrowsArrayIndexOutOfBoundsException() { + boolean caught = false; + Object[] array = new String[3]; + + try { + array[3] = "test"; + } catch (ArrayIndexOutOfBoundsException e) { + caught = true; + } + + assertTrue(caught); + } + + public static void testArrayStore() { + testArrayStoreThrowsNullPointerException(); + testArrayStoreThrowsArrayIndexOutOfBoundsException(); + } + public static void testArraylength() { boolean caught = false; Object[] array = null; -- 1.6.0.6 ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel