/hg/rhino-tests: Updated four tests in ScriptEngineClassTest for...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Mon Apr 22 01:21:29 PDT 2013
changeset 0cc424132a4d in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=0cc424132a4d
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Apr 22 10:24:46 2013 +0200
Updated four tests in ScriptEngineClassTest for (Open)JDK8 API:
getConstructor, getDeclaredConstructor, getConstructors and
getDeclaredConstructors.
diffstat:
ChangeLog | 7 +++
src/org/RhinoTests/ScriptEngineClassTest.java | 56 +++++++++++++++++++++++++-
2 files changed, 59 insertions(+), 4 deletions(-)
diffs (107 lines):
diff -r 55e3f28c9808 -r 0cc424132a4d ChangeLog
--- a/ChangeLog Fri Apr 19 10:47:17 2013 +0200
+++ b/ChangeLog Mon Apr 22 10:24:46 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-22 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptEngineClassTest.java:
+ Updated four tests in ScriptEngineClassTest for (Open)JDK8 API:
+ getConstructor, getDeclaredConstructor, getConstructors and
+ getDeclaredConstructors.
+
2013-04-19 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptContextClassTest.java:
diff -r 55e3f28c9808 -r 0cc424132a4d src/org/RhinoTests/ScriptEngineClassTest.java
--- a/src/org/RhinoTests/ScriptEngineClassTest.java Fri Apr 19 10:47:17 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java Mon Apr 22 10:24:46 2013 +0200
@@ -288,10 +288,21 @@
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>();
// 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.scriptEngineClass.getConstructors();
@@ -310,10 +321,21 @@
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>();
// 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.scriptEngineClass.getDeclaredConstructors();
@@ -332,7 +354,20 @@
Map<String, Class[]> constructorsThatShouldExist_jdk7 = new TreeMap<String, Class[]>();
- Map<String, Class[]> constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+ Map<String, Class[]> constructorsThatShouldExist_jdk8 = new TreeMap<String, 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()) {
@@ -362,7 +397,20 @@
Map<String, Class[]> constructorsThatShouldExist_jdk7 = new TreeMap<String, Class[]>();
- Map<String, Class[]> constructorsThatShouldExist = getJavaVersion() < 7 ? constructorsThatShouldExist_jdk6 : constructorsThatShouldExist_jdk7;
+ Map<String, Class[]> constructorsThatShouldExist_jdk8 = new TreeMap<String, 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