A P P E N D I X  A

Adapting the WMA Test Emulator

This appendix describes how to adapt the emulator side of the Java Device Test Suite Wireless Messaging API (WMA) tests to your test device. This adaptation is required to run Cell Broadcast Short Message Service (CBS) tests.



Note - This appendix has nothing to do with Java Device Test Suite test development. It describes software that must be developed to run WMA CBS tests. It is included in this guide because writing this code is a developer task.


The appendix consists of these sections:


Test Types

Some of the WMA tests are network tests (see Writing Network Tests). These tests have two parts. The device part exercises WMA interfaces on the test device. The emulator part coordinates with the device-resident part, sending, receiving, and analyzing test messages as needed.

For CBS tests, the emulator part is called a CBS Server. It is called to send a valid CBS message to the test device.


Implementing CBSServer

CODE EXAMPLE A-1 shows the CBSServer interface.


CODE EXAMPLE A-1 CBSServer Interface
package com.sun.wma.api.server;
 
public interface CBSServer {
  public void send (String type, int segNum, String address);
  public void init (); 
  public void die ();
}

TABLE A-1 specifies the semantics of a CBSServer implementation.


TABLE A-1 CBSServer Implementation Guide

Method/Parameter

Description

send()

Sends a CBS message through the mobile network.

type

“gsm7“ucs2” or “binary” represent three encoding types defined by the WMA specification.

segNum

Number of message segments as defined by Appendix A of the WMA specification.

address

CBS address for the message. See Appendix B of the WMA specification for examples.

init()

CBS server initializes itself, if necessary.

die()

CBS server terminates any active operations and clean up resources.



procedure icon  Deploying the Implementation

1. Compile the implementation.

The following shows one simple way to compile. Other ways might also be valid.

% javac -d DestDir File

2. Put the compiled files into a JAR file.

For example:

% jar cvf CBSImplJar CBSImplClass

You can use more than one JAR file.

3. Use the administrator edition of the harness to create a section containing the WMA test pack.

The online help describes how to create and configure a template.

4. Connect the test device to the harness host.

The Java Device Test Suite Tester’s Guide describes how to connect test devices and how to launch and use the harness.

5. Launch a harness.

6. Open the Configuration Editor and go to the WMA section created in Step 3, and select the WMA test pack.

7. Answer the corresponding questions to set the following properties for the CBS Server of the WMA test pack in the template.

a. Set ServerImplJarLocation to the absolute path name of the JAR file or files created in Step 2.

Where the ServerImplJarLocation property value contains more than one JAR file path, the paths must be semicolon separated.

b. Set CBSServerImpl to the full class name (including package name) of the CBSServer implementation class.

8. In the harness, open the Test Server Monitor to see diagnostic messages from the WMA test emulator.

9. Click the Start button.