A customized component test script has been created for you. This test will be used to test the methods of the PhoneNumber class - in particular, the method removeDigit().
To customize the test script:
From the Window menu, select Close All.
Select the Project Browser tab on the right-hand side of the screen, select the TestPhoneNumber.java node (child of the PhoneNumber Java component testing node), and then select the menu item Edit->Delete.
Right-click the PhoneNumber Java component testing node and select Add Child->Files...
Browse to the Test RealTimePurifyPlus RealTimePurifyPlus for Linux installation folder and Open the file \examples\BaseStation_Java\test\TestPhoneNumber.java.
Select the PhoneNumber test node and click the Settings button.
In the Configuration Settings dialog box, select Build and Compiler.
Select the Class Path setting, and click the "..." button.
Click the Add Directories button and add both \examples\BaseStation_Java\test and \examples\BaseStation_Java\src to the Class Path.
Now, select the \examples\BaseStation_Java\test\PhoneNumber Class Path entry, and click the Delete button to remove it from the Class Path.
Click OK and close the Configuration Settings box.
Double-click the node TestPhoneNumber.java.
Maximize the test script window.
Scroll down the text editor until you can see the test methods for addDigit(), removeDigit() and cleanNumber().
The tests should be very straightforward. The isEmpty() method is frequently used as an assertion check while the verifyEquals() method - inherited from JUnit - is used to ensure values are properly stored. Inherently, by calling the removeDigit() method via the testRemoveDigit() test method, code coverage on this method will be increased.
You are now ready to test - but first, take a quick look at the test driver.