java - How to automatically create a list for @SuiteClasses -


i need possibility run subset of junit tests cases during maven build process. i've decided use junit categories purposes. i've created 2 marker interfaces: unittest , integrationtest , assigned them bunch of junit test cases. need create test suite them:

package ru.hive.parser;  import org.junit.experimental.categories.categories; import org.junit.experimental.categories.categories.includecategory; import org.junit.runner.runwith; import org.junit.runners.suite.suiteclasses;  import ru.hive.test.unittest;  @runwith(categories.class) @includecategory(unittest.class) @suiteclasses({ someclass.class }) public class parsertestsuite {  } 

the problem @suiteclasses annotation in need list classes want in test suite , have lot (more 100) of such classes , number growing. nice if have way build list of classes automatically. i've read question here on stackoverflow sort similar own, none of answers fit needs since need use @runwith(categories.class) instead of other test runners. ideas how realize this?

maven able use categories runner. see here: http://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html

you use classpath suite , modify use categories runner tests found on classpath (if doesn't already?).

generating long list of @suiteclasses doesn't seem worth effort.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -