/hg/rhino-tests: Added new test testAsSubclass into the test suite
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Thu Sep 12 02:45:03 PDT 2013
changeset 78bab1320e16 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=78bab1320e16
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu Sep 12 11:48:50 2013 +0200
Added new test testAsSubclass into the test suite
ScriptContextClassTest.
diffstat:
ChangeLog | 8 +-
src/org/RhinoTests/ScriptContextClassTest.java | 158 +++++++++++++++++++++++++
2 files changed, 165 insertions(+), 1 deletions(-)
diffs (187 lines):
diff -r 9a2fbbac6020 -r 78bab1320e16 ChangeLog
--- a/ChangeLog Wed Sep 11 09:52:46 2013 +0200
+++ b/ChangeLog Thu Sep 12 11:48:50 2013 +0200
@@ -1,8 +1,14 @@
+2013-09-12 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptContextClassTest.java:
+ Added new test testAsSubclass into the test suite
+ ScriptContextClassTest.
+
2013-09-11 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptContextClassTest.java:
Added new test testCast (that checks Class.cast() method) into test
- test suite InvocableClassTest.
+ test suite ScriptContextClassTest.
2013-09-10 Pavel Tisnovsky <ptisnovs at redhat.com>
diff -r 9a2fbbac6020 -r 78bab1320e16 src/org/RhinoTests/ScriptContextClassTest.java
--- a/src/org/RhinoTests/ScriptContextClassTest.java Wed Sep 11 09:52:46 2013 +0200
+++ b/src/org/RhinoTests/ScriptContextClassTest.java Thu Sep 12 11:48:50 2013 +0200
@@ -1214,6 +1214,164 @@
}
/**
+ * Test for method javax.script.ScriptContext.getClass().asSubclass()
+ */
+ protected void testAsSubclass() {
+ try {
+ this.scriptContextClass.asSubclass(scriptContextClass);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new AssertionError(e.getMessage());
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Void.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Void.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Number.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Number.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Byte.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Byte.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Double.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Double.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Float.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Float.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Integer.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Integer.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Long.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Long.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.Short.class);
+ throw new AssertionError("Class.asSubclass(java.lang.Short.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.String.class);
+ throw new AssertionError("Class.asSubclass(java.lang.String.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.StringBuffer.class);
+ throw new AssertionError("Class.asSubclass(java.lang.StringBuffer.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.lang.StringBuilder.class);
+ throw new AssertionError("Class.asSubclass(java.lang.StringBuilder.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.awt.Color.class);
+ throw new AssertionError("Class.asSubclass(java.awt.Color.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.awt.Font.class);
+ throw new AssertionError("Class.asSubclass(java.awt.Font.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(java.awt.Image.class);
+ throw new AssertionError("Class.asSubclass(java.awt.Image.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(javax.swing.JPanel.class);
+ throw new AssertionError("Class.asSubclass(javax.swing.JPanel.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(javax.swing.JColorChooser.class);
+ throw new AssertionError("Class.asSubclass(javax.swing.JColorChooser.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(javax.swing.JScrollBar.class);
+ throw new AssertionError("Class.asSubclass(javax.swing.JScrollBar.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.scriptContextClass.asSubclass(javax.swing.JSlider.class);
+ throw new AssertionError("Class.asSubclass(javax.swing.JSlider.class) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ }
+
+ /**
* Test for method javax.script.ScriptContext.getClass().cast()
*/
protected void testCast() {
More information about the distro-pkg-dev
mailing list