FeaturesPluginsDocs & SupportCommunityPartners

Web Development - Applet Test Specification

Author: Karel Zikmund
Version: 2.1
Last update: 2005/06/27
Introduction: Support for applet development in NetBeans.
Comment:

Table of Contents

Test suite 1: Create and use standalone applet

Purpose: Create and use new standalone applet (not part of web application).
Setup:

#Test caseDescription
1Create applet
  1. Create new Java Class Library project (File | New Project | General | Java Class Library)
    • In directory with space in its path
    • In directory with non-basic ASCII character in its path
  2. Create applet class:
    Create new Applet/JApplet class (File | New File | Java Classes | Applet/JApplet)
  3. Create indirectly inhereted applet class:
    Create class which inherits from class creted in previous step (IndirectlyInheretedAppletClass inherits from AppletClass inherits from Applet/JApplet)
RESULT:Java Class Library project with created applet classes.
2Run applet (without parameters)
  1. Run applet class (Applet class context menu | Run File)
  2. Run applet class created in directory with space or non-basic ASCII character
RESULT:Applet Viewer shows the applet.
3Run applet creating thread
  1. Create applet which creates another thread (e.g. in constructor):
    new Thread ().run();
  2. Run applet (Applet class context menu | Run File)
RESULT:Applet Viewer shows the applet (security policy is not incorporated).
4Run applet (with parameters)
  1. Copy applet HTML launcher from build directory into src directory besides applet class (into its package)
  2. Edit applet parameters in HTML launcher copy (in src directory)
  3. Run applet class (Applet class context menu | Run File)
  4. Run applet class with parameters created in directory with space or non-basic ASCII character in path
RESULT:Applet Viewer shows the applet. Parameters are passed to applet (see Applet Viewer menu | Applet | Info/Tag).
5Debug applet
  1. Debug applet class (Applet class context menu | Debug File)
  2. Verify debugging actions in applet:
    • Stop on breakpoint (set a breakpoint into code)
    • Step Into
    • Step Over
    • Step Out
    • Continue debugging
  3. Debug applet class created in directory with space or non-basic ASCII character in path
RESULT:Applet Viewer shows the applet. All debugging actions work as expected.

Test suite 2: Package applet into web application

Purpose: Create and use new applet as part of web application.
Setup:

#Test caseDescription
1Package applet into Web project
  1. Create Applet project (i.e. create Java Class Library project with Applet/JApplet class)
  2. Create Web Project
  3. Add Applet project file into Web project:
    1. Open Web project's Properties (project's context menu | Properties
    2. Packaging panel | WAR Content | Add Project | browse applet project
    3. Set Path in WAR in WAR Content table to point besides JSP/HTML which uses applet
  4. Use applet in a HTML or JSP
  5. Build Applet project
  6. Build Web project
Teardown: Tip: Use Java Console (browser integration) to unload cached classes/JAR files in browser).
RESULT:Applet JAR file is packed into web content of WAR file (e.g. explore dist/WAR file in Files window).
2Package applet into Web project - propagate modifications
  1. Make sure that Build Required Projects is turned on in Web project's Properties | Libraries panel
  2. Modify Applet library java code
  3. Run Web project
RESULT:Modifications in applet library are propageted into Web application.

Test suite 3: Using a library in applet

Purpose: Create and use new applet which uses a library.
Setup:

#Test caseDescription
1Create applet using a library
  1. Create applet Java Class Library project which uses a library HelpLib (NetBeans project or external JAR file)
  2. Add library HelpLib JAR file to the Applet library project classpath (Applet library project's Properties | Libraries panel)
  3. Make sure that Build Required Projects is turned on in Applet library project's Properties | Libraries panel
  4. Create Web application which packages applet (see previous scenario)
  5. Package library HelpLib into Web project:
    1. Open Web project's Properties (project's context menu | Properties
    2. Packaging panel | WAR Content | Add Project or Add JAR/Folder | browse library HelpLib project or JAR file
    3. Set Path in WAR in WAR Content table to point besides Applet project/JAR file
  6. Build Applet project
  7. Build Web project
RESULT:Applet JAR file and library JAR file are packed into web content of WAR file.
2Applet using a library - propagate modifications
  1. Make sure that Build Required Projects is turned on in Applet and Web project's Properties | Libraries panel
  2. Modify library HelpLib java code
  3. Run Applet in Applet project
  4. Modify library HelpLib java code (e.g. change method signature used in Applet project)
  5. Run Web project
RESULT:Modifications in library HelpLib are propageted into Applet and Web application.
3Debugging applet using a library
  1. Debug applet class in Applet project (Applet class context menu | Debug File)
  2. Verify debugging actions in HelpLib library:
    • Stop on breakpoint in HelpLib library code (set a breakpoint into code)
    • Step Into method in HelpLib library
    • Step Over in HelpLib library
    • Step Out in HelpLib library
    • Continue debugging
  3. Debug applet class created in directory with space or non-basic ASCII character in path
RESULT:Applet Viewer shows the applet. All debugging actions work as expected.

Generated: 2005 06 27 01:31
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by