*/
@BeforeClass(alwaysRun = true)
public void createTestRunners() {
for (Method method : ReflectionUtils.getAllDeclaredMethods(this.getClass())) {
if (method.getAnnotation(CitrusXmlTest.class) != null) {
CitrusXmlTest citrusTestAnnotation = method.getAnnotation(CitrusXmlTest.class);
String[] testNames = new String[] {};
if (citrusTestAnnotation.name().length > 0) {
testNames = citrusTestAnnotation.name();
} else if (citrusTestAnnotation.packageScan().length == 0) {
// only use default method name as test in case no package scan is set
testNames = new String[] { method.getName() };
}
String testPackage;
if (StringUtils.hasText(citrusTestAnnotation.packageName())) {
testPackage = citrusTestAnnotation.packageName();
} else {
testPackage = method.getDeclaringClass().getPackage().getName();
}
List<TestRunner> methodTestRunners = new ArrayList<TestRunner>();
testRunners.put(method.getName(), methodTestRunners);
for (String testName : testNames) {
methodTestRunners.add(createTestRunner(testName, testPackage));
}
String[] testPackages = citrusTestAnnotation.packageScan();
for (String packageName : testPackages) {
try {
Resource[] fileResources = new PathMatchingResourcePatternResolver().getResources(packageName.replace('.', '/') + "/**/*Test.xml");
for (Resource fileResource : fileResources) {