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
|
Purpose: Create and use new standalone applet (not part of web application).
Setup:
| # | Test case | Description |
| 1 | Create applet |
-
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
-
Create applet class:
Create new Applet/JApplet class (File | New File | Java Classes | Applet/JApplet)
-
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. |
|
| 2 | Run applet (without parameters) |
- Run applet class (Applet class context menu | Run File)
- Run applet class created in directory with space or non-basic ASCII character
|
|
| RESULT: | Applet Viewer shows the applet. |
|
| 3 | Run applet creating thread |
-
Create applet which creates another thread (e.g. in constructor):
new Thread ().run();
- Run applet (Applet class context menu | Run File)
|
|
| RESULT: | Applet Viewer shows the applet (security policy is not incorporated). |
|
| 4 | Run applet (with parameters) |
- Copy applet HTML launcher from build directory into src directory besides applet class (into its package)
- Edit applet parameters in HTML launcher copy (in src directory)
- Run applet class (Applet class context menu | Run File)
- 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). |
|
| 5 | Debug applet |
- Debug applet class (Applet class context menu | Debug File)
-
Verify debugging actions in applet:
- Stop on breakpoint (set a breakpoint into code)
- Step Into
- Step Over
- Step Out
- Continue debugging
- 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. |
|
|
|
Purpose: Create and use new applet as part of web application.
Setup:
| # | Test case | Description |
| 1 | Package applet into Web project |
- Create Applet project (i.e. create Java Class Library project with
Applet/JApplet class)
- Create Web Project
-
Add Applet project file into Web project:
- Open Web project's Properties (project's context menu | Properties
-
Packaging panel | WAR Content | Add Project | browse applet project
- Set Path in WAR in WAR Content table to point besides JSP/HTML which uses applet
- Use applet in a HTML or JSP
- Build Applet project
- 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). |
|
| 2 | Package applet into Web project - propagate modifications |
- Make sure that Build Required Projects is turned on in Web project's Properties | Libraries panel
- Modify Applet library java code
- Run Web project
|
|
| RESULT: | Modifications in applet library are propageted into Web application. |
|
|
|
Purpose: Create and use new applet which uses a library.
Setup:
| # | Test case | Description |
| 1 | Create applet using a library |
- Create applet Java Class Library project which uses a library HelpLib (NetBeans project or external JAR file)
- Add library HelpLib JAR file to the Applet library project classpath (Applet library project's Properties | Libraries panel)
- Make sure that Build Required Projects is turned on in Applet library project's Properties | Libraries panel
- Create Web application which packages applet (see previous scenario)
-
Package library HelpLib into Web project:
- Open Web project's Properties (project's context menu | Properties
-
Packaging panel | WAR Content | Add Project or Add JAR/Folder | browse library HelpLib project or JAR file
- Set Path in WAR in WAR Content table to point besides Applet project/JAR file
- Build Applet project
- Build Web project
|
|
| RESULT: | Applet JAR file and library JAR file are packed into web content of WAR file. |
|
| 2 | Applet using a library - propagate modifications |
- Make sure that Build Required Projects is turned on in Applet and Web project's Properties | Libraries panel
- Modify library HelpLib java code
- Run Applet in Applet project
- Modify library HelpLib java code (e.g. change method signature used in Applet project)
- Run Web project
|
|
| RESULT: | Modifications in library HelpLib are propageted into Applet and Web application. |
|
| 3 | Debugging applet using a library |
- Debug applet class in Applet project (Applet class context menu | Debug File)
-
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
- 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