This document is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License
  Previous Contents Index Next
Appendix B

Detailed Examples

The following examples are provided to assist the user in setting up tests to run in specific testing environments. Before using these examples, you must modify them for your specific testing environment.

B.1 Running JCK Tests Using Multiple VMs

The following procedures demonstrate how to set up and run JCK 6b tests for the following test environments and configurations:

Run JCK Runtime Tests Locally on a Windows System

  1. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  2. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar c:\jck\sampleJCK-runtime-6b\lib\javatest.jar
    

    In the example, the harness is started from the root directory of the c: drive. The javatest.jar file is located on the c: drive in the jck\sampleJCK-runtime-6b\lib directory. Change these values for your specific installation.


    Note - The default RI PermGen values can be not large enough to perform a complete JCK run. 64-bit platforms require 256m permanent generation memory, whereas 32-bit platforms require 128m permanent generation memory. Include the appropriate options in the command to run tests for your test platform.


  3. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you intend to run.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness automatically begins the test run.

    6. Click the Finish button.
  4. Create a configuration for the test run.

    Each interview contains the following three major sections:

    • The first section of each interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from the More Information table below.

      2. Answer the remaining interview questions with settings required for your test system.

  5. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

More Information
Interview Responses for Runtime Test Run Locally on a Windows System Using Multiple VMs

Interview Question

Answer

Test Execution Mode — Select the test execution mode

MultiJVM

Testing Locally - Are you running these tests on the same system used for this interview?

Yes

Run JCK Runtime Tests Locally on a Solaris System

  1. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  2. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar /jck6b/sampleJCK-runtime-6b/lib/javatest.jar
    

    In the example, the harness is started from the root directory. The javatest.jar file is located in the jck6b/sampleJCK-runtime-6b/lib directory. Change these values for your specific installation.

  3. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you intend to run.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness automatically begins the test run.

    6. Click the Finish button.
  4. Create a configuration for the test run.

    Each configuration interview contains the following three major sections:

    • The first section of each interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from the More Information table below.

      2. Answer the remaining interview questions with settings required for your test system.

  5. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

More Information
Interview Responses for Runtime Test Run Locally on a Solaris System Using Multiple VMs

Interview Question

Answer

Test Execution Mode — Select the test execution mode

MultiJVM

Testing Locally - Are you running these tests on the same system used for this interview?

Yes

Run JCK Runtime Tests Remotely on a Windows System

  1. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  2. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    c:\>java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    c:\>java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar c:\jck\sampleJCK-runtime-6b\lib\javatest.jar
    

    In the example, the harness is started from the root directory of the c: drive. The javatest.jar file is located on the c: drive in the jck\sampleJCK-runtime-6b\lib directory. Change these values for your specific installation.

  3. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you you intend to run.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness will automatically begin the test run.

    6. Click the Finish button.
  4. Create a configuration for the test run.

    The JCK interview contains the following three major sections:

    • The first section of each interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from the More Information.

      2. Answer the remaining interview questions with settings required for your test system.

  5. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

More Information
Interview Responses for Runtime Test Run Remotely on a Windows System Using Multiple VMs

Interview Question

Answer

Test Execution Mode — Select the test execution mode

MultiJVM

Testing Locally — Are you running these tests on the same system used for this interview?

No

Test Platform — Which operating system is used on the test platform?

The appropriate Windows version

Run JCK Runtime Tests Remotely on a Solaris System

  1. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  2. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar /jck6b/sampleJCK-runtime-6b/lib/javatest.jar
    

    In the example, the harness is started from the root directory. The javatest.jar file is located in the jck6b/sampleJCK-runtime-6b/lib directory. Change these values for your specific installation.

  3. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you intend to run.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness automatically begins the test run.

    6. Click the Finish button.
  4. Create a configuration for the test run.

    The JCK interview contains the following three major sections:

    • The first section of the JCK interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from More Information.

      2. Answer the remaining interview questions with settings required for your test system.

  5. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

More Information
Interview Responses for Runtime Test Run Remotely on a Solaris System Using Multiple VMs

Interview Question

Answer

Test Execution Mode — Select the test execution mode

MultiJVM

Testing Locally — Are you running these tests on the same system used for this interview?

No

Test Platform — Which operating system is used on the test platform?

Solaris

