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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Apr 10 00:24:45 PDT 2013


changeset 03d34eb842e5 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=03d34eb842e5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Apr 10 09:28:01 2013 +0200

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


diffstat:

 ChangeLog                                   |   7 +++
 src/org/RhinoTests/CompilableClassTest.java |  56 ++++++++++++++++++++++++++--
 2 files changed, 59 insertions(+), 4 deletions(-)

diffs (107 lines):

diff -r 00ffd5cdf7b4 -r 03d34eb842e5 ChangeLog
--- a/ChangeLog	Tue Apr 09 09:16:53 2013 +0200
+++ b/ChangeLog	Wed Apr 10 09:28:01 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-10  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/CompilableClassTest.java:
+	Updated four tests in CompilableClassTest for (Open)JDK8 API:
+	getConstructor, getDeclaredConstructor, getConstructors and
+	getDeclaredConstructors.
+
 2013-04-09  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/BindingsClassTest.java:
diff -r 00ffd5cdf7b4 -r 03d34eb842e5 src/org/RhinoTests/CompilableClassTest.java
--- a/src/org/RhinoTests/CompilableClassTest.java	Tue Apr 09 09:16:53 2013 +0200
+++ b/src/org/RhinoTests/CompilableClassTest.java	Wed Apr 10 09:28:01 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.compilableClass.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.compilableClass.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