summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/nowarnDefaultJunitMethods.check6
-rw-r--r--test/files/neg/nowarnDefaultJunitMethods.flags1
-rw-r--r--test/files/neg/nowarnDefaultJunitMethods/C_1.scala5
-rw-r--r--test/files/neg/nowarnDefaultJunitMethods/Test.java3
-rw-r--r--test/files/run/junitForwarders/C_1.scala15
-rw-r--r--test/files/run/junitForwarders/Test.java10
6 files changed, 25 insertions, 15 deletions
diff --git a/test/files/neg/nowarnDefaultJunitMethods.check b/test/files/neg/nowarnDefaultJunitMethods.check
deleted file mode 100644
index 7efdcc299a..0000000000
--- a/test/files/neg/nowarnDefaultJunitMethods.check
+++ /dev/null
@@ -1,6 +0,0 @@
-C_1.scala:2: warning: JUnit tests in traits that are compiled as default methods are not executed by JUnit 4. JUnit 5 will fix this issue.
- @org.junit.Test def foo = 0
- ^
-error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
-one error found
diff --git a/test/files/neg/nowarnDefaultJunitMethods.flags b/test/files/neg/nowarnDefaultJunitMethods.flags
deleted file mode 100644
index 85d8eb2ba2..0000000000
--- a/test/files/neg/nowarnDefaultJunitMethods.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfatal-warnings
diff --git a/test/files/neg/nowarnDefaultJunitMethods/C_1.scala b/test/files/neg/nowarnDefaultJunitMethods/C_1.scala
deleted file mode 100644
index e2565a48bc..0000000000
--- a/test/files/neg/nowarnDefaultJunitMethods/C_1.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-trait T {
- @org.junit.Test def foo = 0
-}
-
-class C extends T
diff --git a/test/files/neg/nowarnDefaultJunitMethods/Test.java b/test/files/neg/nowarnDefaultJunitMethods/Test.java
deleted file mode 100644
index e8d64c2cc8..0000000000
--- a/test/files/neg/nowarnDefaultJunitMethods/Test.java
+++ /dev/null
@@ -1,3 +0,0 @@
-package org.junit;
-
-public @interface Test { }
diff --git a/test/files/run/junitForwarders/C_1.scala b/test/files/run/junitForwarders/C_1.scala
new file mode 100644
index 0000000000..2af2026a61
--- /dev/null
+++ b/test/files/run/junitForwarders/C_1.scala
@@ -0,0 +1,15 @@
+trait T {
+ @org.junit.Test def foo = 0
+}
+
+class C extends T
+
+object Test extends App {
+ def check(c: Class[_], e: String) = {
+ val s = c.getDeclaredMethods.sortBy(_.getName).map(m => s"${m.getName} - ${m.getDeclaredAnnotations.mkString(", ")}").mkString(";")
+ assert(s == e, s"found: $s\nexpected: $e")
+ }
+ check(classOf[C], "foo - @org.junit.Test()")
+ // TODO scala-dev#213: should `foo$` really carry the @Test annotation?
+ check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - @org.junit.Test()")
+}
diff --git a/test/files/run/junitForwarders/Test.java b/test/files/run/junitForwarders/Test.java
new file mode 100644
index 0000000000..57c4d5b544
--- /dev/null
+++ b/test/files/run/junitForwarders/Test.java
@@ -0,0 +1,10 @@
+package org.junit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface Test { }