B.2 Using a Browser to Run JCK Tests in a Single VM

The following procedures demonstrate how to set up and run JCK 6b tests with a browser (Netscape Navigator and JavaPlug-In software) and an agent for the following test environments and configurations:

Using a Single VM and an Active Agent to Run Tests on a Solaris System

  1. Construct the applet code to launch the agent.

    In the following example, create a file named agentApplet.html to contain the applet code. Example B-1 contains the applet code to launch an active agent. Refer to the JavaTest Agent User's Guide or the JavaTest harness online help for detailed instructions about creating and using map files, creating and using agent applets, and for starting the JavaTest agent.


    Note - Some browser implementations support the archive tag. The archive tag supports multiple files. You must point to both the javatest.jar as well as the JCK classes. If your implementation only supports the codebase tag, you must unpack the javatest.jar into the same location as the JCK classes since the codebase tag only supports one single entry (codebase).


  2. Start the agent applet by pointing your implementation at the agentApplet.html file on your web server.

    Note - If you receive test execution errors, such as Class not found, you might be required to launch your browser implementation with a form of the verify switch.


  3. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  4. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    java -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m -jar /jck6b/sampleJCK-runtime-6b/lib/javatest.jar
    

    In the example, the harness is started from the root directory. The javatest.jar file is located in the jck6b/sampleJCK-runtime-6b/lib directory. Change these values for your specific installation.

  5. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you you intend to run.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness automatically begins the test run.

    6. Click the Finish button.
  6. Create a configuration for the test run.

    Each configuration interview contains the following three major sections:

    • The first section of each interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from the More Information table below.

      2. Answer the remaining interview questions with settings required for your test system.

  7. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

Example B-1 Applet Code to Launch an Active JavaTest Agent
<applet
code="com.sun.javatest.agent.AgentApplet"
code="http://[INSERT-PATH-TO-JCK]/classes"
width=600
height=400>
<param name=mode value=active>
</applet>
More Information
Interview Responses for Runtime Test Run on a Solaris System Using Single VM

Interview Question

Answer

Test Execution Mode — Select the test execution mode

SingleJVM

Test Platform File Separator — Which file separator character is used on the test platform?

/

Test Platform Path Separator — Which path separator character is used on the test platform?

:

Agent Type — You can run the JavaTest Agent in one of two modes: active or passive. Which mode do you wish to use?

active

