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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Apr 15 01:48:28 PDT 2013


changeset 46a9ca22d451 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=46a9ca22d451
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Apr 15 10:51:45 2013 +0200

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


diffstat:

 ChangeLog                                       |   7 ++
 src/org/RhinoTests/SimpleBindingsClassTest.java |  66 +++++++++++++++++++++++-
 2 files changed, 69 insertions(+), 4 deletions(-)

diffs (127 lines):

diff -r 857eee8c4f34 -r 46a9ca22d451 ChangeLog
--- a/ChangeLog	Thu Apr 11 11:03:34 2013 +0200
+++ b/ChangeLog	Mon Apr 15 10:51:45 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-15  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/SimpleBindingsClassTest.java:
+	Updated four tests in SimpleBindingsClass for (Open)JDK8 API:
+	getConstructor, getDeclaredConstructor, getConstructors and
+	getDeclaredConstructors.
+
 2013-04-11  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/SimpleScriptContextClassTest.java:
diff -r 857eee8c4f34 -r 46a9ca22d451 src/org/RhinoTests/SimpleBindingsClassTest.java
--- a/src/org/RhinoTests/SimpleBindingsClassTest.java	Thu Apr 11 11:03:34 2013 +0200
+++ b/src/org/RhinoTests/SimpleBindingsClassTest.java	Mon Apr 15 10:51:45 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.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
         testedConstructors_jdk6.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
@@ -295,8 +296,21 @@
         testedConstructors_jdk7.put("public javax.script.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
         testedConstructors_jdk7.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
 
+        testedConstructors_jdk8.put("public javax.script.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
+        testedConstructors_jdk8.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
+
         // 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.simpleBindingsClass.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.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
         testedConstructors_jdk6.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
@@ -328,8 +343,21 @@
         testedConstructors_jdk7.put("public javax.script.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
         testedConstructors_jdk7.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
 
+        testedConstructors_jdk8.put("public javax.script.SimpleBindings(java.util.Map)", "javax.script.SimpleBindings");
+        testedConstructors_jdk8.put("public javax.script.SimpleBindings()", "javax.script.SimpleBindings");
+
         // 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.simpleBindingsClass.getDeclaredConstructors();
@@ -359,7 +387,22 @@
         constructorsThatShouldExist_jdk7.put("javax.script.SimpleBindings", new Class[] {java.util.Map.class});
         constructorsThatShouldExist_jdk7.put("javax.script.SimpleBindings", 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.SimpleBindings", new Class[] {java.util.Map.class});
+        constructorsThatShouldExist_jdk8.put("javax.script.SimpleBindings", 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.SimpleBindings", new Class[] {java.util.Map.class});
         constructorsThatShouldExist_jdk7.put("javax.script.SimpleBindings", 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.SimpleBindings", new Class[] {java.util.Map.class});
+        constructorsThatShouldExist_jdk8.put("javax.script.SimpleBindings", 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