Unit Testing


To test the Connector application:

  1. Download and install the free implementation of Jabber Server from the following URL:

    http://www.jabberstudio.org/projects/ejabberd/releases/view.php?id=610

  2. 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; 
  3. Copy the JabberClient.java, ChatRoom.java, MessageClass.java, SignUp.java, User Login.java, and SocketClass.java files to a folder on your computer. Use the cd command at the command prompt to move to the folder where you have copied the Java files. Compile the files by using the following javac command, as shown:

      javac *.java 
  4. To run the Connector application, specify the following command at the command prompt:

     java JabberClient 
  5. The user interface of the Connector application appears. Select File-> Signup to sign up for a new account in the Connector application. The Sign Up window appears.

  6. Fill up the fields of the Sign Up window, as shown in Figure 2-10:

    this figure shows the fields filled by the end user.
    Figure 2-10: Specifying Information in the Sign Up Window

  7. Click OK to generate the XML message.

  8. Click Submit to create a new account in the Jabber server. The Jabber server returns a confirmation response, as shown in Figure 2-11:

    click to expand: this figure shows the xml tags in the client request and server response text areas for the sign up confirmation. the client request text area shows the request to create a new account and the server response text area shows the xml stream after successfully creating a new account in the jabber server.
    Figure 2-11: The Signup Confirmation

  9. Select File-> Login to log on to the Connector application as an existing user. The Login window appears.

  10. Fill up the login information, as shown in Figure 2-12:

    this figure shows the login information specified by the end user.
    Figure 2-12: Specifying Information in the Login Window

  11. Click the Submit button. The confirmation XML message appears, as shown in Figure 2-13:

    click to expand: this figure shows the xml tags in the client request and server response text areas for the login confirmation message.
    Figure 2-13: The Login Confirmation Message

    The Client Request text area shows the request for logging on to the Jabber server in the form of an XML stream and the Server Response text area shows the XML stream after successfully logging on to the Jabber server

  12. Select File-> Logoff and click the Submit button to log off from the Connector application. The Logoff confirmation XML message appears.

  13. Select File-> Unsubscribe and click the Submit button to unsubscribe from the Jabber server. The Unsubscribe confirmation XML message appears.

  14. Select File-> Send Message to send a message to another end user connected to the Jabber server. The Send Message window appears.

  15. Specify the text for the message in the Send Message window, as shown in Figure 2-14:

    click to expand: this figure shows the fields specified by the end user to send the message.
    Figure 2-14: Specifying the Message Text

  16. Click the Submit button. The confirmation message appears, as shown in Figure 2-15:

    click to expand: this figure shows the xml tags in the client request and server response text areas for the message sent confirmation.
    Figure 2-15: Message Confirmation

    The Client Request text area shows the request, which includes a text message and the Server Response text area shows the XML stream after successfully sending the message to the Jabber server

  17. Select File-> Enter Chat Room to enter a particular chat room.

  18. Fill the name of the chat room in the Enter Chat Room window, as shown in Figure 2-16:

    this figure shows the name of the chat room specified by the end user.
    Figure 2-16: Specifying the Chat Room Name

  19. Click the Submit button. The confirmation message appears, as shown in Figure 2-17:

    click to expand: this figure shows the xml tags in the client request and server response text areas for the chat room entered confirmation.
    Figure 2-17: Enter Chat Room Confirmation

    The Client Request text area shows the request to enter the chat room specified by an end user and the Server Response text area shows the XML stream after successfully entering the chat room.




Developing Applications Using Jabber
Developing Applications Using Jabber
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 68

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