org.scalatest.testng.SingleTestAnnotationTransformer.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalatest_2.9.0 Show documentation
Show all versions of scalatest_2.9.0 Show documentation
ScalaTest is a free, open-source testing toolkit for Scala and Java
programmers.
package org.scalatest.testng
import org.testng.IAnnotationTransformer
import org.testng.annotations.ITestAnnotation
import java.lang.reflect.Method
import java.lang.reflect.Constructor
// Making this private[scalatest] so that it is public to Java, to ensure the reflection thing works. But
// doesn't show up in Scaladoc, and not part of the ScalaTest API. This is part of its implementation.
// Probably might work as private[testng], but not sure and right before the release.
private[scalatest] class SingleTestAnnotationTransformer(testName: String) extends IAnnotationTransformer {
override def transform( annotation: ITestAnnotation, testClass: java.lang.Class[_], testConstructor: Constructor[_], testMethod: Method) {
if (testName.equals(testMethod.getName))
annotation.setGroups(Array("org.scalatest.testng.singlemethodrun.methodname"))
}
}