/hg/rhino-tests: Small updates in getAnnotation and getAnnotatio...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Mon Jun 10 00:29:54 PDT 2013
changeset f05207753755 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=f05207753755
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Jun 10 09:33:25 2013 +0200
Small updates in getAnnotation and getAnnotations tests.
diffstat:
ChangeLog | 5 +++
src/org/RhinoTests/ScriptEngineClassTest.java | 36 +++++++++++++++++++++++++-
2 files changed, 39 insertions(+), 2 deletions(-)
diffs (79 lines):
diff -r 7a2365e86a6d -r f05207753755 ChangeLog
--- a/ChangeLog Fri Jun 07 13:38:43 2013 +0200
+++ b/ChangeLog Mon Jun 10 09:33:25 2013 +0200
@@ -1,3 +1,8 @@
+2013-06-10 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptEngineClassTest.java:
+ Small updates in getAnnotation and getAnnotations tests.
+
2013-06-07 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptEngineClassTest.java:
diff -r 7a2365e86a6d -r f05207753755 src/org/RhinoTests/ScriptEngineClassTest.java
--- a/src/org/RhinoTests/ScriptEngineClassTest.java Fri Jun 07 13:38:43 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java Mon Jun 10 09:33:25 2013 +0200
@@ -1027,6 +1027,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.scriptEngineClass.getAnnotations();
// and transform the array into a list of annotation names
@@ -1034,7 +1037,20 @@
for (Annotation annotation : annotations) {
annotationsAsString.add(annotation.toString());
}
- String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7;
+
+ String[] annotationsThatShouldExists = null;
+ switch (getJavaVersion()) {
+ case 6:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk6;
+ break;
+ case 7:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk7;
+ break;
+ case 8:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk8;
+ break;
+ }
+
// check if all required annotations really exists
for (String annotationThatShouldExists : annotationsThatShouldExists) {
assertTrue(annotationsAsString.contains(annotationThatShouldExists),
@@ -1053,6 +1069,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.scriptEngineClass.getDeclaredAnnotations();
// and transform the array into a list of annotation names
@@ -1060,7 +1079,20 @@
for (Annotation annotation : annotations) {
annotationsAsString.add(annotation.toString());
}
- String[] annotationsThatShouldExists = getJavaVersion() < 7 ? annotationsThatShouldExists_jdk6 : annotationsThatShouldExists_jdk7;
+
+ String[] annotationsThatShouldExists = null;
+ switch (getJavaVersion()) {
+ case 6:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk6;
+ break;
+ case 7:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk7;
+ break;
+ case 8:
+ annotationsThatShouldExists = annotationsThatShouldExists_jdk8;
+ break;
+ }
+
// check if all required annotations really exists
for (String annotationThatShouldExists : annotationsThatShouldExists) {
assertTrue(annotationsAsString.contains(annotationThatShouldExists),
More information about the distro-pkg-dev
mailing list