Mercurial > hg > rhino-tests
changeset 250:ffa80879d9af draft
Added new test testNewInstance into the test suite
ScriptExceptionClassTest.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Thu, 10 Oct 2013 10:42:18 +0200 |
parents | c8b6ebc43fa5 |
children | 00b968a159d4 |
files | ChangeLog src/org/RhinoTests/ScriptExceptionClassTest.java |
diffstat | 2 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Oct 09 13:44:15 2013 +0200 +++ b/ChangeLog Thu Oct 10 10:42:18 2013 +0200 @@ -1,3 +1,9 @@ +2013-10-10 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/ScriptExceptionClassTest.java: + Added new test testNewInstance into the test suite + ScriptExceptionClassTest. + 2013-10-09 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/ScriptExceptionClassTest.java:
--- a/src/org/RhinoTests/ScriptExceptionClassTest.java Wed Oct 09 13:44:15 2013 +0200 +++ b/src/org/RhinoTests/ScriptExceptionClassTest.java Thu Oct 10 10:42:18 2013 +0200 @@ -1646,6 +1646,23 @@ } /** + * Test for method javax.script.ScriptException.getClass().newInstance() + */ + protected void testNewInstance() { + try { + Object o = this.scriptExceptionClass.newInstance(); + throw new AssertionError("Class.newInstance() does not throw any exception"); + } + catch (InstantiationException e) { + // expected exception + } + catch (IllegalAccessException e) { + // expected exception + } + + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptException */ @SuppressWarnings("cast")