/hg/rhino-tests: Small updates in getAnnotation and getAnnotatio...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Thu Jun 20 02:13:49 PDT 2013
changeset 005b996d98c9 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=005b996d98c9
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu Jun 20 11:17:20 2013 +0200
Small updates in getAnnotation and getAnnotations tests in ScriptEngineManagerClassTest.
diffstat:
ChangeLog | 5 ++
src/org/RhinoTests/ScriptEngineManagerClassTest.java | 36 ++++++++++++++++++-
2 files changed, 39 insertions(+), 2 deletions(-)
diffs (79 lines):
diff -r 5f4e9220c8a0 -r 005b996d98c9 ChangeLog
--- a/ChangeLog Wed Jun 19 16:50:46 2013 +0200
+++ b/ChangeLog Thu Jun 20 11:17:20 2013 +0200
@@ -1,3 +1,8 @@
+2013-06-20 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/RhinoTests/ScriptEngineManagerClassTest.java:
+ Small updates in getAnnotation and getAnnotations tests.
+
2013-06-19 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/RhinoTests/SimpleBindingsClassTest.java:
diff -r 5f4e9220c8a0 -r 005b996d98c9 src/org/RhinoTests/ScriptEngineManagerClassTest.java
--- a/src/org/RhinoTests/ScriptEngineManagerClassTest.java Wed Jun 19 16:50:46 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineManagerClassTest.java Thu Jun 20 11:17:20 2013 +0200
@@ -1074,6 +1074,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.scriptEngineManagerClass.getAnnotations();
// and transform the array into a list of annotation names
@@ -1081,7 +1084,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),
@@ -1100,6 +1116,9 @@
final String[] annotationsThatShouldExists_jdk7 = {
};
+ final String[] annotationsThatShouldExists_jdk8 = {
+ };
+
// get all annotations
Annotation[] annotations = this.scriptEngineManagerClass.getDeclaredAnnotations();
// and transform the array into a list of annotation names
@@ -1107,7 +1126,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