/hg/rhino-tests: Small updates in getAnnotation and getAnnotatio...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Jun 21 03:14:16 PDT 2013
changeset 91109f10e626 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=91109f10e626
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jun 21 12:17:48 2013 +0200
Small updates in getAnnotation and getAnnotations tests in SimpleBindingsClassTest.
diffstat:
ChangeLog | 5 +++
src/org/RhinoTests/SimpleBindingsClassTest.java | 36 +++++++++++++++++++++++-
2 files changed, 39 insertions(+), 2 deletions(-)
diffs (79 lines):
diff -r 005b996d98c9 -r 91109f10e626 ChangeLog
--- a/ChangeLog Thu Jun 20 11:17:20 2013 +0200
+++ b/ChangeLog Fri Jun 21 12:17:48 2013 +0200
@@ -1,3 +1,8 @@
+2013-06-21 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/SimpleBindingsClassTest.java:
+ Small updates in getAnnotation and getAnnotations tests.
+
2013-06-20 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/ScriptEngineManagerClassTest.java:
diff -r 005b996d98c9 -r 91109f10e626 src/org/RhinoTests/SimpleBindingsClassTest.java
--- a/src/org/RhinoTests/SimpleBindingsClassTest.java Thu Jun 20 11:17:20 2013 +0200
+++ b/src/org/RhinoTests/SimpleBindingsClassTest.java Fri Jun 21 12:17:48 2013 +0200
@@ -1038,6 +1038,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.simpleBindingsClass.getAnnotations();
// and transform the array into a list of annotation names
@@ -1045,7 +1048,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),
@@ -1064,6 +1080,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.simpleBindingsClass.getDeclaredAnnotations();
// and transform the array into a list of annotation names
@@ -1071,7 +1090,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