Listing 1: Example fragment of a TCK test

 /*       Copyright Block
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *     Description of Test Group
 * Applet constructor tests, Testing Applet creation
 */
package javasoft.sqe.tests.api.java.applet.Applet;

public class CtorTests extends ReadTest {  Class of Test Group
    /**
     /**     Description of Test Case
	   * Assertion testing for public Applet(),
     * Constructs Applet instance.
     */
    public Status Applet001() { Test Case #1
        Applet a = new Applet();
        if (a.isVisible() == true && a.isEnabled() == true
                && a.isValid() == false) { // Check result
            return Status.passed("OKAY");
        } else {
            return Status.failed("Incorrect Applet object created");
        }
    }
    public Status Applet002() { Test Case #2
...


Listing 2: Example fragment of a test in XML format

<TestGroup ID="Ctor">
      attributes of Test Group
<Description>Testing Applet creation</Description>
    <Package>java.applet</Package>
    <Class>Applet</Class>
    <Method>public Applet()</Method>
    <TestCase ID="Applet001"> attributes of Test Case
         <Assertion>Constructs Applet instance</Assertion>
         <TestCode><![CDATA[  Java source code of Test Case
    Applet a = new Applet();
    if (a.isVisible() == true && a.isEnabled() == true
            && a.isValid() == false) { // Check result
        return Status.passed("OKAY");
    } else {
        return Status.failed("Incorrect Applet object created");
    }]]></TestCode>
    <TestCase ID="Applet002"> Next Test Case
    ...
</TestGroup>

Listing 3: Example fragment of an annotated test source with meta-info

 package javasoft.sqe.tests.api.java.applet.Applet;

@TestGroup(
  testedClass=java.applet.Applet.class,
  testedMethod="public Applet()"
)
public class CtorTests extends ReadTest {
   /**
    * Assertion testing  for public Applet().
    * Constructs Applet instance.
    */
    @TestCase
    public Status Applet001() {
        Applet a = new Applet();
        if (a.isVisible() == true && a.isEnabled() == true &&
                a.isValid() == false) { // Check result
            return Status.passed("OKAY");
        } else {
            return Status.failed("Incorrect Applet object created");
        }
    }