how to export (JUnit) test suite as executable jar

You are correct that a main() method is needed for an executable jar.

It’s easy to add a main method to your test suite though.

public static void main(String[] args) throws Exception {                    
       JUnitCore.main(
         "com.stackoverflow.MyTestSuite");            
}

Leave a Comment