summaryrefslogtreecommitdiff
path: root/test/files/run/classfile-format-52.scala
diff options
context:
space:
mode:
authorJames Iry <james.iry@typesafe.com>2013-06-04 10:22:43 -0700
committerJames Iry <james.iry@typesafe.com>2013-06-04 10:22:43 -0700
commitac4e3ca19246ae3d983f99607b865c5ed3acb2b9 (patch)
tree71df59ffda407ea0e527aeec3cea38fe7edc4043 /test/files/run/classfile-format-52.scala
parentfc6da8d8b765ddc3c492d0884164561ca7a8b4d8 (diff)
downloadscala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.tar.gz
scala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.tar.bz2
scala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.zip
Refactor testing logic for only running under certain JDK versions
We had several tests designed to only run if the JDK version was at least some specified version. This commit refactors that common logic into DirectTest.
Diffstat (limited to 'test/files/run/classfile-format-52.scala')
-rw-r--r--test/files/run/classfile-format-52.scala11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/files/run/classfile-format-52.scala b/test/files/run/classfile-format-52.scala
index f0ad7c2ed6..7afa09ae0b 100644
--- a/test/files/run/classfile-format-52.scala
+++ b/test/files/run/classfile-format-52.scala
@@ -61,17 +61,14 @@ class Driver extends HasDefaultMethod {
System.setErr(System.out)
try {
// this test is only valid under JDK 1.8+
- // cheat a little by using 'ScalaVersion' because it can parse java versions just as well
- val requiredJavaVersion = ScalaVersion("1.8")
- val executingJavaVersion = ScalaVersion(System.getProperty("java.specification.version"))
- if (executingJavaVersion >= requiredJavaVersion) {
+ testUnderJavaAtLeast("1.8") {
generateInterface()
compile()
Class.forName("Driver").newInstance()
- } else {
- // under other versions just dump the expected results
+ ()
+ } otherwise {
println("hello from publicMethod")
- println("hello from staticMethod")
+ println("hello from staticMethod")
}
}
finally