/hg/rhino-tests: Updated four tests in ScriptEngineManagerClassT...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Apr 26 00:20:25 PDT 2013
changeset 4af92415b07c in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=4af92415b07c
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Apr 26 09:23:44 2013 +0200
Updated four tests in ScriptEngineManagerClassTest for (Open)JDK8 API:
getConstructor, getDeclaredConstructor, getConstructors and
getDeclaredConstructors.
diffstat:
ChangeLog | 7 ++
src/org/RhinoTests/ScriptEngineManagerClassTest.java | 66 ++++++++++++++++++-
2 files changed, 69 insertions(+), 4 deletions(-)
diffs (127 lines):
diff -r 61e408523e1b -r 4af92415b07c ChangeLog
--- a/ChangeLog Thu Apr 25 10:11:25 2013 +0200
+++ b/ChangeLog Fri Apr 26 09:23:44 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-26 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptEngineManagerClassTest.java:
+ Updated four tests in ScriptEngineManagerClassTest for (Open)JDK8 API:
+ getConstructor, getDeclaredConstructor, getConstructors and
+ getDeclaredConstructors.
+
2013-04-25 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
diff -r 61e408523e1b -r 4af92415b07c src/org/RhinoTests/ScriptEngineManagerClassTest.java
--- a/src/org/RhinoTests/ScriptEngineManagerClassTest.java Thu Apr 25 10:11:25 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineManagerClassTest.java Fri Apr 26 09:23:44 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.ScriptEngineManager()", "javax.script.ScriptEngineManager");
testedConstructors_jdk6.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
@@ -295,8 +296,21 @@
testedConstructors_jdk7.put("public javax.script.ScriptEngineManager()", "javax.script.ScriptEngineManager");
testedConstructors_jdk7.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
+ testedConstructors_jdk8.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
+ testedConstructors_jdk8.put("public javax.script.ScriptEngineManager()", "javax.script.ScriptEngineManager");
+
// 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.scriptEngineManagerClass.getConstructors();
@@ -321,6 +335,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.ScriptEngineManager()", "javax.script.ScriptEngineManager");
testedConstructors_jdk6.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
@@ -328,8 +343,21 @@
testedConstructors_jdk7.put("public javax.script.ScriptEngineManager()", "javax.script.ScriptEngineManager");
testedConstructors_jdk7.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
+ testedConstructors_jdk8.put("public javax.script.ScriptEngineManager(java.lang.ClassLoader)", "javax.script.ScriptEngineManager");
+ testedConstructors_jdk8.put("public javax.script.ScriptEngineManager()", "javax.script.ScriptEngineManager");
+
// 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.scriptEngineManagerClass.getDeclaredConstructors();
@@ -359,7 +387,22 @@
constructorsThatShouldExist_jdk7.put("javax.script.ScriptEngineManager", new Class[] {});
constructorsThatShouldExist_jdk7.put("javax.script.ScriptEngineManager", new Class[] {java.lang.ClassLoader.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.ScriptEngineManager", new Class[] {java.lang.ClassLoader.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptEngineManager", new 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()) {
@@ -393,7 +436,22 @@
constructorsThatShouldExist_jdk7.put("javax.script.ScriptEngineManager", new Class[] {});
constructorsThatShouldExist_jdk7.put("javax.script.ScriptEngineManager", new Class[] {java.lang.ClassLoader.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.ScriptEngineManager", new Class[] {java.lang.ClassLoader.class});
+ constructorsThatShouldExist_jdk8.put("javax.script.ScriptEngineManager", new 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