com.github.peterwippermann.junit4.parameterizedsuite.util.SuiteUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parameterized-suite Show documentation
Show all versions of parameterized-suite Show documentation
JUnit 4 provides the commonly known Runners "Suite" and "Parameterized". However, as of today there is no Runner implementation that combines the features of both. This library provides a custom Runner for this purpose.
package com.github.peterwippermann.junit4.parameterizedsuite.util;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import org.junit.runners.model.InitializationError;
/**
* A collection of useful methods extracted and duplicated from {@link Suite}.
*
* Code is under the license of JUnit: http://junit.org/junit4/license.html
*
*
* Please see the package info of {@link com.github.peterwippermann.junit4.parameterizedsuite.util} for more details.
*/
public class SuiteUtil {
/**
* @see Suite#getAnnotatedClasses()
*/
public static Class>[] getSuiteClasses(Class> klass) throws InitializationError {
SuiteClasses annotation = klass.getAnnotation(SuiteClasses.class);
if (annotation == null) {
throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName()));
}
return annotation.value();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy