If you have something like:
/src/test/scala/com/sun/MyTest.scala with:
package com.sun.differentpackage
import __root__.org.junit.Test
class MyTest {
@Test def test() {
}
}
All the ways to run tests in Eclipse will not be able to find the test.
/src/test/scala/com/sun/MyTest.scala with:
package com.sun.differentpackage
import __root__.org.junit.Test
class MyTest {
@Test def test() {
}
}
All the ways to run tests in Eclipse will not be able to find the test.
Leave a comment
The provided example doesn't compile as it is - you are missing an import to the Test annotation. I'm fixing it.
on 2013-11-12 10:05 *
By Mirco Dotta
Description changed from If you have something like:... to If you have something like:...
on 2013-11-12 10:05 *
By Mirco Dotta
Description changed from If you have something like:... to If you have something like:...
on 2013-11-12 10:11 *
By Mirco Dotta
Further simplication, as using package `com.sun` can possibly lead to other problems. And this way we don't need the __root__ prefix in the import.
//a/MyScala.scala
package b
import org.junit.Test
class MyTest {
@Test def test() {
}
}
on 2013-11-12 10:13 *
By Mirco Dotta
I could reproduce the issue, and this doesn't work in general (not even when using the Scala JUnit Finder - http://scala-ide.org/docs/current-user-doc/features/test-finder/index.html)
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|