< prev index next >
test/hotspot/jtreg/runtime/exceptionMsgs/ArrayStoreException/ArrayStoreExceptionTest.java
Print this page
rev 50668 : [mq]: 8205141-ArrayStoreExceptionTest-fails-with-assert
*** 61,82 ****
} catch (ArrayStoreException e) {
Asserts.assertEquals(e.getMessage(), message);
}
}
- static native void doNativeArrayStore2(Object src, Object dst, int index);
-
- static void testNativeASMessages2(Object array, Object elem, int index, String message)
- throws Exception {
- try {
- doNativeArrayStore2(array, elem, index);
- Asserts.fail("Expected ArrayStoreException not thrown");
- } catch (ArrayIndexOutOfBoundsException e) {
- Asserts.assertEquals(e.getMessage(), message);
- }
- }
-
public static void main(String[] args) throws Exception {
try {
boolean[] za1 = new boolean[3];
byte[] ba1 = new byte[3];
short[] sa1 = new short[3];
--- 61,70 ----
*** 191,202 ****
testNativeASMessages(ia3, "This is not a date", 1,
"type mismatch: can not store java.lang.String to int[1][]");
testNativeASMessages(ia4, "This is not a date", 2,
"type mismatch: can not store java.lang.String to int[2][][]");
- testNativeASMessages2("This is not an array", "This is not a date", 2, "2");
-
} catch (java.lang.RuntimeException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
Asserts.fail("Wrong exception thrown: " + e);
--- 179,188 ----
< prev index next >