Abstract class whose subclasses can be passed to FunSuite
and Spec
test
registration methods to place tests into groups. For example, if you define:
object SlowTest extends Group("SlowTest")
then you can place a test into the SlowTest
group like this:
import org.scalatest.FunSuite
class MySuite extends FunSuite {
test("my test", SlowTest) {
Thread.sleep(1000)
}
}
or
import org.scalatest.Spec
class MySpec extends Spec {
it("should sleep for a second", SlowTest) {
Thread.sleep(1000)
}
}
If you have created Java annotation interfaces for use as group names in direct subclasses of org.scalatest.Suite
,
then you will probably want to use group names on your FunSuite
s that match. To do so, simply
pass the fully qualified names of the Java interfaces to the Group
constructor. For example, if you've
defined a Java annotation interface with fully qualified name, com.mycompany.groups.SlowTest
, then you could
create a matching group for FunSuite
s like this:
object SlowTest extends Group("com.mycompany.groups.SlowTest")