# HG changeset patch # User Pavel Tisnovsky # Date 1391598094 -3600 # Node ID 90ec2e72a315bc00a54dbfb4ebde516f0e1809d7 # Parent ccbc43e0fc525fbe632e5ec310de138a591fc815 Added new testGetResourceNegativeTest case into ScriptExceptionClassTest. diff -r ccbc43e0fc52 -r 90ec2e72a315 ChangeLog --- a/ChangeLog Tue Feb 04 12:49:25 2014 +0100 +++ b/ChangeLog Wed Feb 05 12:01:34 2014 +0100 @@ -1,3 +1,9 @@ +2014-02-05 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptExceptionClassTest.java: + Added new testGetResourceNegativeTest case into + ScriptExceptionClassTest. + 2014-02-04 Pavel Tisnovsky * src/org/RhinoTests/SimpleBindingsClassTest.java: diff -r ccbc43e0fc52 -r 90ec2e72a315 src/org/RhinoTests/ScriptExceptionClassTest.java --- a/src/org/RhinoTests/ScriptExceptionClassTest.java Tue Feb 04 12:49:25 2014 +0100 +++ b/src/org/RhinoTests/ScriptExceptionClassTest.java Wed Feb 05 12:01:34 2014 +0100 @@ -1462,6 +1462,214 @@ } try { + this.scriptExceptionClass.asSubclass(java.awt.Label.class); + throw new AssertionError("Class.asSubclass(java.awt.Label.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.awt.List.class); + throw new AssertionError("Class.asSubclass(java.awt.List.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.awt.Menu.class); + throw new AssertionError("Class.asSubclass(java.awt.Menu.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.File.class); + throw new AssertionError("Class.asSubclass(java.io.File.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.Reader.class); + throw new AssertionError("Class.asSubclass(java.io.Reader.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.Writer.class); + throw new AssertionError("Class.asSubclass(java.io.Writer.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.StringReader.class); + throw new AssertionError("Class.asSubclass(java.io.StringReader.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.StringWriter.class); + throw new AssertionError("Class.asSubclass(java.io.StringWriter.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.InputStream.class); + throw new AssertionError("Class.asSubclass(java.io.InputStream.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.OutputStream.class); + throw new AssertionError("Class.asSubclass(java.io.OutputStream.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.ObjectInputStream.class); + throw new AssertionError("Class.asSubclass(java.io.ObjectInputStream.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.io.ObjectOutputStream.class); + throw new AssertionError("Class.asSubclass(java.io.ObjectOutputStream.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.math.BigDecimal.class); + throw new AssertionError("Class.asSubclass(java.math.BigDecimal.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.math.BigInteger.class); + throw new AssertionError("Class.asSubclass(java.math.BigInteger.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.ArrayList.class); + throw new AssertionError("Class.asSubclass(java.util.ArrayList.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.LinkedList.class); + throw new AssertionError("Class.asSubclass(java.util.LinkedList.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.HashMap.class); + throw new AssertionError("Class.asSubclass(java.util.HashMap.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.TreeMap.class); + throw new AssertionError("Class.asSubclass(java.util.TreeMap.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.HashSet.class); + throw new AssertionError("Class.asSubclass(java.util.HashSet.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.TreeSet.class); + throw new AssertionError("Class.asSubclass(java.util.TreeSet.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Stack.class); + throw new AssertionError("Class.asSubclass(java.util.Stack.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Vector.class); + throw new AssertionError("Class.asSubclass(java.util.Vector.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Hashtable.class); + throw new AssertionError("Class.asSubclass(java.util.Hashtable.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Calendar.class); + throw new AssertionError("Class.asSubclass(java.util.Calendar.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Arrays.class); + throw new AssertionError("Class.asSubclass(java.util.Arrays.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptExceptionClass.asSubclass(java.util.Collections.class); + throw new AssertionError("Class.asSubclass(java.util.Collections.class) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.scriptExceptionClass.asSubclass(javax.swing.JPanel.class); throw new AssertionError("Class.asSubclass(javax.swing.JPanel.class) does not throw any exception"); } @@ -1796,6 +2004,14 @@ } /** + * Test for method javax.script.ScriptException.getClass().getResourceNegativeTest() + */ + protected void testGetResourceNegativeTest() { + Object resource = this.scriptExceptionClass.getResource("unknown"); + assertNull(resource, "getResource() does not return null"); + } + + /** * Test for instanceof operator applied to a class javax.script.ScriptException */ @SuppressWarnings("cast")