Unit Testing


To test the Chat Room application:

  1. Download and install the free implementation of the 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. 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; 
  4. Copy the LoginGUI.java, MainGUI.java, ChatRoom.java, RoomInformation.java, GroupChat.java, and SocketOpener.java files to a folder on your computer. Use the cd command at the command prompt to move to the folder in which you have copied the Java files. Compile the files by using the following javac command, as shown:

      javac *.java 
  5. To run the Chat Room application, specify the following command at the command prompt:

     java LoginGUI 
  6. The Login window of the Chat Room application appears. Specify the login information, as shown in Figure 3-8:

    click to expand: this figure shows the login information specified by the end user.
    Figure 3-8: Specifying Login Information

  7. Click the Submit button to send the login information to the Jabber server for registered end users or open a new account in the Jabber server for unregistered end users.

  8. The user interface of the Chat Room application appears. Select File-> Go to Chat Room to specify the name of the chat room to join.

  9. Enter the name of the chat room and the user name to join the chat room, as shown in Figure 3-9:

    this figure shows the name of the chat room and user name specified by an end user.
    Figure 3-9: Entering a Chat Room

  10. Click the Submit button to open the Group Chat window of the specified chat room, as shown in Figure 3-10:

    this figure shows the group chat window of the movie chat room.
    Figure 3-10: The Group Chat Window of the Specified Chat Room

  11. To create a chat room, select File-> Create New Chat Room from the user interface of the Chat Room application.

  12. Enter the name of the chat room and the user name, as shown in Figure 3-11:

    this figure shows the chat room application window that shows the room name specifed by an end user to create a new chat room.
    Figure 3-11: Entering Chat Room Name and User Name

  13. Click the Submit button to create a new chat room and open the Group Chat window of the new chat room, as shown in Figure 3-12:

    this figure shows the group chat window showing the list of end users currently logged in to the created chat room.
    Figure 3-12: The Group Chat Window of the New Chat Room

  14. Type the required message in the chat window and click the Send button to send the message to all end users logged in to the chat room, as shown in Figure 3-13:

    click to expand: this figure shows the text message in the text area of the group chat window.
    Figure 3-13: Sending a Message

  15. To initiate a group chat, select any chat room from the Existing Rooms tree structure of the Chat Room application, as shown in Figure 3-14:

    this figure shows the selected chat room to initiate a group chat.
    Figure 3-14: Selecting an Existing Room

    The Input Dialog box appears to specify the user name for the selected chat room, as shown in Figure 3-15:

    this figure shows the dialog box to specify the user name to enter in the selected chat room.
    Figure 3-15: The Input Dialog Box

  16. Enter the user name and click the OK button. The Group Chat window for the selected room appears, as shown in Figure 3-16:

    click to expand: this figure shows a list of end users in the regional chat room. end users can type in the messages to chat with all other end users logged in to the selected chat room.
    Figure 3-16: The Group Chat Window of the Selected 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