Manual Sun Microsystems 1.2

130 pages 1.62 mb
Download

Go to site of 130

Summary
  • Sun Microsystems 1.2 - page 1

    Java ™ ME TCK F rame work De v elopers Guide V ersion 1.2 July 2007 Sun Microsystems, Inc. www .sun.com ...

  • Sun Microsystems 1.2 - page 2

    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 CONT AINS CONFIDENTIAL INFORMA TION AND TRADE SECRETS OF SUN MICROSYSTEMS, INC. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT THE PRI ...

  • Sun Microsystems 1.2 - page 3

    iii Contents Preface xv 1. Introduction 1 Getting Started 1 Development Environment 3 Use of the Framework 3 T arget 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 Side 7 Test Types 8 Automated T ests 9 Distribut ...

  • Sun Microsystems 1.2 - page 4

    iv Java ME TCK Framework Developer’s Guide • July 2007 Writing an Automated Test 15 ▼ T o Create a Simple Automated T est 16 Building an Updated Simple Test Suite 19 ▼ T o Build an Updated T est Suite 19 Testing an Updated Simple Test Suite 20 ▼ T o T est an Updated T est Suite 20 3. T est Suite Construction 23 Test Suite Structure 23 tes ...

  • Sun Microsystems 1.2 - page 5

    Contents v remote Attribute 44 remoteSource Attribute 45 executeArgs Attribute 45 Distributed T est Execution 46 Testing User Interfaces With Interactive Tests 48 Client T est Component 49 Remote T est Component 49 T est Description for Interactive T ests 49 Required Interactive T est Keywords 50 Interactive T est Execution 50 Example of an Interac ...

  • Sun Microsystems 1.2 - page 6

    vi Java ME TCK Framework Developer’s Guide • July 2007 Marking T rusted T ests 62 Using an Attribute to Mark Double-Duty T ests 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 Factors and Mechanisms for T est Selection 70 ...

  • Sun Microsystems 1.2 - page 7

    Contents vii CommServers 85 Messaging 85 T est Export Support Libraries 85 CDC Agents 85 src Directory 86 Framework Server Classes and Interfaces 86 Agent Classes 87 Digital Signer 87 Preverif ication Script 87 Java ME T echnology V ersion of Harness Classes 87 Basic Interview Classes Containing General Questions 87 Communication Channel 88 doc Dir ...

  • Sun Microsystems 1.2 - page 8

    viii Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 9

    ix Figur es 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 Distributed Test Execution 47 FIGURE 4-3 Interact ...

  • Sun Microsystems 1.2 - page 10

    x Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 11

    xi T ables T ABLE 1-1 Configurations and Supported Test Types 8 T ABLE C-1 Framework Test Description Fields 92 T ABLE C-2 Framework Keywords 94 ...

  • Sun Microsystems 1.2 - page 12

    xii Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 13

    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 Environment Variables 46 CODE EXAMPLE 4-5 Require ...

  • Sun Microsystems 1.2 - page 14

    xiv Java ME TCK Framework Developer’s Guide • July 2007 CODE EXAMPLE 4-19 Test Description That Grants Permissions for a Security Test 65 CODE EXAMPLE 4-20 deny Attribute in the Test Description 66 CODE EXAMPLE 4-21 Test Description That Denies Permissions for a Security Test 66 CODE EXAMPLE 4-22 Test That Requires an Image Resource 68 CODE EXA ...

  • Sun Microsystems 1.2 - page 15

    xv Pr eface This guide describes how to use resour ces from the Java™ Platform, Micro Edition T echnology Configuration Kit Framework (Framework) to develop and configur e test suites and tests for Java Platform, Micro Edition (Java ME platform) technologies. Befor e Y ou Read This Book T o fully use the information in this document, you must rea ...

  • Sun Microsystems 1.2 - page 16

    xvi Java ME TCK Framework Developer’s Guide • July 2007 ■ JavaT est 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 T echnology APIs and Docs web site at http://java.sun.com/javame/reference/apis.jsp . ■ JavaT e ...

  • Sun Microsystems 1.2 - page 17

    Preface xvii Platform Commands This document does not contain information about basic platform commands and procedur es such as shutting down the system, booting the system, and configuring devices. Refer to the following for this information: ■ Software documentation that you received with your system ■ Solaris™ Operating System documentatio ...

  • Sun Microsystems 1.2 - page 18

    xviii Java ME TCK Framework Developer’s Guide • July 2007 T ypographic Conventions This guide uses the following typographic conventions: Related Documentation When installed, the Framework includes a doc directory that contains both Framework and harness documentation in PDF and HTML format. The following documentation provides detailed inform ...

  • Sun Microsystems 1.2 - page 19

    Preface xix Accessing Sun Documentation Online The Java Developer Connection™ program web site enables you to access Java platform technical documentation at http://java.sun.com/ . Sun W elcomes Y our Comments W e are interested in improving our documentation and welcome your comments and suggestions. Provide feedback to Sun at http://java.sun.co ...

  • Sun Microsystems 1.2 - page 20

    xx Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 21

    1 CHAPTER 1 Intr oduction This chapter introduces using the Framework resour ces to develop test suites for the Java ME platform, including descriptions of the kinds of tests that a test suite can include. This chapter contains the following sections: ■ Getting Started ■ Use of the Framework ■ Framework Bundle ■ T est T ypes Getting Started ...

  • Sun Microsystems 1.2 - page 22

    2 Java ME TCK Framework Developer’s Guide • July 2007 Note – The TCK Project Planning Guide and the Java T echnology T est Suite Development Guide documents were originally developed as part of a product used by the Java Community Process (JCP) Specif ication Leads. For that reason, these documents refer to JCP pr ocedures that might not appl ...

  • Sun Microsystems 1.2 - page 23

    Chapter 1 Introduction 3 Development Envir onment The following tools and resources ar e the minimum software r equirements for the Framework development environment: ■ JDK, version 5.0 or later ■ JavaT est harness, version 3.2.2 or later For TCK development, download the latest Java Compatibility T est T ools (Java CTT) from the Java Community ...

  • Sun Microsystems 1.2 - page 24

    4 Java ME TCK Framework Developer’s Guide • July 2007 Configuration (CDC) and a prof ile such as Mobile Information Device Profile (MIDP), Foundation Prof ile (FP), Personal Basis Profile (PBP), or Personal Prof ile (PP). ■ Conf iguration - CLDC and CDC are conf igurations that provides a basic set of libraries and virtual-machine features th ...

  • Sun Microsystems 1.2 - page 25

    Chapter 1 Introduction 5 Resource Limitations Hardwar e resources on test devices ar e often limited. Resource constrained devices can quit operation when excess native resources ar e requested. The Framework can run tests on r esource constrained target devices with limited available memory and persistent storage. When developing test suites for t ...

  • Sun Microsystems 1.2 - page 26

    6 Java ME TCK Framework Developer’s Guide • July 2007 Framework Bundle The Framework resour ces are packaged and provided to users as a zip bundle. When the bundle is unzipped the following directories and files are placed in the Framework root dir ectory: ■ doc - Contains the Java ME TCK Framework Developer ’ s Guide (PDF and HTML formats) ...

  • Sun Microsystems 1.2 - page 27

    Chapter 1 Introduction 7 Framework Components on the Harness Side The following components are used for running CLDC, MIDP , and CDC tests in the Distributed, OT A, and Automated test configurations with the harness: ■ Execution server - Used in CLDC and MIDP Distributed and Automated test configurations. The execution server contains no internal ...

  • Sun Microsystems 1.2 - page 28

    8 Java ME TCK Framework Developer’s Guide • July 2007 An agent is a separate program that works in conjunction with the harness to run tests on the device. In CDC, the agent is started once, and when started, in a loop, it uses the communication channel to the harness to download the test classes and to execute them on the device, and then repo ...

  • Sun Microsystems 1.2 - page 29

    Chapter 1 Introduction 9 Automated T ests Automated tests for CLDC, MIDP , and CDC configurations execute on the test device without requiring user interaction. Automated tests can be queued up and run by the test harness and their results r ecorded without the user being pr esent. The configuration for standar d automated test execution is the mos ...

  • Sun Microsystems 1.2 - page 30

    10 Java ME TCK Framework Developer’s Guide • July 2007 FIGURE 1-1 Framework Conf iguration for Standard Automated T ests Diagram of a standard automated test configuration. Distributed T ests Distributed tests are a special type of automated tests. Not only do they have a device side test component, which is executed under the control of a test ...

  • Sun Microsystems 1.2 - page 31

    Chapter 1 Introduction 11 Distributed tests are typically slower (due to extra communication between remote components) and more complex than simple automated tests and should be used only when it’s not possible to write simple automated tests. FIGURE 1-2 illustrates the Framework configuration for running CLDC and MIDP distributed tests. Distrib ...

  • Sun Microsystems 1.2 - page 32

    12 Java ME TCK Framework Developer’s Guide • July 2007 Interactive T ests Interactive tests are the tests that requir e some form of user interaction and cannot be executed without such interaction. From a design point of view , interactive tests are a subtype of distributed test. As a subtype of distribute test, interactive tests generally exe ...

  • Sun Microsystems 1.2 - page 33

    Chapter 1 Introduction 13 FIGURE 1-3 Framework Conf iguration for Interactive T ests Diagram of the interactive test configuration. OT A T ests OT A tests are MIDP-specif ic tests that verify the over-the-air (OT A) application provisioning implementation. This includes obtaining, installing, and removing applications (MIDlet suites), and enforcing ...

  • Sun Microsystems 1.2 - page 34

    14 Java ME TCK Framework Developer’s Guide • July 2007 OT A tests validate API functionality while the device is connected to a remote host (the PC or workstation where the harness runs). In this configuration, one part of the OT A test runs on the remote host (the PC or workstation wher e the harness runs) using a passive agent and the other p ...

  • Sun Microsystems 1.2 - page 35

    15 CHAPTER 2 W riting a Simple Automated T est Automated test execution is the most common and simple of the test configurations that are run on the test device. User interaction is not r equired to run automated tests. The following instructions describe how to create a simple automated test and add it to an existing Framework supplied test suite. ...

  • Sun Microsystems 1.2 - page 36

    16 Java ME TCK Framework Developer’s Guide • July 2007 ■ Each test case method must take no arguments, and must return a Status object that repr esents the outcome of the test case. The Status can be either Status.passed(String) or Status.failed(String) . ■ Developers must update the runTestCases() method to add the test cases that are exec ...

  • Sun Microsystems 1.2 - page 37

    Chapter 2 Writing a Simple Automated T est 17 2. Save this f ile in the Simple T est 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 inside the tests directory of the test suite and ...

  • Sun Microsystems 1.2 - page 38

    18 Java ME TCK Framework Developer’s Guide • July 2007 Note – The contents of this test description file corr espond to the Test3.java test class. 4. Save this f ile in the Simple T est Suite source as SimpleTestSuite/tests/pkg3/index.html . The index.html must be contained in the same directory as its test class (in this case, Test3.java) . ...

  • Sun Microsystems 1.2 - page 39

    Chapter 2 Writing a Simple Automated T est 19 Building an Updated Simple T est Suite The following steps demonstrate how to build an updated test suite after adding a test. ▼ T o Build an Updated T est Suite After completing the procedures contained in “W riting an Automated T est” on page 15 , you must run the build to assemble the updated t ...

  • Sun Microsystems 1.2 - page 40

    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 dir ectory containing the test suite. After creating the updated test suite, you must test it (see “T esting an Updated Simple T est Suite” on page 20 ) before making the test suite availa ...

  • Sun Microsystems 1.2 - page 41

    Chapter 2 Writing a Simple Automated T est 21 3. Use the Conf iguration Editor to provide conf iguration information required to run the updated test suite. 4. After you complete the interview , choose Run T est > Start on the T est Manager main menu to start the test suite. 5. Use the following command to start the WTK. If you answered the inte ...

  • Sun Microsystems 1.2 - page 42

    22 Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 43

    23 CHAPTER 3 T est Suite Constr uction This chapter describes the organization and construction of a Java ME technology test suite that uses Framework resour ces. Additional information about constructing test suites for use with the JavaT est harness can be located in Chapters 4 and 8 of the JavaT est Architect’ s Guide . This chapter contains t ...

  • Sun Microsystems 1.2 - page 44

    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 r oot directory of the test suite. It provides a registry of information about the test suite and def ines test suite properties. The harness uses these ...

  • Sun Microsystems 1.2 - page 45

    Chapter 3 T est Suite Construction 25 The testsuite.jtt file is located under the r oot directory of the Simple T est Suite. Y ou can also find it under the build/ directory of the Simple T est Suite source. lib Dir ectory The lib directory usually contains the javatest.jar file that pr ovides all of the classes requir ed to execute the harness, al ...

  • Sun Microsystems 1.2 - page 46

    26 Java ME TCK Framework Developer’s Guide • July 2007 Organize the tests hierar chically the way you want them displayed in the test tree. The T est Manager in the harness displays the test hierarchy , enabling users to select and run specific gr oups of tests from the GUI. T est Class A test class or test source is a Java technology class tha ...

  • Sun Microsystems 1.2 - page 47

    Chapter 3 T est Suite Construction 27 Additional examples (T est1.java and T est2.java)can be found in the following Simple T est Suite directories: ■ SimpleTestSuite/tests/sample/pkg1/ ■ SimpleTestSuite/tests/sample/pkg2/ T est Description f ile Each subdirectory that contains one or more test classes must also contain a corresponding test des ...

  • Sun Microsystems 1.2 - page 48

    28 Java ME TCK Framework Developer’s Guide • July 2007 The classes directory generally contains following sub-dir ectories: ■ classes/preverified - Contains the preverif ied test classes. ■ classes/shared/testClasses.lst - The test class dependency file ( testClasses.lst ) provides information to the Framework test bundling infrastructure r ...

  • Sun Microsystems 1.2 - page 49

    Chapter 3 T est Suite Construction 29 In the test description file, $testHost and $testPort ar e test environment variables and are r eplaced by actual values obtained from the test environment. ■ The test suite configuration interview must include a corresponding and appropriate question asking the user to specify the values of the host and port ...

  • Sun Microsystems 1.2 - page 50

    30 Java ME TCK Framework Developer’s Guide • July 2007 1. Def ine 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 requir es the sampleValue environment variable to run the test. Because the value for sampleValue ...

  • Sun Microsystems 1.2 - page 51

    Chapter 3 T est 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 constructor must take a reference to the parent ...

  • Sun Microsystems 1.2 - page 52

    32 Java ME TCK Framework Developer’s Guide • July 2007 d. Use the setFirstQuestion method in the constructor to specify the f irst question in the sub-interview . The following setFirstQuestion code in the SampleInterview example specifies the f irst question. e. Specify the question type. The Question class is a base class that provides the di ...

  • Sun Microsystems 1.2 - page 53

    Chapter 3 T est Suite Construction 33 f. Implement exporting the conf iguration value to the test environment. One of the goals of the interview is to export the configuration value to the test environment. Each question has an export() method that is used for this purpose. The following code in the SampleInterview example exports the value to the ...

  • Sun Microsystems 1.2 - page 54

    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 the Framework’s interview extension library is used, it’s ...

  • Sun Microsystems 1.2 - page 55

    Chapter 3 T est Suite Construction 35 j. Use the FinalQuestion marker to identify the last question in the sub- interview . At the end of the sub-interview , have the last question return an instance of FinalQuestion . FinalQuestion is only a marker and does not have question text, More Info, or a getNext method. The following code in the SampleInt ...

  • Sun Microsystems 1.2 - page 56

    36 Java ME TCK Framework Developer’s Guide • July 2007 4. Update the interview .properties (resource) f ile. 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 assigned by the test developer and must uniquely id ...

  • Sun Microsystems 1.2 - page 57

    Chapter 3 T est 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 f ile ( sampleInterview.hs ) under the help directory . The helpset file specif ies the location of the map file for the ...

  • Sun Microsystems 1.2 - page 58

    38 Java ME TCK Framework Developer’s Guide • July 2007 d. Create a map f ile ( sampleInterview.jhm )i nt h e default directory . The JavaHelp system uses IDs from a map f ile to identify both the location and the HTML files that it loads for the More Info system. Each Mor e Info file must have a corresponding entry in the map f ile of the form ...

  • Sun Microsystems 1.2 - page 59

    Chapter 3 T est Suite Construction 39 e. Create the More Info topic f iles. The More Info topic f iles are provided in HTML format and displayed in the Configuration Editor ’s More Info pane. Refer to the JavaT est Architect’ s Guide for the procedur e for creating More Info topic f iles. The following is an example of a More Info f ile. Additi ...

  • Sun Microsystems 1.2 - page 60

    40 Java ME TCK Framework Developer’s Guide • July 2007 Building a T est Suite Refer to Chapter 2 , “Building an Updated Simple T est Suite” on page 19 for the procedur e to build a Java ME technology test suite by using Framework resour ces. ...

  • Sun Microsystems 1.2 - page 61

    41 CHAPTER 4 W riting T ests This chapter describes how to write different types of Java ME technology tests that use Framework resour ces and to set special properties requir ed by the tests. General information about the process of creating tests can be located in Chapters 5 and 6 of the Java T echnology T est Suite Development Guide . Additional ...

  • Sun Microsystems 1.2 - page 62

    42 Java ME TCK Framework Developer’s Guide • July 2007 Automated T est Execution FIGURE 4-1 and the associated text are for CLDC and MIDP execution mode. In the diagram, arrows indicate the direction of dataf low between the device and the workstation. The numbered items indicate the sequence and the content of the dataflow . FIGURE 4-1 Automat ...

  • Sun Microsystems 1.2 - page 63

    Chapter 4 Writing T ests 43 While the tests from the application bundle ar e loaded onto the device by the AMS, the execution server establishes the sequence in which the tests in the bundle are run. 5. sendTestResult - The agent returns the test r esults to the execution server . Items 3, 4, and 5 repeat until all tests in the application bundle a ...

  • Sun Microsystems 1.2 - page 64

    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 T est Component The remote test component of the distributed test must extend the com.sun ...

  • Sun Microsystems 1.2 - page 65

    Chapter 4 Writing T ests 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 remote test class. ■ $ testMsgSwitch is an enviro ...

  • Sun Microsystems 1.2 - page 66

    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 specif ied. Distributed T est Execution FIGURE 4-2 and the associated text are for MIDP execution mode. In the diagram, arrows indicate the dir ection of dataflo ...

  • Sun Microsystems 1.2 - page 67

    Chapter 4 Writing T ests 47 FIGURE 4-2 Distributed T est Execution 1. getNextApp - The AMS issues a getNextApp command to the execution server on the workstation. The AMS implementation is device specific and must be provided by the licensee. 2. Application Bundle - The execution server sends an application bundle to the AMS. The AMS downloads and ...

  • Sun Microsystems 1.2 - page 68

    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. Check or Send Message - The server-side test send ...

  • Sun Microsystems 1.2 - page 69

    Chapter 4 Writing T ests 49 Client T est Component The client test component of the interactive test must extend the MidDistribInteractiveTest class. This is the base class for distributed interactive tests and extends the com.sun.tck.j2me.services.messagingService.J2MEDistributedTest class. The MidDistribInteractiveTest class provides all of the c ...

  • Sun Microsystems 1.2 - page 70

    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 T est Keywords The following is an exa ...

  • Sun Microsystems 1.2 - page 71

    Chapter 4 Writing T ests 51 FIGURE 4-3 Interactive T est Execution 1. getNextApp - The AMS issues a getNextApp command to the execution server on the workstation. The AMS implementation is device specific and must be provided by the licensee. 2. Application Bundle - The execution server sends an application bundle to the AMS. The AMS downloads and ...

  • Sun Microsystems 1.2 - page 72

    52 Java ME TCK Framework Developer’s Guide • July 2007 4. T est 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 the AMS, the execution server establishes the sequence in which the tests in the bundle are run ...

  • Sun Microsystems 1.2 - page 73

    Chapter 4 Writing T ests 53 T esting Application Pr ovisioning W ith OT A T ests Over-the-air (OT A) tests ar e MIDP-specific tests that verify an OT A application provisioning implementation. This includes obtaining, installing, and removing applications (MIDlet suites), and enforcing security requir ements. Each OT A test has an associated applic ...

  • Sun Microsystems 1.2 - page 74

    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 f ile with special information about the MIDlet suite as part of the bundle, the test writer must also create a manifest f ile ( .mf ). T est Description for OT A T ests The test description file for OT A tests must cont ...

  • Sun Microsystems 1.2 - page 75

    Chapter 4 Writing T ests 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 class of the server component and all other arguments ...

  • Sun Microsystems 1.2 - page 76

    56 Java ME TCK Framework Developer’s Guide • July 2007 The following is an example of a test description for a trusted OT A test. See “ remote Attribute” on page 55 for a description of the values that must be set in the remote attribute for a trusted OT A test. <H1>Test Specifications and Descriptions for Test</H1> <HR> & ...

  • Sun Microsystems 1.2 - page 77

    Chapter 4 Writing T ests 57 OT A T est Execution In FIGURE 4-4 , arrows indicate the dir ection of dataflow between the device and the workstation. The numbered items indicate the sequence and the content of the dataflow . <TABLE BORDER=1 CLASS=TestDescription> <TR> <TD> <B>title</B></TD> <TD> Over-the-Air ...

  • Sun Microsystems 1.2 - page 78

    58 Java ME TCK Framework Developer’s Guide • July 2007 FIGURE 4-4 OT A T est Execution 1. Request an Action - The server-side test r equests an action from the test operator . 2. Action - The test operator action is sent to the AMS. 3. Request to Download T est Application - The AMS sends the OT A server a request for a download of a test appli ...

  • Sun Microsystems 1.2 - page 79

    Chapter 4 Writing T ests 59 Example of OT A T est The following is an example of an OT A server component. In the example, the source of the MIDlet suite is named Test_MIDlet.java and the JAD file is Test_MIDlet.jad . The JAD file contains the manifest f ile and the Test_MIDlet.class . CODE EXAMPLE 4-12 Server T est Component Example public class O ...

  • Sun Microsystems 1.2 - page 80

    60 Java ME TCK Framework Developer’s Guide • July 2007 T esting Security-Constrained Functionality W ith Security T ests This section addresses writing dif ferent types of security tests, using keywords and attributes to mark differ ent types of security tests, and using attributes in the test description to grant or deny the security permissio ...

  • Sun Microsystems 1.2 - page 81

    Chapter 4 Writing T ests 61 T rusted T ests T rusted tests verify API implementation behavior for signed MIDlet suites. In most cases, these tests verify that specification assertions related to signed MIDlet suites are pr operly implemented. T rusted MIDlet suites can be permitted to access APIs that are considered sensitive or to which access is ...

  • Sun Microsystems 1.2 - page 82

    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 keywor ds. Marking T rusted T ests When developing trusted tests, the test wr ...

  • Sun Microsystems 1.2 - page 83

    Chapter 4 Writing T ests 63 The following is an example of adding a trusted keyword entry to a test description file. When other keywords (such as positive ) ar e used, they are included in the same line as the trusted keyword and separated by white space. Using an Attribute to Mark Double-Duty T ests When developing double-duty tests, test writers ...

  • Sun Microsystems 1.2 - page 84

    64 Java ME TCK Framework Developer’s Guide • July 2007 Granting or Denying Security Permissions A security test might requir e that certain permissions be granted (or denied) for the test to pass. The test is run or not run accor ding to the permissions that a test writer grants or denies. Granting Security Permissions When writing security tes ...

  • Sun Microsystems 1.2 - page 85

    Chapter 4 Writing T ests 65 The following is an example of a grant attribute and permissions added to a test description file. The value of the grant attribute is a list of space-separated permissions (in the example, javax.microedition.io.Connector.file.read and javax.microedition.io.Connector.file.write ) that must be granted by the security poli ...

  • Sun Microsystems 1.2 - page 86

    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 the security policy must not grant in the protection domain for this test application to execute and pass. T est writers can specify the denied security permissions by including a deny a ...

  • Sun Microsystems 1.2 - page 87

    Chapter 4 Writing T ests 67 Adding Resour ce Files in T ests T est writers must sometimes develop tests that require extra r esource f iles (such as image, data, or class files) for the test execution. When writing tests for CLDC and MIDP-based implementations, test writers can use the resources entry in the test description file to specify the loc ...

  • Sun Microsystems 1.2 - page 88

    68 Java ME TCK Framework Developer’s Guide • July 2007 For example, the following test requir es a Duke.png to create the Image object for successful execution. For this test example, the following is a resources entry that might be added to the test description file. In the resources entry , the value of the resource ( shared/sample/pkg3/Duke. ...

  • Sun Microsystems 1.2 - page 89

    Chapter 4 Writing T ests 69 The following is an example of a test description file containing a resources entry , directory , and f ile name. CODE EXAMPLE 4-24 T est Description That Includes Resources <HTML><HEAD> <TITLE>Test Specifications and Descriptions for Test2</TITLE> </HEAD> <BODY> <H1>Test Specifi ...

  • Sun Microsystems 1.2 - page 90

    70 Java ME TCK Framework Developer’s Guide • July 2007 Enabling T est Selection T est selection in a test run is of value to a user when a test suite includes tests for optional features that wer e not implemented. Because the assumption of tests is that the target implementation must support these features, the implementation fails tests that ...

  • Sun Microsystems 1.2 - page 91

    Chapter 4 Writing T ests 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 expression in the test description file for a t ...

  • Sun Microsystems 1.2 - page 92

    72 Java ME TCK Framework Developer’s Guide • July 2007 1. Add a selectIf entry to the test description f ile for a test class that users might be required to f ilter out of a test run. The following is an example of a selectIF entry added to a test description f ile. In the example, isFeatureSupported is an environment variable. Most environmen ...

  • Sun Microsystems 1.2 - page 93

    Chapter 4 Writing T ests 73 <TR> <TD SCOPE="row"> <B>selectIf</B> </TD> <TD> isFeatureSupported </TD> </TR> </TABLE> </BODY> </HTML> ...

  • Sun Microsystems 1.2 - page 94

    74 Java ME TCK Framework Developer’s Guide • July 2007 2. W rite an interview question that obtains the value of the environment variable from the user . T o obtain the value of environment variables from users, test developers must write an interview class and create the requir ed interview questions. If an interview class already exists in th ...

  • Sun Microsystems 1.2 - page 95

    Chapter 4 Writing T ests 75 3. Add interview question .smry and .text entries to the .properties f ile. For each added interview question, the developer must cr eate corresponding .smry and .text entries in the resour ce file ( .properties ). The following is an example of the .smry and .text entries added for the new question. The .smry and .text ...

  • Sun Microsystems 1.2 - page 96

    76 Java ME TCK Framework Developer’s Guide • July 2007 Question keys are cr eated 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 specifies the question text (in the example, Do ...

  • Sun Microsystems 1.2 - page 97

    77 APPENDIX A T est API The following is the Java ME technology-specific API that every test developer must know: ■ Test ■ Status ■ MultiTest ■ J2MEDistributedTest ■ J2SEDistributedTest ■ DistribInteractiveTest ■ OTATest Test Interface name: com.sun.tck.cldc.lib.Test This is a Java ME technology version of the standard harness T est i ...

  • Sun Microsystems 1.2 - page 98

    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 harness Status class. It embodies the result of a ...

  • Sun Microsystems 1.2 - page 99

    Appendix A T est 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 of the test. Each distributed test has a unique name used for identification during message exchange. The send and handleMessage methods can be used ...

  • Sun Microsystems 1.2 - page 100

    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 OT A test. It provides various convenience methods which trigger installation, execution, or removal of an application. ...

  • Sun Microsystems 1.2 - page 101

    81 APPENDIX B Framework Bundle This appendix describes the contents of the redistributables directory pr ovided by the Framework bundle. The contents of the redistributables directory are or ganized in the following structure: ■ lib Directory ■ src Directory ■ doc Directory lib Dir ectory The lib directory contains the Framework JAR files and ...

  • Sun Microsystems 1.2 - page 102

    82 Java ME TCK Framework Developer’s Guide • July 2007 ■ tckbuild.jar - Utility classes used by TCK build. ■ j2me-tck-framework_12.txt - Framework version marker (this file has no content). ■ midptck.ks - Standard keystor e containing default certificates used for MIDP application signing. CDC Agents Messaging CommServers CommService Comm ...

  • Sun Microsystems 1.2 - page 103

    Appendix B Fr amework Bundle 83 Cor e The following are cor e Framework files provided in the lib dir ectory: ■ 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 The Framework provides the following two f ...

  • Sun Microsystems 1.2 - page 104

    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 pr ovided in the lib directory: ■ cldc_httpsrvr.jar - Implementation of the server interface for the harness plug-in. This serv ...

  • Sun Microsystems 1.2 - page 105

    Appendix B Fr amework 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 The following are the CommServers .jar files pr ...

  • Sun Microsystems 1.2 - page 106

    86 Java ME TCK Framework Developer’s Guide • July 2007 Application model: Xlet Pluggable communication channel ■ applet_agent.jar - JavaT est agent for Personal Prof ile. Application model: Applet Pluggable communication channel src Dir ectory The src directory contains the Framework test sour ces, test descriptions, precompiled Framework cla ...

  • Sun Microsystems 1.2 - page 107

    Appendix B Fr amework 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/MIDletAgent - Standard agent ■ com/sun/tck/cldc/jav ...

  • Sun Microsystems 1.2 - page 108

    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/tck/midp/interview/TrustedIntervie ...

  • Sun Microsystems 1.2 - page 109

    Appendix B Fr amework Bundle 89 This class provides an implementation of the harness distribution mechanism on top of HTTP . ■ com/sun/tck/midp/javatest/MidBundler - MIDP-specific extension that builds on top of the generic CLDC mechanism. ■ com/sun/tck/midp/javatest/MessageSwitch - Support for distributed tests on MIDP . This class provides an ...

  • Sun Microsystems 1.2 - page 110

    90 Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 111

    91 APPENDIX C T est Description Fields and Keywor ds This appendix describes the Framework supported fields and keywords for test description files. The JavaT est harness requir es that each test is accompanied by machine readable descriptive data in the form of test suite-specific name-value pairs contained in a test description file. The JavaT es ...

  • Sun Microsystems 1.2 - page 112

    92 Java ME TCK Framework Developer’s Guide • July 2007 T ABLE C-1 lists the test description fields supported by the Framework and describes how their values are used by the harness when the tests are run. T ABLE C-1 Framework T est Description Fields Field Description title A descriptive string that identifies what the test does. The title app ...

  • Sun Microsystems 1.2 - page 113

    Appendix C T est Description Fields and K eywords 93 executeArgs An array of strings that are passed to the test classes being executed. The arguments might be f ixed but often involve symbolic values that are substituted from the test environment (variables def ined elsewhere in the test environment). The r esult of substituting values can be seen ...

  • Sun Microsystems 1.2 - page 114

    94 Java ME TCK Framework Developer’s Guide • July 2007 Keywor ds Keywords ar e tokens associated with specific tests. Keywords have the following functions: ■ Convey information to the harness about how to execute the tests ■ Serve as a basis for including and excluding tests during test runs Users specify keyword expr essions in the harnes ...

  • Sun Microsystems 1.2 - page 115

    Appendix C T est Description Fields and K eywords 95 runtime Identifies tests used with runtime pr oducts. trusted Identifies tests which must be run in a trusted (operator , manufacturer , and trusted third party) security domain. untrusted Identifies tests which must be run in an untr usted (unidentified third party) security domain. T ABLE C-2 F ...

  • Sun Microsystems 1.2 - page 116

    96 Java ME TCK Framework Developer’s Guide • July 2007 ...

  • Sun Microsystems 1.2 - page 117

    97 Glossary The definitions in this glossary ar e intended for Java Compatibility T est T ools (Java CTT) and Java T echnology Compatibility Kits (TCK). Some of these terms might have differ ent definitions or connotations in other contexts. This is a generic glossary covering all of Sun’s CTT s and TCKs, and therefore, it might contain some term ...

  • Sun Microsystems 1.2 - page 118

    98 Java ME TCK Framework Developer’s Guide • July 2007 appeals process A process for challenging the fairness, validity , accuracy , or relevance of one or more TCK tests. T ests that are successfully challenged are either corr ected or added to the TCK’s exclude list . See also first-level appeals pr ocess , second- level appeals process , a ...

  • Sun Microsystems 1.2 - page 119

    Glossary 99 boundary value analysis A test case development technique that entails developing additional test cases based on the boundaries defined by pr eviously categorized equivalence classes. class The prototype for an object in an object-oriented language. A class might also be considered a set of objects which shar e a common structure and be ...

  • Sun Microsystems 1.2 - page 120

    100 Java ME TCK Framework Developer’s Guide • July 2007 distributed tests T ests consisting of multiple components that are r unning on both the device and the JavaT est harness host. Dividing test components between the device and JavaT est harness is often used for tests of communication APIs, tests that are heavily dependent on external r es ...

  • Sun Microsystems 1.2 - page 121

    Glossary 101 Java Platform, Standard Edition (Java SE platform) A set of specifications that def ines the desktop runtime environment r equired for the deployment of Java technology applications. Java SE platform implementations are available for a variety of platforms, but most notably the Solaris and W indows operating systems. Java Application M ...

  • Sun Microsystems 1.2 - page 122

    102 Java ME TCK Framework Developer’s Guide • July 2007 JavaT est harness A test harness developed by Sun to manage test execution and result reporting for a T echnology Compatibility Kit (TCK) . The harness conf igures, sequences, and runs test suites. The JavaT est harness provides flexible and customizable test execution. It includes everyth ...

  • Sun Microsystems 1.2 - page 123

    Glossary 103 included according to the r eferencing rules set out in that platform edition specification. Other r eferenced specif ications must be referenced in their entirety . Program Management Off ice (PMO) The administrative structur e that implements the Java Community Process (JCP) program . protected API APIs that requir e that an applet h ...

  • Sun Microsystems 1.2 - page 124

    104 Java ME TCK Framework Developer’s Guide • July 2007 structure-based testing A set of test development methodologies that are based on the internal structure or logic of the system under test, not the description, behavior , or requir ements of that system. This is commonly known as white-box or glass- box testing. Compatibility testing does ...

  • Sun Microsystems 1.2 - page 125

    Glossary 105 test command template A generalized specification of a test command in a test envir onment . The test command is specified in the test envir onment using variables so that it can execute any test in the test suite regar dless of its arguments. test description Machine-readable information that describes a test to the test harness so th ...

  • Sun Microsystems 1.2 - page 126

    106 Java ME TCK Framework Developer’s Guide • July 2007 work directory A directory associated with a specif ic test suite and used by the JavaT est harness to store f iles containing information about the test suite and its tests. ...

  • Sun Microsystems 1.2 - page 127

    107 Index Symbols .jtx files, 100 A active agent, 97 active applet instance, 97 agent, 97 agent monitor, 97 AID, 98 all values, 97 AMS, 98 APDU, 98 API, 98 API member, 97 API member test, 97 appeals process, 98 first-level, 100 second-level, 103 Application IDentifier, 9 8 Application Management Software, 98 Application Programming Interface, 98 ...

  • Sun Microsystems 1.2 - page 128

    108 Ja va ME TCK F ramework Dev eloper’ s Guide • July 2007 I instantiation, 100 interactive tests, 10 0 ISO 7816-4, 9 8 J JAM, 101 JAR, 101 Java Application Manager, 10 1 Java Archive, 101 Java Community Process Pr ogram, 1 01 Java Compatibility T est T ools, 101 Java CTT, 1 01 Java Platform Libraries, 10 1 Java platform, Standard Edition, 101 ...

  • Sun Microsystems 1.2 - page 129

    Index 109 work directory, 106 ...

  • Sun Microsystems 1.2 - page 130

    110 Ja va ME TCK F ramework Dev eloper’ s Guide • July 2007 ...

Manufacturer Sun Microsystems Category Telephone Accessories

Documents that we receive from a manufacturer of a Sun Microsystems 1.2 can be divided into several groups. They are, among others:
- Sun Microsystems technical drawings
- 1.2 manuals
- Sun Microsystems product data sheets
- information booklets
- or energy labels Sun Microsystems 1.2
All of them are important, but the most important information from the point of view of use of the device are in the user manual Sun Microsystems 1.2.

A group of documents referred to as user manuals is also divided into more specific types, such as: Installation manuals Sun Microsystems 1.2, service manual, brief instructions and user manuals Sun Microsystems 1.2. Depending on your needs, you should look for the document you need. In our website you can view the most popular manual of the product Sun Microsystems 1.2.

A complete manual for the device Sun Microsystems 1.2, how should it look like?
A manual, also referred to as a user manual, or simply "instructions" is a technical document designed to assist in the use Sun Microsystems 1.2 by users. Manuals are usually written by a technical writer, but in a language understandable to all users of Sun Microsystems 1.2.

A complete Sun Microsystems manual, should contain several basic components. Some of them are less important, such as: cover / title page or copyright page. However, the remaining part should provide us with information that is important from the point of view of the user.

1. Preface and tips on how to use the manual Sun Microsystems 1.2 - At the beginning of each manual we should find clues about how to use the guidelines. It should include information about the location of the Contents of the Sun Microsystems 1.2, FAQ or common problems, i.e. places that are most often searched by users in each manual
2. Contents - index of all tips concerning the Sun Microsystems 1.2, that we can find in the current document
3. Tips how to use the basic functions of the device Sun Microsystems 1.2 - which should help us in our first steps of using Sun Microsystems 1.2
4. Troubleshooting - systematic sequence of activities that will help us diagnose and subsequently solve the most important problems with Sun Microsystems 1.2
5. FAQ - Frequently Asked Questions
6. Contact detailsInformation about where to look for contact to the manufacturer/service of Sun Microsystems 1.2 in a specific country, if it was not possible to solve the problem on our own.

Do you have a question concerning Sun Microsystems 1.2?

Use the form below

If you did not solve your problem by using a manual Sun Microsystems 1.2, ask a question using the form below. If a user had a similar problem with Sun Microsystems 1.2 it is likely that he will want to share the way to solve it.

Copy the text from the picture

Comments (0)