/hg/rhino-tests: Updated four tests in BindingsClassTest for (Op...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Apr 9 00:13:39 PDT 2013


changeset 00ffd5cdf7b4 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=00ffd5cdf7b4
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Apr 09 09:16:53 2013 +0200

	Updated four tests in BindingsClassTest for (Open)JDK8 API:
	getConstructor, getDeclaredConstructor, getConstructors and
	getDeclaredConstructors.


diffstat:

 ChangeLog                                 |  12 +++++-
 src/org/RhinoTests/BindingsClassTest.java |  56 ++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 6 deletions(-)

diffs (115 lines):

diff -r b3477ca1f6b3 -r 00ffd5cdf7b4 ChangeLog
--- a/ChangeLog	Mon Apr 08 10:16:25 2013 +0200
+++ b/ChangeLog	Tue Apr 09 09:16:53 2013 +0200
@@ -1,8 +1,16 @@
+2013-04-09  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/BindingsClassTest.java:
+	Updated four tests in BindingsClassTest for (Open)JDK8 API:
+	getConstructor, getDeclaredConstructor, getConstructors and
+	getDeclaredConstructors.
+
 2013-04-08  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
-	Updated four tests for (Open)JDK8 API: getConstructor,
-	getDeclaredConstructor, getConstructors and getDeclaredConstructors.
+	Updated four tests in AbstractScriptEngineClassTest for (Open)JDK8
+	API: getConstructor, getDeclaredConstructor, getConstructors and
+	getDeclaredConstructors.
 
 2013-04-05  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
diff -r b3477ca1f6b3 -r 00ffd5cdf7b4 src/org/RhinoTests/BindingsClassTest.java
--- a/src/org/RhinoTests/BindingsClassTest.java	Mon Apr 08 10:16:25 2013 +0200
+++ b/src/org/RhinoTests/BindingsClassTest.java	Tue Apr 09 09:16:53 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.bindingsClass.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.bindingsClass.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