O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running JUnit tests along with TestNG through Ant

In the earlier section we have seen how to run JUnit through TestNG using testng XML configuration. We have also seen how to run both JUnit and TestNG tests together. But that was a simple test that we covered in the example. Consider a scenario where a project has hundreds of existing JUnit tests and the team has decided to move to TestNG for its better features. It will take a lot of time to migrate existing JUnit tests to TestNG and by that time the team has to run existing tests along with the new TestNG tests. This can be achieved by configuring TestNG to run both kinds of tests while using a build tool like Ant or Maven.

Almost all of the test frameworks use some or the other build tools to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required