/hg/rhino-tests: Added new test cases into CompilableClassTest.
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Feb 7 02:51:11 PST 2014
changeset 231f67d488ce in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=231f67d488ce
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Feb 07 11:55:30 2014 +0100
Added new test cases into CompilableClassTest.
diffstat:
ChangeLog | 5 ++
src/org/RhinoTests/CompilableClassTest.java | 72 +++++++++++++++++++++++++++++
2 files changed, 77 insertions(+), 0 deletions(-)
diffs (129 lines):
diff -r fd15e637f069 -r 231f67d488ce ChangeLog
--- a/ChangeLog Thu Feb 06 13:11:10 2014 +0100
+++ b/ChangeLog Fri Feb 07 11:55:30 2014 +0100
@@ -1,3 +1,8 @@
+2014-02-07 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/CompilableClassTest.java:
+ Added new test cases into CompilableClassTest.
+
2014-02-06 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptContextClassTest.java:
diff -r fd15e637f069 -r 231f67d488ce src/org/RhinoTests/CompilableClassTest.java
--- a/src/org/RhinoTests/CompilableClassTest.java Thu Feb 06 13:11:10 2014 +0100
+++ b/src/org/RhinoTests/CompilableClassTest.java Fri Feb 07 11:55:30 2014 +0100
@@ -1506,6 +1506,14 @@
}
try {
+ this.compilableClass.cast(Character.valueOf('a'));
+ throw new AssertionError("Class.cast(Character.valueOf('a')) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(Byte.valueOf((byte)42));
throw new AssertionError("Class.cast(Byte.valueOf((byte)42)) does not throw any exception");
}
@@ -1562,6 +1570,14 @@
}
try {
+ this.compilableClass.cast(new Throwable("xyzzy"));
+ throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(new RuntimeException());
throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception");
}
@@ -1570,6 +1586,14 @@
}
try {
+ this.compilableClass.cast(new RuntimeException("xyzzy"));
+ throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(new Error());
throw new AssertionError("Class.cast(new Error()) does not throw any exception");
}
@@ -1578,6 +1602,22 @@
}
try {
+ this.compilableClass.cast(new Error("xyzzy"));
+ throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.compilableClass.cast(new java.io.File("xyzzy"));
+ throw new AssertionError("Class.cast(new java.io.File(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(new java.lang.String());
throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception");
}
@@ -1626,6 +1666,30 @@
}
try {
+ this.compilableClass.cast(new java.awt.Label());
+ throw new AssertionError("Class.cast(new java.awt.Label()) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.compilableClass.cast(new java.awt.Label(new String()));
+ throw new AssertionError("Class.cast(new java.awt.Label(new String())) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
+ this.compilableClass.cast(new java.awt.Label("xyzzy"));
+ throw new AssertionError("Class.cast(new java.awt.Label(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(new javax.swing.JLabel());
throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception");
}
@@ -1642,6 +1706,14 @@
}
try {
+ this.compilableClass.cast(new javax.swing.JLabel("xyzzy"));
+ throw new AssertionError("Class.cast(new javax.swing.JLabel(\"xyzzy\")) does not throw any exception");
+ }
+ catch (Exception e) {
+ // expected exception
+ }
+
+ try {
this.compilableClass.cast(new javax.swing.JPanel());
throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception");
}
More information about the distro-pkg-dev
mailing list