Sun Microsystems 1.2 Bedienungsanleitung

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

Zur Seite of

Richtige Gebrauchsanleitung

Die Vorschriften verpflichten den Verkäufer zur Übertragung der Gebrauchsanleitung Sun Microsystems 1.2 an den Erwerber, zusammen mit der Ware. Eine fehlende Anleitung oder falsche Informationen, die dem Verbraucher übertragen werden, bilden eine Grundlage für eine Reklamation aufgrund Unstimmigkeit des Geräts mit dem Vertrag. Rechtsmäßig lässt man das Anfügen einer Gebrauchsanleitung in anderer Form als Papierform zu, was letztens sehr oft genutzt wird, indem man eine grafische oder elektronische Anleitung von Sun Microsystems 1.2, sowie Anleitungsvideos für Nutzer beifügt. Die Bedingung ist, dass ihre Form leserlich und verständlich ist.

Was ist eine Gebrauchsanleitung?

Das Wort kommt vom lateinischen „instructio”, d.h. ordnen. Demnach kann man in der Anleitung Sun Microsystems 1.2 die Beschreibung der Etappen der Vorgehensweisen finden. Das Ziel der Anleitung ist die Belehrung, Vereinfachung des Starts, der Nutzung des Geräts oder auch der Ausführung bestimmter Tätigkeiten. Die Anleitung ist eine Sammlung von Informationen über ein Gegenstand/eine Dienstleistung, ein Hinweis.

Leider widmen nicht viele Nutzer ihre Zeit der Gebrauchsanleitung Sun Microsystems 1.2. Eine gute Gebrauchsanleitung erlaubt nicht nur eine Reihe zusätzlicher Funktionen des gekauften Geräts kennenzulernen, sondern hilft dabei viele Fehler zu vermeiden.

Was sollte also eine ideale Gebrauchsanleitung beinhalten?

Die Gebrauchsanleitung Sun Microsystems 1.2 sollte vor allem folgendes enthalten:
- Informationen über technische Daten des Geräts Sun Microsystems 1.2
- Den Namen des Produzenten und das Produktionsjahr des Geräts Sun Microsystems 1.2
- Grundsätze der Bedienung, Regulierung und Wartung des Geräts Sun Microsystems 1.2
- Sicherheitszeichen und Zertifikate, die die Übereinstimmung mit entsprechenden Normen bestätigen

Warum lesen wir keine Gebrauchsanleitungen?

Der Grund dafür ist die fehlende Zeit und die Sicherheit, was die bestimmten Funktionen der gekauften Geräte angeht. Leider ist das Anschließen und Starten von Sun Microsystems 1.2 zu wenig. Eine Anleitung beinhaltet eine Reihe von Hinweisen bezüglich bestimmter Funktionen, Sicherheitsgrundsätze, Wartungsarten (sogar das, welche Mittel man benutzen sollte), eventueller Fehler von Sun Microsystems 1.2 und Lösungsarten für Probleme, die während der Nutzung auftreten könnten. Immerhin kann man in der Gebrauchsanleitung die Kontaktnummer zum Service Sun Microsystems finden, wenn die vorgeschlagenen Lösungen nicht wirksam sind. Aktuell erfreuen sich Anleitungen in Form von interessanten Animationen oder Videoanleitungen an Popularität, die den Nutzer besser ansprechen als eine Broschüre. Diese Art von Anleitung gibt garantiert, dass der Nutzer sich das ganze Video anschaut, ohne die spezifizierten und komplizierten technischen Beschreibungen von Sun Microsystems 1.2 zu überspringen, wie es bei der Papierform passiert.

Warum sollte man Gebrauchsanleitungen lesen?

In der Gebrauchsanleitung finden wir vor allem die Antwort über den Bau sowie die Möglichkeiten des Geräts Sun Microsystems 1.2, über die Nutzung bestimmter Accessoires und eine Reihe von Informationen, die erlauben, jegliche Funktionen und Bequemlichkeiten zu nutzen.

Nach dem gelungenen Kauf des Geräts, sollte man einige Zeit für das Kennenlernen jedes Teils der Anleitung von Sun Microsystems 1.2 widmen. Aktuell sind sie genau vorbereitet oder übersetzt, damit sie nicht nur verständlich für die Nutzer sind, aber auch ihre grundliegende Hilfs-Informations-Funktion erfüllen.

Inhaltsverzeichnis der Gebrauchsanleitungen

  • Seite 1

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

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 8

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

  • Seite 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[...]

  • Seite 10

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

  • Seite 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[...]

  • Seite 12

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

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 20

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

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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)[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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.[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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) . [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 42

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

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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.[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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> &[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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.[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 93

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

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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 [...]

  • Seite 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.[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 110

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

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 116

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

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 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.[...]

  • Seite 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[...]

  • Seite 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[...]

  • Seite 129

    Index 109 work directory, 106[...]

  • Seite 130

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