This example illustrates about how to use the 'assertTrue' assertion method to test whether the class file executed test cases successfully or not. In case of if, test case execute success for specific class then it return true but if test case not execute properly the it return false and throw a Test Failure method. In this example build.xml file is used to compile, test and run the java file. The <property name="TALK" value ="true"/> is used to search path for source files, search path for class files, parsing the jar file, loading the all required classes and checking the class file. If <property name="TALK" value ="true"/> is not used in build.xml file then the output displays only [junit] Testsuite.
Source Code of JUnitTestExample.java
Without using of <property
name="TALK" value ="true"/> the following output will
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: September 27, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles