/hg/rhino-tests: Updated four tests in CompiledScriptClassTest f...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Apr 16 00:58:25 PDT 2013
changeset ae65fb0ae251 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=ae65fb0ae251
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Apr 16 10:01:43 2013 +0200
Updated four tests in CompiledScriptClassTest for (Open)JDK8 API:
getConstructor, getDeclaredConstructor, getConstructors and
getDeclaredConstructors.
diffstat:
ChangeLog | 7 ++
src/org/RhinoTests/CompiledScriptClassTest.java | 62 +++++++++++++++++++++++-
2 files changed, 65 insertions(+), 4 deletions(-)
diffs (119 lines):
diff -r 46a9ca22d451 -r ae65fb0ae251 ChangeLog
--- a/ChangeLog Mon Apr 15 10:51:45 2013 +0200
+++ b/ChangeLog Tue Apr 16 10:01:43 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-16 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/CompiledScriptClassTest.java:
+ Updated four tests in CompiledScriptClassTest for (Open)JDK8 API:
+ getConstructor, getDeclaredConstructor, getConstructors and
+ getDeclaredConstructors.
+
2013-04-15 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/SimpleBindingsClassTest.java:
diff -r 46a9ca22d451 -r ae65fb0ae251 src/org/RhinoTests/CompiledScriptClassTest.java
--- a/src/org/RhinoTests/CompiledScriptClassTest.java Mon Apr 15 10:51:45 2013 +0200
+++ b/src/org/RhinoTests/CompiledScriptClassTest.java Tue Apr 16 10:01:43 2013 +0200
@@ -342,13 +342,26 @@
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.CompiledScript()", "javax.script.CompiledScript");
testedConstructors_jdk7.put("public javax.script.CompiledScript()", "javax.script.CompiledScript");
+ testedConstructors_jdk8.put("public javax.script.CompiledScript()", "javax.script.CompiledScript");
+
// 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.compiledScriptClass.getConstructors();
@@ -373,13 +386,26 @@
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.CompiledScript()", "javax.script.CompiledScript");
testedConstructors_jdk7.put("public javax.script.CompiledScript()", "javax.script.CompiledScript");
+ testedConstructors_jdk8.put("public javax.script.CompiledScript()", "javax.script.CompiledScript");
+
// 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.compiledScriptClass.getDeclaredConstructors();
@@ -407,7 +433,21 @@
Map<String, Class[]> constructorsThatShouldExist_jdk7 = new TreeMap<String, Class[]>();
constructorsThatShouldExist_jdk7.put("javax.script.CompiledScript", new 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.CompiledScript", 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()) {
@@ -439,7 +479,21 @@
Map<String, Class[]> constructorsThatShouldExist_jdk7 = new TreeMap<String, Class[]>();
constructorsThatShouldExist_jdk7.put("javax.script.CompiledScript", new 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.CompiledScript", 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