63
edits
Changes
Created page with '== Your First Junit Test Case Run == First, start with the "'''Basics Hello'''" folder you checked out of the Zenit SVN repository in the previous example. [[Image:junit1.png|lef…'
== Your First Junit Test Case Run ==
First, start with the "'''Basics Hello'''" folder you checked out of the Zenit SVN repository in the previous example.
[[Image:junit1.png|left|thumb]]<br style="clear:left;" />
We want to open the '''JUnit view''' so start with '''Window'''->'''Show View'''->'''Other'''
[[Image:junit2.png|left|thumb]]<br style="clear:left;" />
Select '''Java'''->'''JUnit''' and click '''OK'''
[[Image:junit3.png|left|thumb]]<br style="clear:left;" />
Notice the JUnit view on the bottom right side of the workbench.
[[Image:junit4.png|left|thumb]]<br style="clear:left;" />
Select the '''OperationsTest.java''' program from the '''Project Explorer''' view.
[[Image:junit5.png|left|thumb]]<br style="clear:left;" />
Examine the '''testMultiply''' method in the Edit view.
[[Image:junit6.png|left|thumb]]<br style="clear:left;" />
Run the method as '''JUnit Test'''
[[Image:junit7.png|left|thumb]]<br style="clear:left;" />
Notice the failure in the '''JUnit view'''. Specifically the line "'''Result expected: <50> but was: <2>'''"
[[Image:junit8.png|left|thumb]]<br style="clear:left;" />
Now bring the '''multiply''' method into the '''Edit''' window. Notice the method ''ACTUALLY'' performs a divide instead of a multiply.
[[Image:junit9.png|left|thumb]]<br style="clear:left;" />
Correct the error and save the file.
[[Image:junit10.png|left|thumb]]<br style="clear:left;" />
Again, run '''OperationsTest''' and notice that the number of errors is now zero signified by the ''GREEN'' bar.
[[Image:junit11.png|left|thumb]]<br style="clear:left;" />
'''Congratulations!''' You've successfully run your first JUnit test case.
First, start with the "'''Basics Hello'''" folder you checked out of the Zenit SVN repository in the previous example.
[[Image:junit1.png|left|thumb]]<br style="clear:left;" />
We want to open the '''JUnit view''' so start with '''Window'''->'''Show View'''->'''Other'''
[[Image:junit2.png|left|thumb]]<br style="clear:left;" />
Select '''Java'''->'''JUnit''' and click '''OK'''
[[Image:junit3.png|left|thumb]]<br style="clear:left;" />
Notice the JUnit view on the bottom right side of the workbench.
[[Image:junit4.png|left|thumb]]<br style="clear:left;" />
Select the '''OperationsTest.java''' program from the '''Project Explorer''' view.
[[Image:junit5.png|left|thumb]]<br style="clear:left;" />
Examine the '''testMultiply''' method in the Edit view.
[[Image:junit6.png|left|thumb]]<br style="clear:left;" />
Run the method as '''JUnit Test'''
[[Image:junit7.png|left|thumb]]<br style="clear:left;" />
Notice the failure in the '''JUnit view'''. Specifically the line "'''Result expected: <50> but was: <2>'''"
[[Image:junit8.png|left|thumb]]<br style="clear:left;" />
Now bring the '''multiply''' method into the '''Edit''' window. Notice the method ''ACTUALLY'' performs a divide instead of a multiply.
[[Image:junit9.png|left|thumb]]<br style="clear:left;" />
Correct the error and save the file.
[[Image:junit10.png|left|thumb]]<br style="clear:left;" />
Again, run '''OperationsTest''' and notice that the number of errors is now zero signified by the ''GREEN'' bar.
[[Image:junit11.png|left|thumb]]<br style="clear:left;" />
'''Congratulations!''' You've successfully run your first JUnit test case.