/hg/rhino-tests: Updated four tests in ScriptExceptionClassTest ...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Wed Apr 24 01:25:48 PDT 2013
changeset 61dbb34d31e6 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=61dbb34d31e6
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Apr 24 10:29:05 2013 +0200
Updated four tests in ScriptExceptionClassTest for (Open)JDK8 API:
getConstructor, getDeclaredConstructor, getConstructors and
getDeclaredConstructors.
diffstat:
ChangeLog | 7 ++
src/org/RhinoTests/ScriptExceptionClassTest.java | 74 ++++++++++++++++++++++-
2 files changed, 77 insertions(+), 4 deletions(-)
diffs (135 lines):
diff -r 0cc424132a4d -r 61dbb34d31e6 ChangeLog
--- a/ChangeLog Mon Apr 22 10:24:46 2013 +0200
+++ b/ChangeLog Wed Apr 24 10:29:05 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-24 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptExceptionClassTest.java:
+ Updated four tests in ScriptExceptionClassTest for (Open)JDK8 API:
+ getConstructor, getDeclaredConstructor, getConstructors and
+ getDeclaredConstructors.
+
2013-04-22 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptEngineClassTest.java:
diff -r 0cc424132a4d -r 61dbb34d31e6 src/org/RhinoTests/ScriptExceptionClassTest.java
--- a/src/org/RhinoTests/ScriptExceptionClassTest.java Mon Apr 22 10:24:46 2013 +0200
+++ b/src/org/RhinoTests/ScriptExceptionClassTest.java Wed Apr 24 10:29:05 2013 +0200
@@ -288,6 +288,7 @@
Map<String, String> testedConstructors = null;
Map<String, String> testedConstructors_jdk6 = new HashMap<String, String>();
Map<String, String> testedConstructors_jdk7 = new HashMap<String, String>();
+ Map<String, String> testedConstructors_jdk8 = new HashMap<String, String>();
testedConstructors_jdk6.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
testedConstructors_jdk6.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
@@ -299,8 +300,23 @@
testedConstructors_jdk7.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
testedConstructors_jdk7.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String,java.lang.String,int,int)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String,java.lang.String,int)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
+
// get the right map containing constructor signatures
- testedConstructors = getJavaVersion() < 7 ? testedConstructors_jdk6 : testedConstructors_jdk7;
+ switch (getJavaVersion()) {
+ case 6:
+ testedConstructors = testedConstructors_jdk6;
+ break;
+ case 7:
+ testedConstructors = testedConstructors_jdk7;
+ break;
+ case 8:
+ testedConstructors = testedConstructors_jdk8;
+ break;
+ }
// get all constructors for this class
Constructor<?>[] constructors = this.scriptExceptionClass.getConstructors();
@@ -325,6 +341,7 @@
Map<String, String> testedConstructors = null;
Map<String, String> testedConstructors_jdk6 = new HashMap<String, String>();
Map<String, String> testedConstructors_jdk7 = new HashMap<String, String>();
+ Map<String, String> testedConstructors_jdk8 = new HashMap<String, String>();
testedConstructors_jdk6.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
testedConstructors_jdk6.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
@@ -336,8 +353,23 @@
testedConstructors_jdk7.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
testedConstructors_jdk7.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String,java.lang.String,int,int)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.String,java.lang.String,int)", "javax.script.ScriptException");
+ testedConstructors_jdk8.put("public javax.script.ScriptException(java.lang.Exception)", "javax.script.ScriptException");
+
// get the right map containing constructor signatures
- testedConstructors = getJavaVersion() < 7 ? testedConstructors_jdk6 : testedConstructors_jdk7;
+ switch (getJavaVersion()) {
+ case 6:
+ testedConstructors = testedConstructors_jdk6;
+ break;
+ case 7:
+ testedConstructors = testedConstructors_jdk7;
+ break;
+ case 8:
+ testedConstructors = testedConstructors_jdk8;
+ break;
+ }
// get all declared constructors for this class
Constructor<?>[] declaredConstructors = this.scriptExceptionClass.getDeclaredConstructors();
@@ -371,7 +403,24 @@
constructorsThatShouldExist_jdk7.put("javax.script.ScriptException", new Class[] {java.lang.Exception.class});
constructorsThatShouldExist_jdk7.put("javax.script.ScriptException", new Class[] {java.lang.String.class});
- Map<String, Class[]> constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+ Map<String, Class[]> constructorsThatShouldExist_jdk8 = new TreeMap<String, Class[]>();
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class, java.lang.String.class, int.class, int.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class, java.lang.String.class, int.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.Exception.class});
+
+ Map<String, Class[]> constructorsThatShouldExist = null;
+ switch (getJavaVersion()) {
+ case 6:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk6;
+ break;
+ case 7:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk7;
+ break;
+ case 8:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk8;
+ break;
+ }
// check if all required constructors really exist
for (Map.Entry<String, Class[]> constructorThatShouldExists : constructorsThatShouldExist.entrySet()) {
@@ -409,7 +458,24 @@
constructorsThatShouldExist_jdk7.put("javax.script.ScriptException", new Class[] {java.lang.Exception.class});
constructorsThatShouldExist_jdk7.put("javax.script.ScriptException", new Class[] {java.lang.String.class});
- Map<String, Class[]> constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+ Map<String, Class[]> constructorsThatShouldExist_jdk8 = new TreeMap<String, Class[]>();
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class, java.lang.String.class, int.class, int.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.String.class, java.lang.String.class, int.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptException", new Class[] {java.lang.Exception.class});
+
+ Map<String, Class[]> constructorsThatShouldExist = null;
+ switch (getJavaVersion()) {
+ case 6:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk6;
+ break;
+ case 7:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk7;
+ break;
+ case 8:
+ constructorsThatShouldExist = constructorsThatShouldExist_jdk8;
+ break;
+ }
// check if all required constructors really exist
for (Map.Entry<String, Class[]> constructorThatShouldExists : constructorsThatShouldExist.entrySet()) {
More information about the distro-pkg-dev
mailing list