How To Run Your JUnit 4.4 Tests With A JUnit 3.8 Runner

How To Run Your JUnit 4.4 Tests With A JUnit 3.8 Runner


  • 20 Jan, 2012

    I am not sure why you have to do this. But if you want to, you can use the junit.framework.JUnit4TestAdapter class included in JUnit 4.4 JAR file. Here is sample code:import junit.framework.Test;import junit.textui.TestRunner;import junit.framework.JUnit4TestAdapter;public class JUnit3Adapter { public static void main (String[] args) { Test adaptedTest = new JUnit4TestAdapter(HelloTest.class); TestRunner.run(adaptedTest); }}Classes junit.framework.Test, junit.textui.TestRunner and junit.framework.JUnit4TestAdapter are included in the JUnit 4.4 JAR file. You don't need to include the JUnit 3.8 JAR file in your CLASSPATH.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.