Unit Testing


To test the Modem Dialer application:

  1. Download the Javacomm20-win32 JCA, which is available in zip format. The JCA is available at:

    http://java.sun.com/products/javacomm/downloads/index.html

  2. Unzip the zip file downloaded from the above URL.

  3. Copy win32com.dll from the unzipped file to the jre\bin directory where Java2 Software Development Kit (J2SDK) is installed.

  4. Copy comm.jar from the unzipped file to the jre\lib\ext directory where J2SDK is installed.

  5. Copy javax.comm.properties from the unzipped file to the jre\lib directory where J2SDK is installed.

  6. Set the path of the bin directory of J2SDK by executing the following command at the command prompt:

     set path=%path%;D:\j2sdk1.4.0_02\bin; 
  7. Set the classpath of the lib directory of J2SDK by executing the following command at the command prompt:

     set classpath = %classpath%;d:\j2sdk1.4.0_02\lib; d:\j2sdk1.4.0_02\jre\lib\ext\comm.jar; 

  8. Copy the PortModem.java and PortChooser.java files to a folder on your computer. Use the cd command at the command prompt to move to that folder. Compile the files using the javac command, as follows:

     javac *.java 
  9. Run the Modem Dialer application using the following command at the command prompt:

     java PortModem 
  10. Click the Browse button in the Modem Dialer window. The user interface of the PortChooser.java file opens, as shown in Figure 3-3.

  11. Select the port to which the modem is connected and click the OK button. This opens the port selected by the end user to make the phone call.

  12. Specify the phone number to which the call is to be made in the Phone Number text box. Figure 3-4 shows the user interface of the Modem Dialer application with the specified port and phone number:

    click to expand: this figure shows the port number and the phone number specified by the end user to make a phone call.
    Figure 3-4: Making a Phone Call

  13. Click the Dial button. This makes a call to the number specified in the Phone Number text box.

  14. Click the Cancel button to end the call.

  15. Click the Close button to terminate the Modem Dialer application.




Developing Applications Using JCA
Developing Applications Using JCA
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 43

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net