Mercurial > hg > rhino-tests
changeset 234:12f27742973a draft
Added new test testNewInstance into the test suite
BindingsClassTest.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Tue, 17 Sep 2013 11:31:40 +0200 |
parents | 073edb9552f8 |
children | 2e5f4bdb4931 |
files | ChangeLog src/org/RhinoTests/CompilableClassTest.java |
diffstat | 2 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Sep 16 09:40:40 2013 +0200 +++ b/ChangeLog Tue Sep 17 11:31:40 2013 +0200 @@ -1,3 +1,9 @@ +2013-09-17 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/CompilableClassTest.java: + Added new test testNewInstance into the test suite + BindingsClassTest. + 2013-09-16 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/BindingsClassTest.java:
--- a/src/org/RhinoTests/CompilableClassTest.java Mon Sep 16 09:40:40 2013 +0200 +++ b/src/org/RhinoTests/CompilableClassTest.java Tue Sep 17 11:31:40 2013 +0200 @@ -1396,6 +1396,23 @@ } /** + * Test for method javax.script.Compilable.getClass().newInstance() + */ + protected void testNewInstance() { + try { + Object o = this.compilableClass.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.Compilable */ @SuppressWarnings("cast")