Using a Single VM and an Agent to Run Tests on a Windows System

  1. Create a map file that translates host specific values into values that the agent can use.

    Some tests require contextual information, such as the host name on which they are executed, before they can run. Because network file systems might be mounted differently on different systems, the path names used by the JavaTest harness might not be the same for the agent. The agent uses a map file to translate these strings into values it can use to run tests. Use a map file to map the work directory file syntax between systems. The map file is accessed by the agent. It might be networked or it might reside on the agent machine itself.

    1. Use a text editor to open a simple ASCII file and enter the following types of lines:
      1. Comment line - Begins with the pound sign (#) and provides information that is not processed by the agent. Comment lines are optional.

        Example:

        #Replace all /home/jjg with /jjg
        
      2. Translation line - Contains the target and substitution strings. Enter the string that is to be replaced followed by one or more spaces and the replacement string. The agent replaces all occurrences of the first string with the second.

        Example:

        /home/jjg /jjg
        

        Because the agent uses the map file to perform global string substitution on all matching values received from the JavaTest harness, you must be as specific as possible when specifying strings in a translation line.

    2. Save the map file using a name that is easily identifiable (such as mapfile.txt).

      The mapping order (from left to right) in the map file is JavaTest harness to agent.

      Example of a map file:

      #This is a sample map file
      #Replaces all /home/jjg with /jjg
      /home/jjg /jjg
      #Replaces all /home/kasmith/JavaTestharness with
      #/kas/JavaTestharness
      /home/kasmith/JavaTestharness /kas/JavaTestharness 
      
  2. Construct the applet code to launch the agent.

    In the following example, create a file named agentApplet.htmlto contain the applet code. Example B-2 contains the applet code required to launch a passive agent. Example B-3 contains the applet code required to launch an active agent. Refer to the JavaTest Agent User's Guide or the JavaTest harness online help for detailed instructions about creating and using agent applets, and for starting the JavaTest agent.


    Note - Some browser implementations support the archive tag. The archive tag supports multiple files. You must point to both javatest.jar as well as the JCK classes. If your implementation only supports the codebase tag, you must unpack the javatest.jar into the same location as the JCK classes because the codebase tag only supports one single entry (codebase).


  3. Start the agent applet by pointing your implementation at the .html file on your web server.
  4. Define PATH for launching the JavaTest harness.

    PATH must point to a reference JRE software VM.

  5. Complete all required special test setup steps.

    See 4.5 Special Setup Instructions.

  6. Start the JavaTest harness.

    When starting the harness, you must allocate additional memory for opening the JCK test suite. Use the following command to start the harness from the directory where the javatest.jar file is located:

    c:\>java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar javatest.jar
    

    Note - When allocating memory to the VM, do not exceed the actual amount of memory available on your system.


    If you start the harness from a directory that does not contain the javatest.jar file, you must include its path in the command. For example:

    c:\>java -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -jar c:\jck\sampleJCK-runtime-6b\lib\javatest.jar
    

    In the example, the harness is started from the root directory of the c: drive. The javatest.jar file is located on the c: drive in the jck\sampleJCK-runtime-60\lib directory. Change these values for your specific installation.

  7. Use the Quick Start wizard to specify the test suite, work directory, and configuration loaded in the Test Manager window.

    Note - If the harness opens the GUI without displaying the Quick Start wizard, launch the Quick Start wizard by choosing File -> Open Quick Start Wizard from the menu bar.


    1. When the Quick Start wizard opens, click the Start a new test run radio button and the Next button.
    2. Click the Create a new configuration radio button and the Next button.

      If your group does not use configuration templates, you must use an empty JCK interview to create a configuration for the test run.

      If your group uses configuration templates, you can load a template in the Quick Start wizard and use it to create the configuration used for the test run.

    3. In the Test Suite pane, choose the test suite that contains the tests that you you intend to.

      Use the sampleJCK-runtime-6b test suite for this example.

    4. In the Work Directory pane, create a work directory for the test suite.

      The work directory contains all of the information collected by the JavaTest harness during the test run of this test suite and configuration combination.

    5. Select the Start the Configuration Editor checkbox and the Start test run checkbox.

      The Quick Start wizard automatically opens the Configuration Editor for you when it closes. When you complete the configuration and close the Configuration Editor, the harness automatically begins the test run.

    6. Click the Finish button.
  8. Create a configuration for the test run.

    Each configuration interview contains the following three major sections:

    • The first section of each interview contains a series of sub-interviews that collect the information required to configure a test environment.

    • The second section of the interview collects information about the tests from the JCK 6b test suite that is to be run.

    • The last section of the interview collects information about how the tests are run (such as keywords and the exclude list) and contains JCK 6b specific information and values.

      1. In the first section of the interview, provide the answers from the More Information table below.

      2. Answer the remaining interview questions with settings required for your test system.

  9. Click the Done button.

    Because you selected the Start test run checkbox in the Quick Start wizard, the test run begins automatically when the Configuration Editor closes.

Example B-2 Applet Code to Launch a Passive JavaTest Agent
<applet
code=com.sun.javatest.agent.AgentApplet
codebase=url-to-jck-root/classes
archive=url-to-jck-root/lib/javatest.jar
width=600
height=600>
param name=mode value=passive> 
<param name=map value=mapfile.txt>
</applet>
Example B-3 Applet Code to Launch an Active JavaTest Agent
<applet
code=com.sun.javatest.agent.AgentApplet
codebase=url-to-jck-root/classes
archive=url-to-jck-root/lib/javatest.jar
width=600
height=600>
<param name=mode value=active> 
<param name=map value=mapfile.txt>
<param name=activeHost value=[name-of-javatest-machine]>
<param name=activePort value=[javatest-agentpool-port]>
</applet>
More Information
Interview Responses for Runtime Test Run on a Windows System Using Single VM

Interview Question

Answer

Test Execution Mode — Select the test execution mode

SingleJVM

Test Platform File Separator — Which file separator character is used on the test platform?

\

Test Platform Path Separator — Which path separator character is used on the test platform?

;

Agent Type — You can run the JavaTest Agent in one of two modes: active or passive. Which mode do you wish to use?

active

Previous Contents Index Next
Company Info Contact Terms of Use Privacy Copyright 1994-2008 Sun Microsystems, Inc.