7110700: Enhance exception throwing mechanism in ObjectStreamClass

Reviewed-by: dmeetry, hawtin
This commit is contained in:
Stuart Marks 2011-11-11 15:22:11 -08:00
parent 159d2cd692
commit d6e13af09c
2 changed files with 44 additions and 29 deletions

View file

@ -22,7 +22,7 @@
*/
/* @test
* @bug 6317435
* @bug 6317435 7068148
* @summary Verify that stack trace contains a proper cause of
* InvalidClassException (methods: checkSerialize,
* checkDeserialize or checkDefaultSerialize)
@ -59,7 +59,7 @@ public class ExpectedStackTrace {
private static final String SER_METHOD_NAME = "checkSerializable";
public static final void main(String[] args) throws Exception {
System.err.println("\nRegression test for CR6317435");
System.err.println("\nRegression test for CRs 6317435, 7068148");
checkSerializable(getObject());
}
@ -99,9 +99,11 @@ public class ExpectedStackTrace {
}
}
if (found) {
System.err.println("\nTEST PASSED");
if (ex.getCause() != null) {
throw new Error("\nTest for CR 7068148 FAILED");
}
} else {
throw new Error();
throw new Error("\nTest for CR 6317435 FAILED");
}
}
}