পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Saturday, January 14, 2017

Ant - JUnit Integration

JUnit is the commonly used unit testing framework for Java-based developments. It is easy to use and easy to extend. There are a number of JUnit extensions available. If you are unfamiliar with JUnit, you should download it from www.junit.org and read its manual.

This chapter shows how to execute JUnit tests using Ant. Ant makes it straight forward through the JUnit task.
The attributes of the JUnit task are presented below:
Properties Description
dir Where to invoke the VM from. This is ignored when fork is disabled.
jvm Command used to invoke the JVM. This is ignored when fork is disabled.
fork Runs the test in a separate JVM
errorproperty The name of the property to set if there is a JUnit error
failureproperty The name of the property to set if there is a JUnit failure
haltonerror Stops execution when a test error occurs
haltonfailure Stops execution when a failure occurs
printsummary Advises Ant to display simple statistics for each test
showoutput Advises Ant to send the output to its logs and formatters
tempdir Path to the temporary file that Ant will use
timeout Exits the tests that take longer to run than this setting (in milliseconds).
Let us continue the theme of the Hello World Fax web application and add a JUnit target.
The following example shows a simple JUnit test execution:
<target name="unittest">
   <junit haltonfailure="true" printsummary="true">
      <test name="com.tutorialspoint.UtilsTest"/>
   </junit>
</target>
This example shows the execution of JUnit on the com.tutorialspoint.UtilsTest junit class. Running the above code produces the following output:
test:
[echo] Testing the application
[junit] Running com.tutorialspoint.UtilsTest
[junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 16.2 sec
BUILD PASSED

No comments:

Post a Comment