how to export (JUnit) test suite as executable jar

后端 未结 1 923
清歌不尽
清歌不尽 2020-11-30 04:06

Is there a way in eclipse (Helios) to package/export my JUnit test suites (or maybe even test cases if possible) as executable jars?

I know how to generate runnable

相关标签:
1条回答
  • 2020-11-30 04:28

    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");            
    }
    
    0 讨论(0)
提交回复
热议问题