Sun Microsystems 1.2 - Manuals
Sun Microsystems 1.2 – Manual in PDF format online.
Manuals:
Manual Sun Microsystems 1.2
Summary
Please Recycle Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. Test suite developer’s guide for the Java ME TCK Framework. THIS PRODUCT CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF SUN MICROSYSTEMS, INC. USE, DISCLOSURE...
iii Contents Preface xv 1. Introduction 1 Getting Started 1 Development Environment 3 Use of the Framework 3 Target Environment 3 Connectivity Requirements 4 Resource Limitations 5 Framework Bundle 6 Framework Components 6 Framework Components on the Harness Side 7 Framework Components on the Device...
iv Java ME TCK Framework Developer’s Guide • July 2007 Writing an Automated Test 15 ▼ To Create a Simple Automated Test 16 Building an Updated Simple Test Suite 19 ▼ To Build an Updated Test Suite 19 Testing an Updated Simple Test Suite 20 ▼ To Test an Updated Test Suite 20 3. Test Suite Constructio...
Contents v remote Attribute 44 remoteSource Attribute 45 executeArgs Attribute 45 Distributed Test Execution 46 Testing User Interfaces With Interactive Tests 48 Client Test Component 49 Remote Test Component 49 Test Description for Interactive Tests 49 Required Interactive Test Keywords 50 Interact...
vi Java ME TCK Framework Developer’s Guide • July 2007 Marking Trusted Tests 62 Using an Attribute to Mark Double-Duty Tests 63 Granting or Denying Security Permissions 64 Granting Security Permissions 64 Denying Security Permissions 66 Adding Resource Files in Tests 67 Enabling Test Selection 70 Fa...
Contents vii CommServers 85 Messaging 85 Test Export Support Libraries 85 CDC Agents 85 src Directory 86 Framework Server Classes and Interfaces 86 Agent Classes 87 Digital Signer 87 Preverification Script 87 Java ME Technology Version of Harness Classes 87 Basic Interview Classes Containing General...
ix Figures FIGURE 1-1 Framework Configuration for Standard Automated Tests 10 FIGURE 1-2 Framework Configuration for Distributed Tests 11 FIGURE 1-3 Framework Configuration for Interactive Tests 13 FIGURE 1-4 Framework Configuration for OTA Tests 14 FIGURE 4-1 Automated Test Execution 42 FIGURE 4-2 ...
xi Tables TABLE 1-1 Configurations and Supported Test Types 8 TABLE C-1 Framework Test Description Fields 92 TABLE C-2 Framework Keywords 94
xiii Code Examples CODE EXAMPLE 3-1 Simple Test Suite testsuite.jtt File 24 CODE EXAMPLE 3-2 Simple Test Class 26 CODE EXAMPLE 4-1 Required Distributed Test Keyword 44 CODE EXAMPLE 4-2 remote Attribute 45 CODE EXAMPLE 4-3 remoteSource Attribute 45 CODE EXAMPLE 4-4 executeArgs Attribute With Multiple...
xv Preface This guide describes how to use resources from the Java™ Platform, Micro EditionTechnology Configuration Kit Framework (Framework) to develop and configuretest suites and tests for Java Platform, Micro Edition (Java ME platform)technologies. Before You Read This Book To fully use the info...
xvi Java ME TCK Framework Developer’s Guide • July 2007 ■ JavaTest Harness User’s Guide: Graphical User Interface This guide provides a description of using the harness Graphical-User Interface(GUI). This guide is available from the Java ME Technology APIs and Docs website at http://java.sun.com/jav...
Preface xvii Platform Commands This document does not contain information about basic platform commands andprocedures such as shutting down the system, booting the system, and configuringdevices. Refer to the following for this information: ■ Software documentation that you received with your system...
xviii Java ME TCK Framework Developer’s Guide • July 2007 Typographic Conventions This guide uses the following typographic conventions: Related Documentation When installed, the Framework includes a doc directory that contains bothFramework and harness documentation in PDF and HTML format. The foll...
Preface xix Accessing Sun Documentation Online The Java Developer Connection™ program web site enables you to access Javaplatform technical documentation at http://java.sun.com/ . Sun Welcomes Your Comments We are interested in improving our documentation and welcome your commentsand suggestions. Pr...
1 C H A P T E R 1 Introduction This chapter introduces using the Framework resources to develop test suites for theJava ME platform, including descriptions of the kinds of tests that a test suite caninclude. This chapter contains the following sections: ■ Getting Started ■ Use of the Framework ■ Fra...
2 Java ME TCK Framework Developer’s Guide • July 2007 Note – The TCK Project Planning Guide and the Java Technology Test Suite Development Guide documents were originally developed as part of a product used by the Java Community Process (JCP) Specification Leads. For that reason, these documentsrefe...
Chapter 1 Introduction 3 Development Environment The following tools and resources are the minimum software requirements for theFramework development environment: ■ JDK, version 5.0 or later ■ JavaTest harness, version 3.2.2 or later For TCK development, download the latest Java Compatibility Test T...
4 Java ME TCK Framework Developer’s Guide • July 2007 Configuration (CDC) and a profile such as Mobile Information Device Profile(MIDP), Foundation Profile (FP), Personal Basis Profile (PBP), or Personal Profile(PP). ■ Configuration - CLDC and CDC are configurations that provides a basic set of libr...
Chapter 1 Introduction 5 Resource Limitations Hardware resources on test devices are often limited. Resource constrained devicescan quit operation when excess native resources are requested. The Framework canrun tests on resource constrained target devices with limited available memory andpersistent...
6 Java ME TCK Framework Developer’s Guide • July 2007 Framework Bundle The Framework resources are packaged and provided to users as a zip bundle.When the bundle is unzipped the following directories and files are placed in theFramework root directory: ■ doc - Contains the Java ME TCK Framework Deve...
Chapter 1 Introduction 7 Framework Components on the Harness Side The following components are used for running CLDC, MIDP, and CDC tests in theDistributed, OTA, and Automated test configurations with the harness: ■ Execution server - Used in CLDC and MIDP Distributed and Automated test configuratio...
8 Java ME TCK Framework Developer’s Guide • July 2007 An agent is a separate program that works in conjunction with the harness to runtests on the device. In CDC, the agent is started once, and when started, in a loop, it uses thecommunication channel to the harness to download the test classes and ...
Chapter 1 Introduction 9 Automated Tests Automated tests for CLDC, MIDP, and CDC configurations execute on the testdevice without requiring user interaction. Automated tests can be queued up andrun by the test harness and their results recorded without the user being present. The configuration for s...
10 Java ME TCK Framework Developer’s Guide • July 2007 FIGURE 1-1 Framework Configuration for Standard Automated Tests Diagram of a standard automated test configuration. Distributed Tests Distributed tests are a special type of automated tests. Not only do they have adevice side test component, whi...
12 Java ME TCK Framework Developer’s Guide • July 2007 Interactive Tests Interactive tests are the tests that require some form of user interaction and cannotbe executed without such interaction. From a design point of view, interactive testsare a subtype of distributed test. As a subtype of distrib...
Chapter 1 Introduction 13 FIGURE 1-3 Framework Configuration for Interactive Tests Diagram of the interactive test configuration. OTA Tests OTA tests are MIDP-specific tests that verify the over-the-air (OTA) applicationprovisioning implementation. This includes obtaining, installing, and removingap...
15 C H A P T E R 2 Writing a Simple Automated Test Automated test execution is the most common and simple of the test configurationsthat are run on the test device. User interaction is not required to run automatedtests. The following instructions describe how to create a simple automated test andad...
16 Java ME TCK Framework Developer’s Guide • July 2007 ■ Each test case method must take no arguments, and must return a Status objectthat represents the outcome of the test case. The Status can be either Status.passed(String) or Status.failed(String) . ■ Developers must update the runTestCases() me...
Chapter 2 Writing a Simple Automated Test 17 2. Save this file in the Simple Test Suite source as SimpleTestSuite/tests/pkg3/Test3.java . The pkg3 folder does not exist in SimpleTestSuite/tests and can be created by the test developer when saving Test3.java . Sources for the tests should be placed i...
18 Java ME TCK Framework Developer’s Guide • July 2007 Note – The contents of this test description file correspond to the Test3.java test class. 4. Save this file in the Simple Test Suite source as SimpleTestSuite/tests/pkg3/index.html . The index.html must be contained in the same directory as its...
Chapter 2 Writing a Simple Automated Test 19 Building an Updated Simple Test Suite The following steps demonstrate how to build an updated test suite after adding atest. ▼ To Build an Updated Test Suite After completing the procedures contained in “Writing an Automated Test” on page 15 , you must ru...
20 Java ME TCK Framework Developer’s Guide • July 2007 3. Enter the ant command to invoke the ant build script. The build creates a SimpleTestSuite-build directory containing the test suite. After creating the updated test suite, you must test it (see “Testing an Updated Simple Test Suite” on page 2...
Chapter 2 Writing a Simple Automated Test 21 3. Use the Configuration Editor to provide configuration information required to run the updated test suite. 4. After you complete the interview, choose Run Test > Start on the Test Manager main menu to start the test suite. 5. Use the following comman...
23 C H A P T E R 3 Test Suite Construction This chapter describes the organization and construction of a Java ME technologytest suite that uses Framework resources. Additional information about constructingtest suites for use with the JavaTest harness can be located in Chapters 4 and 8 of the JavaTe...
24 Java ME TCK Framework Developer’s Guide • July 2007 ■ lib directory ■ tests directory ■ classes directory ■ doc directory testsuite.jtt File The testsuite.jtt file is located in the root directory of the test suite. It provides a registry of information about the test suite and defines test suite...
26 Java ME TCK Framework Developer’s Guide • July 2007 Organize the tests hierarchically the way you want them displayed in the test tree.The Test Manager in the harness displays the test hierarchy, enabling users to selectand run specific groups of tests from the GUI. Test Class A test class or tes...
Chapter 3 Test Suite Construction 27 Additional examples (Test1.java and Test2.java)can be found in the following SimpleTest Suite directories: ■ SimpleTestSuite/tests/sample/pkg1/ ■ SimpleTestSuite/tests/sample/pkg2/ Test Description file Each subdirectory that contains one or more test classes mus...
30 Java ME TCK Framework Developer’s Guide • July 2007 1. Define the environment variable required by the test. In the example ( Test2.java ), the test case SampleStringValue() checks if the sampleValue that is passed in equals Hello . The harness requires the sampleValue environment variable to run...
Chapter 3 Test Suite Construction 31 a. Create a class ( SampleInterview ) that is a subtype of the Interview class. The following code creates the SampleInterview class. b. Identify the new interview ( SampleInterview ) as a sub-interview of the parent interview. In the new sub-interview class, the...
32 Java ME TCK Framework Developer’s Guide • July 2007 d. Use the setFirstQuestion method in the constructor to specify the first question in the sub-interview. The following setFirstQuestion code in the SampleInterview example specifies the first question. e. Specify the question type. The Question...
Chapter 3 Test Suite Construction 33 f. Implement exporting the configuration value to the test environment. One of the goals of the interview is to export the configuration value to thetest environment. Each question has an export() method that is used for this purpose. The following code in the Sa...
34 Java ME TCK Framework Developer’s Guide • July 2007 h. Use the getNext() method to determine the next question in the sub- interview. Every question except the Final question must provide a getNext() method that determines the next (successor) question or null. Alternatively, if theFramework’s in...
36 Java ME TCK Framework Developer’s Guide • July 2007 4. Update the interview .properties (resource) file. All question text is located in the interview .properties file associated with the interview class files and is identified by a unique question key. The question key is based on a name assigne...
Chapter 3 Test Suite Construction 37 a. Create a help directory under the directory where the interview classes are located. For this example, use the following location: SimpleTestSuite/src/sample/suite/help b. Create a helpset file ( sampleInterview.hs ) under the help directory. The helpset file ...
Chapter 3 Test Suite Construction 39 e. Create the More Info topic files. The More Info topic files are provided in HTML format and displayed in theConfiguration Editor ’s More Info pane. Refer to the JavaTest Architect’s Guide for the procedure for creating More Info topic files. The following is a...
40 Java ME TCK Framework Developer’s Guide • July 2007 Building a Test Suite Refer to Chapter 2 , “Building an Updated Simple Test Suite” on page 19 for the procedure to build a Java ME technology test suite by using Framework resources.
41 C H A P T E R 4 Writing Tests This chapter describes how to write different types of Java ME technology tests thatuse Framework resources and to set special properties required by the tests. Generalinformation about the process of creating tests can be located in Chapters 5 and 6 ofthe Java Techn...
42 Java ME TCK Framework Developer’s Guide • July 2007 Automated Test Execution FIGURE 4-1 and the associated text are for CLDC and MIDP execution mode. In the diagram, arrows indicate the direction of dataflow between the device and theworkstation. The numbered items indicate the sequence and the c...
Chapter 4 Writing Tests 43 While the tests from the application bundle are loaded onto the device by theAMS, the execution server establishes the sequence in which the tests in thebundle are run. 5. sendTestResult - The agent returns the test results to the execution server. Items 3, 4, and 5 repeat...
44 Java ME TCK Framework Developer’s Guide • July 2007 The client test component must use the send and handleMessage methods in the J2MEDistributedTest class to send and receive messages to or from the other named components of the distributed test. Remote Test Component The remote test component of...
Chapter 4 Writing Tests 45 The following is an example of the remote attribute entry that must be added to the test description file. In the example, the remote attribute execution command is composed of the following values: ■ sample.pkg.SampleDistributedTest is the fully qualified name of the remo...
46 Java ME TCK Framework Developer’s Guide • July 2007 The following is an example of the executeArgs attribute entry in which the $testMsgSwitch and $timeOut environment variables are specified. Distributed Test Execution FIGURE 4-2 and the associated text are for MIDP execution mode. In the diagra...
48 Java ME TCK Framework Developer’s Guide • July 2007 5. Check or Send Message - The test sends either a message or a check message request to the Framework messaging service on the harness. 6. Get Message - The Framework messaging service on the harness sends the test a get message command. 7. Che...
50 Java ME TCK Framework Developer’s Guide • July 2007 The test description might also include the remoteSource and executeArgs attributes. See “ remoteSource Attribute” on page 45 and “ executeArgs Attribute” on page 45 for a description and example of these attribute entries. Required Interactive ...
52 Java ME TCK Framework Developer’s Guide • July 2007 4. Test Name - The execution server returns the name of the next test in the application bundle that the AMS should run. While the tests from the application bundle are loaded onto the device by theAMS, the execution server establishes the seque...
Chapter 4 Writing Tests 53 Testing Application Provisioning WithOTA Tests Over-the-air (OTA) tests are MIDP-specific tests that verify an OTA applicationprovisioning implementation. This includes obtaining, installing, and removingapplications (MIDlet suites), and enforcing security requirements. Ea...
54 Java ME TCK Framework Developer’s Guide • July 2007 done at the build time. If the test writer creates a JAR file or a JAD file with specialinformation about the MIDlet suite as part of the bundle, the test writer must alsocreate a manifest file ( .mf ). Test Description for OTA Tests The test de...
Chapter 4 Writing Tests 55 remote Attribute The remote attribute specifies the execution command for the server test component. The following is an example of the remote attribute entry that must be added to the test description file. In the remote attribute, sample.pkg.OTA.OTATest1 is the test clas...
Chapter 4 Writing Tests 57 OTA Test Execution In FIGURE 4-4 , arrows indicate the direction of dataflow between the device and the workstation. The numbered items indicate the sequence and the content of thedataflow. <TABLE BORDER=1 CLASS=TestDescription> <TR> <TD> <B>title&l...
58 Java ME TCK Framework Developer’s Guide • July 2007 FIGURE 4-4 OTA Test Execution 1. Request an Action - The server-side test requests an action from the test operator. 2. Action - The test operator action is sent to the AMS. 3. Request to Download Test Application - The AMS sends the OTA server ...
Chapter 4 Writing Tests 59 Example of OTA Test The following is an example of an OTA server component. In the example, thesource of the MIDlet suite is named Test_MIDlet.java and the JAD file is Test_MIDlet.jad . The JAD file contains the manifest file and the Test_MIDlet.class . CODE EXAMPLE 4-12 S...
60 Java ME TCK Framework Developer’s Guide • July 2007 Testing Security-ConstrainedFunctionality With Security Tests This section addresses writing different types of security tests, using keywords andattributes to mark different types of security tests, and using attributes in the testdescription t...
Chapter 4 Writing Tests 61 Trusted Tests Trusted tests verify API implementation behavior for signed MIDlet suites. In mostcases, these tests verify that specification assertions related to signed MIDlet suitesare properly implemented. Trusted MIDlet suites can be permitted to access APIs that are c...
62 Java ME TCK Framework Developer’s Guide • July 2007 If other keywords (such as positive ) are used, they would be included in the same line as the untrusted keyword. The following is an example of a test description file that uses runtime , positive , and untrusted keywords. Marking Trusted Tests...
Chapter 4 Writing Tests 63 The following is an example of adding a trusted keyword entry to a test description file. When other keywords (such as positive ) are used, they are included in the same line as the trusted keyword and separated by white space. Using an Attribute to Mark Double-Duty Tests ...
64 Java ME TCK Framework Developer’s Guide • July 2007 Granting or Denying Security Permissions A security test might require that certain permissions be granted (or denied) for thetest to pass. The test is run or not run according to the permissions that a test writergrants or denies. Granting Secu...
66 Java ME TCK Framework Developer’s Guide • July 2007 Denying Security Permissions When writing security tests, a test writer can specify the permissions that thesecurity policy must not grant in the protection domain for this test application toexecute and pass. Test writers can specify the denied...
Chapter 4 Writing Tests 67 Adding Resource Files in Tests Test writers must sometimes develop tests that require extra resource files (such asimage, data, or class files) for the test execution. When writing tests for CLDC andMIDP-based implementations, test writers can use the resources entry in th...
70 Java ME TCK Framework Developer’s Guide • July 2007 Enabling Test Selection Test selection in a test run is of value to a user when a test suite includes tests foroptional features that were not implemented. Because the assumption of tests is thatthe target implementation must support these featu...
Chapter 4 Writing Tests 71 ■ selectIf expression in test description - This mechanism provides a flexible way for developers to make individual tests selectable( com.sun.tck.j2me.javatest.ExprFilter ) by including a selectIf expression in test description. The test developer can include a selectIf e...
72 Java ME TCK Framework Developer’s Guide • July 2007 1. Add a selectIf entry to the test description file for a test class that users might be required to filter out of a test run. The following is an example of a selectIF entry added to a test description file. In the example, isFeatureSupported ...
Chapter 4 Writing Tests 75 3. Add interview question .smry and .text entries to the .properties file. For each added interview question, the developer must create corresponding .smry and .text entries in the resource file ( .properties ). The following is an example of the .smry and .text entries ad...
76 Java ME TCK Framework Developer’s Guide • July 2007 Question keys are created in the following form: interview-class-name . question-name ■ The .smry entry specifies the question title (in the example, Feature Support ) that the Configuration Editor displays to the user. ■ The .text entry specifi...
77 A P P E N D I X A Test API The following is the Java ME technology-specific API that every test developer mustknow: ■ Test ■ Status ■ MultiTest ■ J2MEDistributedTest ■ J2SEDistributedTest ■ DistribInteractiveTest ■ OTATest Test Interface name: com.sun.tck.cldc.lib.Test This is a Java ME technolog...
78 Java ME TCK Framework Developer’s Guide • July 2007 A test must also define main as follows: Defining main in this manner enables the test to also be run standalone, independent of the harness. Status Class name: com.sun.tck.cldc.lib.Status This is a Java ME technology version of the standard har...
Appendix A Test API 79 J2MEDistributedTest Class name: com.sun.tck.j2me.services.messagingService.J2MEDistributedTest This is the base class for distributed tests for the Java ME technology component ofthe test. Each distributed test has a unique name used for identification duringmessage exchange. ...
80 Java ME TCK Framework Developer’s Guide • July 2007 OTATest Class name: com.sun.tck.midp.lib.OTATest This is the base class for the Java SE technology component of an OTA test. Itprovides various convenience methods which trigger installation, execution, orremoval of an application.
Appendix B Framework Bundle 83 Core The following are core Framework files provided in the lib directory: ■ j2mefw_jt.jar - Harness plug-in code. Most of the Java SE platform code to support ME TCKs is in this file. ■ interviewlib.jar - Helper library for interview creation. CLDC and MIDP Execution ...
84 Java ME TCK Framework Developer’s Guide • July 2007 ■ cldc_agent.jar - Standard harness agent for CLDC. Application model: Main Communication channel: pluggable. Plug-ins The following are the plug-in .jar files provided in the lib directory: ■ cldc_httpsrvr.jar - Implementation of the server int...
Appendix B Framework Bundle 85 ■ cldc_commClient.jar - Implementation of the Client interface for the CLDC device. This client uses HTTP for communication. ■ datagram_commClient.jar - Distributed test communication client interface implementation that uses datagrams for communication. CommServers Th...
86 Java ME TCK Framework Developer’s Guide • July 2007 Application model: Xlet Pluggable communication channel ■ applet_agent.jar - JavaTest agent for Personal Profile. Application model: Applet Pluggable communication channel src Directory The src directory contains the Framework test sources, test...
Appendix B Framework Bundle 87 Agent Classes The following are the agent classes and interfaces provided in the src directory: ■ com/sun/cldc/communication/Client - Communication interface ■ com/sun/cldc/communication/MultiClient - Communication interface ■ com/sun/tck/midp/javatest/agent/MIDletAgen...
88 Java ME TCK Framework Developer’s Guide • July 2007 ■ com/sun/tck/midp/interview/VmAdvancedInterview ■ com/sun/tck/midp/interview/VmInterview ■ com/sun/tck/midp/interview/MidpTckInterview ■ com/sun/tck/midp/interview/MidpTckBaseInterview ■ com/sun/tck/midp/interview/ConnectionInterview ■ com/sun/...
91 A P P E N D I X C Test Description Fields andKeywords This appendix describes the Framework supported fields and keywords for testdescription files. The JavaTest harness requires that each test is accompanied by machine readabledescriptive data in the form of test suite-specific name-value pairs ...
97 Glossary The definitions in this glossary are intended for Java Compatibility Test Tools (JavaCTT) and Java Technology Compatibility Kits (TCK). Some of these terms mighthave different definitions or connotations in other contexts. This is a generic glossarycovering all of Sun’s CTTs and TCKs, an...
107 Index Symbols .jtx files, 100 A active agent, 97active applet instance, 97agent, 97agent monitor, 97AID, 98all values, 97AMS, 98APDU, 98API, 98API member, 97API member test, 97appeals process, 98 first-level, 100second-level, 103 Application IDentifier, 98Application Management Software, 98Appli...
Sun Microsystems Manuals
-
Sun Microsystems B1600
Manual
-
Sun Microsystems 7
Manual
- Sun Microsystems V120 Manual
-
Sun Microsystems AC200
Manual
-
Sun Microsystems Sun Quad
Manual
- Sun Microsystems 60 Manual
-
Sun Microsystems SG-XPCIE1FC-EM8-Z
Manual
-
Sun Microsystems 10
Manual
-
Sun Microsystems 4000
Manual
-
Sun Microsystems 96257
Manual
-
Sun Microsystems T3
Manual
-
Sun Microsystems 819468310
Manual
-
Sun Microsystems 2000E
Manual
-
Sun Microsystems SPARCcenter 2000
Manual
-
Sun Microsystems X4140
Manual
-
Sun Microsystems X6250
Manual
- Sun Microsystems 2500 Manual
-
Sun Microsystems GigaSwift Ethernet Adapter
Manual
-
Sun Microsystems 805-7945-10
Manual
-
Sun Microsystems A5000
Manual