/hg/rhino-tests: Updated four tests in SimpleBindingsClassTest f...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Thu May 9 00:36:36 PDT 2013


changeset bdda58cfb157 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=bdda58cfb157
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu May 09 09:40:02 2013 +0200

	Updated four tests in SimpleBindingsClassTest for (Open)JDK8 API:
	getField, getDeclaredField, getFields and getDeclaredFields.


diffstat:

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

diffs (115 lines):

diff -r 32315f7a8cb8 -r bdda58cfb157 ChangeLog
--- a/ChangeLog	Fri May 03 09:30:03 2013 +0200
+++ b/ChangeLog	Thu May 09 09:40:02 2013 +0200
@@ -1,3 +1,9 @@
+2013-05-09  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/SimpleBindingsClassTest.java:
+	Updated four tests in SimpleBindingsClassTest for (Open)JDK8 API:
+	getField, getDeclaredField, getFields and getDeclaredFields.
+
 2013-05-03  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/CompiledScriptClassTest.java:
diff -r 32315f7a8cb8 -r bdda58cfb157 src/org/RhinoTests/SimpleBindingsClassTest.java
--- a/src/org/RhinoTests/SimpleBindingsClassTest.java	Fri May 03 09:30:03 2013 +0200
+++ b/src/org/RhinoTests/SimpleBindingsClassTest.java	Thu May 09 09:40:02 2013 +0200
@@ -481,9 +481,22 @@
         };
         final String[] fieldsThatShouldExist_jdk7 = {
         };
+        final String[] fieldsThatShouldExist_jdk8 = {
+        };
 
         // get the right array of field signatures
-        final String[] fieldsThatShouldExist = getJavaVersion() < 7 ? fieldsThatShouldExist_jdk6 : fieldsThatShouldExist_jdk7;
+        String[] fieldsThatShouldExist = null;
+        switch (getJavaVersion()) {
+            case 6:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk6;
+                break;
+            case 7:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk7;
+                break;
+            case 8:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk8;
+                break;
+        }
 
         // get all fields
         Field[] fields = this.simpleBindingsClass.getFields();
@@ -510,10 +523,24 @@
         final String[] declaredFieldsThatShouldExist_jdk7 = {
             "private java.util.Map javax.script.SimpleBindings.map",
         };
+        final String[] declaredFieldsThatShouldExist_jdk8 = {
+            "private java.util.Map javax.script.SimpleBindings.map",
+        };
 
         // get the right array of field signatures
         // following fields should be declared
-        final String[] declaredFieldsThatShouldExist = getJavaVersion() < 7 ? declaredFieldsThatShouldExist_jdk6 : declaredFieldsThatShouldExist_jdk7;
+        String[] declaredFieldsThatShouldExist = null;
+        switch (getJavaVersion()) {
+            case 6:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk6;
+                break;
+            case 7:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk7;
+                break;
+            case 8:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk8;
+                break;
+        }
 
         // get all declared fields
         Field[] declaredFields = this.simpleBindingsClass.getDeclaredFields();
@@ -538,8 +565,21 @@
         };
         final String[] fieldsThatShouldExist_jdk7 = {
         };
+        final String[] fieldsThatShouldExist_jdk8 = {
+        };
 
-        final String[] fieldsThatShouldExist = getJavaVersion() < 7 ? fieldsThatShouldExist_jdk6 : fieldsThatShouldExist_jdk7;
+        String[] fieldsThatShouldExist = null;
+        switch (getJavaVersion()) {
+            case 6:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk6;
+                break;
+            case 7:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk7;
+                break;
+            case 8:
+                fieldsThatShouldExist = fieldsThatShouldExist_jdk8;
+                break;
+        }
 
         // check if all required fields really exists
         for (String fieldThatShouldExists : fieldsThatShouldExist) {
@@ -567,8 +607,24 @@
         final String[] declaredFieldsThatShouldExist_jdk7 = {
             "map",
         };
+        final String[] declaredFieldsThatShouldExist_jdk8 = {
+            "map",
+        };
 
-        final String[] declaredFieldsThatShouldExist = getJavaVersion() < 7 ? declaredFieldsThatShouldExist_jdk6 : declaredFieldsThatShouldExist_jdk7;
+        // get the right array of field signatures
+        // following fields should be declared
+        String[] declaredFieldsThatShouldExist = null;
+        switch (getJavaVersion()) {
+            case 6:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk6;
+                break;
+            case 7:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk7;
+                break;
+            case 8:
+                declaredFieldsThatShouldExist = declaredFieldsThatShouldExist_jdk8;
+                break;
+        }
 
         // check if all required declared fields really exists
         for (String declaredFieldThatShouldExists : declaredFieldsThatShouldExist) {



More information about the distro-pkg-dev mailing list