All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalatest.testng.SingleTestAnnotationTransformer.scala Maven / Gradle / Ivy

Go to download

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

There is a newer version: 2.0.M6-SNAP4
Show newest version
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"))  
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy