PDE Test Scenarios
The following set of scenarios are designed to assist the Eclipse user community
explore and test the Plug-in Development Environment (PDE).
Note that the different scenarios are independent of each other and can be
executed in any sequence.
If you find a problem with a scenario step:
- Open a Bugzilla defect against
the PDE/UI component.
- Include the build number (e.g. 3.1RC1, 3.1RC2 etc.).
- Always
prefix the Summary of the defect with the step number.
Setup
- To be able to run the scenarios exactly as described below, you need
Eclipse 3.1 RC1 (or later) installed.
- Two steps that need to be done before executing any of the scenarios.
- Launch Eclipse on a new workspace.
- Dismiss the Welcome Page by clicking on the Go to Workbench
icon.
Scenario A: Your first plug-in in less than 10 minutes
Objective: This is the out-of-the-box experience scenario. We will
create a new plug-in, test it and deploy it in less than 10 minutes.
A0. Start the clock
A1. Creating a new plug-in project
- A1.1 Bring up the New Project Creation wizard
by selecting File > New > Project... from the top menu.
- A1.2 Select Plug-in Project from the list. Click
Next.
- A1.3 Enter com.example.xyz as the name of the plug-in
project. Click Next.
- A1.4 Accept all defaults on the Project Structure page.
Click Next.
- A1.5 Accept all defaults on the Plug-in Content page.
Click Next.
- A1.6 Select the Hello World template from the list.
Click Finish.
- A1.7 A dialog will come up asking you if you would like to
switch to the Plug-in Development perspective. Answer Yes.
- A1.9 A project will be created in your workspace, and the
manifest editor, which is used to edit and manage all the plug-in files,
will open on the Overview page.
- A1.10 Verify that the newly created project
contains: a src/ folder, a META-INF/ folder, an icons/ folder, a
build.properties file and a plugin.xml file.
A2. Testing the Plug-in
- A2.1 In the Testing section of the Overview
page of the manifest editor, click on the Launch an Eclipse application
link.
- A2.2 The Eclipse splash screen will appear, and a second
(runtime) workbench will appear within seconds.
- A2.3 In the runtime workbench, dismiss the Welcome
page. The Resource perspective will open.
- A2.4 Verify that there is a new top-level menu Sample Menu
in the menu bar and that it contains menu item Sample Action.
- A2.5 Select the menu item. Verify that the Hello World
dialog comes up. Dismiss the dialog.
- A2.6 Verify that there is a toolbar
button showing the blue Eclipse icon. Click it. The same Hello
World dialog will come up.
Dismiss the dialog.
- A2.7 Close the runtime workbench.
A3. Exporting the Plug-in
- A3.1 Select the com.example.xyz project in the Package
Explorer view. From the context menu, select Export... The
Export wizard will come up.
- A3.2 From the list of wizards, select the Deployable
Plug-ins and Fragments wizard. Click Next.
- A3.3 Verify that the com.example.xyz plug-in is
pre-selected in the wizard.
- A3.4 In the Export Destination section, select
directory.
- A3.5 browse for the installation location of the Eclipse
instance you are running. e.g. D:/Eclipse Click Finish.
- A3.6 When the export operation starts, verify that you see a
progress dialog where you have the option to run the operation in the
background if you choose to.
- A3.7 Go to the directory where you
exported the plug-in and verify that the plugins/ subdirectory of the Eclipse installation
now contains
a new JAR called com.example.xyz_1.0.0.jar
- A3.8 Shut down Eclipse and restart.
- A3.9 Verify that you see in your workbench the same Hello
World menu and toolbar button that you saw in steps A2.4-2.6.
- A3.10 Verify that the Hello World dialog comes up when you press
the toolbar button or the Sample Action menu item.
- A3.11 Delete the project from the workspace.
- A3.12 Close the workbench.
- A3.13 Delete com.example.xyz_1.0.0.jar from the Eclipse
installation.
A4. Stop the clock
Scenario B: Variations in Plug-in Project creation
B1. Creating a plug-in with a special encoding
- B1.1 Change the default encoding of text files to UTF-16BE
on the Window > Preferences...> General > Editors preference page.
- B1.2 Create a Hello World plug-in as described in section
A1 above.
- B1.3 Verify that: no error markers were
generated in the Problems view.
- B1.4 In the com.example.xyz package, open the
XyzPlugin.java file and make sure its content is
readable.
- B1.5 Select the XyzPlugin.java file in the
Package Explorer view and click Alt+Enter to bring up the
Properties dialog. Verify that the
encoding of the file has been set to UTF-16BE.
- B1.6 Repeat B1.5 for the build.properties file.
Verify that the encoding of this file has been set to ISO-8859-1.
- B1.7 Repeat B1.5 for the plugin.xml
file. Verify that the encoding of this file has been set to UTF-8.
- B1.8 Repeat B1.5 for the META-INF/MANIFEST.MF
file. Verify that the encoding of this file had
been set to UTF-8.
- B1.9 Delete the project you created in B1.2
- B1.10 Go back to the Windows > Preferences... >
General >
Editors preference page. Click Restore Defaults. Click
OK.
B2. Creating an old-style plug-in
- B2.1 Create a new plug-in project as described in section
A1 above, with two differences:
- When you get to the Project Structure page (step A1.4),
uncheck the Create an OSGi bundle manifest checkbox.
- When you get to the Templates page (step A1.6), select the
Plug-in with a View template. This template creates a sample
view that will be added to the Resource perspective.
- B2.2 Verify that the project created contains
the plugin.xml and build.properties files, and that the Java code
generated compiles without errors.
- B2.3 Bring up the Launch Configuration Dialog by
selecting Run > Run... from the top menu.
- B2.4 In the list of configuration types, check if there are
any configurations created of the type Eclipse Application (i.e. if there is
one left over from other scenarios). If so, reuse it and select the
Clear workspace data before launching checkbox on the Main tab of the
launch configuration. Otherwise create a new launch configuration and
keep all defaults.
- B2.5 Press Run to launch the application, and
answer Yes when/if asked to clear the workspace data.
- B2.6 When the runtime workbench appears, dismiss the Welcome
page. Verify that a Sample View appears at the bottom right corner of
the Resource perspective.
- B2.7 Close the runtime workbench.
- B2.8 Delete the project from the workspace.
B3. Manifest files on demand
- B3.1 Create an old-style plug-in as described in step
B2.1.
- B3.2 On the Overview page of the plug-in editor,
verify that the Plug-in Content section has a link that
offers to create an OSGi bundle manifest for the plug-in.
- B3.3 Take a look at the Dependencies and Runtime
tabs. Keep a mental picture of what they look like as they are about to
change.
- B3.4 Go back to the Overview page, and click on the
link to create an OSGi bundle manifest.
- B3.5 Verify that the link has now
vanished from the Plug-in Content section.
- B3.6 Verify that the editor now contains a manifest.mf
tab.
- B3.7 Verify that the Runtime tab
now contains an Exported Packages section and a Package Visibility
section.
- B3.8 Verify that the Dependencies
tab now contains an Imported Packages section.
- B3.9 Switch to the Build page.
Verify that the META-INF/ folder is checked in the Binary Build
section.
- B3.10 Delete the project from the workspace.
B4. Converting a Java project to a plug-in project
-
B4.1 File > New > Project... > Java Project.
Enter com.example.java for the project name. Click Finish.
Choose No when prompted to switch to the Java perspective.
-
B4.2 Right-click on the Java project and
select PDE Tools > Convert Projects to Plug-in Projects...
-
B4.3 The conversion wizard will come up.
Verify that com.example.java is pre-selected.
Press Finish.
-
B4.4 Open the .project file of the project.
Verify that the project now has a PDE
nature and two PDE builders.
-
B4.5 Verify that the project now has a
META-INF/MANIFEST.MF file with minimal content.
-
B4.6 Repeat B4.2. Verify that
the PDE Tools context menu no longer contains the conversion action.
It instead should contain some plug-in-specific actions (e.g. Update Classpath,
etc.)
-
B4.7 Delete the project from the workspace.
B5. The Bundlizer - Part I
- B5.1 Bring up the bundlizer via File > New > Project... >
Plug-in from existing JAR archives. Click Next.
- B5.2 On the first page of the wizard, press Add....
Verify that the dialog is empty.
- B5.3 Press Add External... From the plugins/org.eclipse.pde.build_3.1.0/
folder in your Eclipse installation, add pdebuild.jar. Click
Next.
- B5.4 Enter com.example.abc for the plug-in id.
Leave all defaults as-is. Press Finish.
- B5.5 Verify that 6 Java packages appear
at the root of the project.
- B5.6 Verify that the Bundle-Classpath
header in the META-INF/MANIFEST.MF file of the plug-in project is either
missing or has the value of '.' (without the quotes)
- B5.7 Delete the project from the workspace.
B6. The Bundlizer - Part II
- B6.1 Bring up the plug-in import wizard via File >
Import... > External Plug-ins and Fragments.
- B6.2 Leave all defaults as-is on the first page. Click
Next.
- B6.3 Type '*expr' (without the quotes) in the search field.
Verify that only one plug-in (org.eclipse.core.expressions)
gets selected.
- B6.4 Press Add. Verify that the
org.eclipse.core.expressions entry goes from the left to the right viewer.
Press Finish.
- B6.5 Bring up the bundlizer via File > New > Project... >
Plug-in from existing JAR archives. Click Next.
- B6.6 Press Add... Verify
that the dialog shows the org.eclipse.core.expressions project with all its
children filtered out except for the org.eclipse.core.expressions_3.1.0.jar.
- B6.7 Press OK to add the JAR. Click Next.
- B6.8 Enter com.example.def as the project name.
Uncheck the 'Unzip the JAR archives into the project' checkbox.
Press Finish.
- B6.9 Verify that the Bundle-Classpath
header in the META-INF/MANIFEST.MF file of the plug-in project has the value
of 'org.eclipse.core.expressions_3.1.0.jar' (without the quotes)
- B6.10 Delete the project from the workspace.
Scenario C: Plug-in Export
C1. Exporting plug-ins en masse as a directory
structure
- C1.1 Using the plug-in import wizard, import the
org.eclipse.core.commands, org.eclipse.core.expressions and
org.eclipse.core.filebuffers plug-ins as projects with
source folders.
- C1.2 Open the plug-in export wizard via File > Export... >
Deployable Plug-ins and Fragments.
- C1.3 Select all three plug-ins.
- C1.4 In the Export Destination section, select
directory. Enter a temp directory, e.g. D:\Temp
- C1.5 In the Export Options section, check the
Include source code option. Press Finish.
- C1.6 When the operation completes, verify that all
three
plug-ins are placed in a plugins subdirectory of the destination
specified in C4.4.
- C1.7 Verify that each plug-in is a
self-contained JAR with the name pattern <plugin_id>_<plugin_version>.jar.
- C1.8 Open each JAR with WinZip.
Verify that it contains source code under a src/ folder nested inside the JAR.
- C1.9 Delete all three JARs.
C2. Exporting plug-ins en masse as a
ZIP
- C2.1 Open the plug-in export wizard via File > Export... >
Deployable Plug-ins and Fragments.
- C2.2 Select all three plug-ins.
- C2.3 In the Export Destination section, select
Archive file. Enter the name of a ZIP file, e.g. D:\Temp\plugins.zip
- C2.4 When the operation completes, verify that the zip file
has been created in the correct location.
- C2.5 Open the ZIP file and verify that the path for all
its contents starts with plugins/.
- C2.6 Verify that the three JAR'd
plug-ins are inside the ZIP
file.
- C2.7 Delete the ZIP file
Scenario D: RCP Product Export
D1. RCP Mail
- D1.1 On a fresh workspace, bring up the New Plugin Project
wizard via File > New > Project... > Plug-in Project.
- D1.2 Enter com.example.mail for the project name.
Leave all defaults as-is. Click Next.
- D1.3 In the Rich Client Application section, choose
Yes. Click Next.
- D1.4 From the list of available templates, select the RCP
Mail Template. Press Finish.
- D1.5 Verify the creation of the
com.example.mail project. No errors/warnings should appear in the
Problems view.
- D1.6 In the Testing section of the Overview
page of the plug-in editor, click on the Launch an Eclipse
application link.
- D1.7 Verify that a splash screen comes
up. The splash screen confirms that we are launching in product
mode.
- D1.8 Verify that the mail application
comes up properly. Click on menus, buttons, etc., then close it.
- D1.9 Bring up the Product Configuration wizard via File >
New > Product Configuration.
- D1.10 Select the com.example.mail project as the
parent folder.
- D1.11 Enter mail.product as the file name.
- D1.12 In the 'Initialize file content' section, make
sure the first option is selected, with com.example.mail.product being
selected in the combo box. Press Finish.
- D1.11 In the Product Definition section of the
mail.product file, replace 'RCP Product' with 'La Poste'.
- D1.12 Switch to the Configuration page.
Verify that the list of plug-ins contains 11 plug-ins.
- D1.13 Remove all plug-ins from the list except for
com.example.mail.
- D1.14 Press Add Required Plug-ins.
Verify that the ten plug-ins you removed will now be
added back in.
- D1.15 In the Program Arguments section, enter '-nl ar'
without the quotes.
- D1.16 In the VM Arguments section, enter -Xmx256M
- D1.17 Switch to the Branding page.
- D1.18 In the Program Launcher section, enter your name as the
launcher name, e.g. Leonardo
- D1.19 Switch to the Overview page.
- D1.20 In the Exporting section, bring up the
Eclipse product export wizard via the link provided.
- D1.21 Verify that the location of the
product file is already preset in the Configuration field.
- D1.22 Set the name of the root directory to your last name,
e.g. Dicaprio
- D1.23 In the Export Destination section, select
directory. Enter a temp directory name, e.g.
D:\Temp. Press Finish.
- D1.24 Verify that your product has been
created under D:\Temp
and the root directory is named 'Dicaprio'.
- D1.25 Verify that the executable under
D:\Temp\Dicaprio is named Leonardo.exe (or
just Leonardo on Unix platforms).
- D1.26 Double-click on Leonardo.exe.
Verify that the splash screen shows up.
- D1.27 Verify that the application shows
up and everything is in reverse because we set the locale to Arabic in step
D1.15
- D1.28 Verify that in the Dicaprio
directory, there exists a Leonardo.ini file and that it contains the following
four words each on a separate line: -nl ar -vmargs -Xmx256M
Scenario E: Control over runtime classpath
E1. Selectively excluding output
folders
- E1.1 On a fresh workspace, create a Hello World plug-in named
com.example.xyz, as described in section A1.
- E1.2 Launch a runtime Eclipse application on a new workspace.
- E1.3 Test the Hello World plug-in as in section A2.
Verify that it works fine.
- E1.4 Close the runtime workbench.
- E1.5 Right-click on the com.example.xyz plug-in and
bring up its properties dialog.
- E1.6 Select the Self-Hosting property page.
- E1.7 Deselect the /com.example.xyz/bin folder.
This will prevent the runtime classloader from not finding these classes at
runtime. Click OK.
- E1.8 Launch a runtime Eclipse application.
- E1.9 Verify that when you select the Sample Action menu item from
the top Sample Menu, you will get a dialog saying "The chosen operation is not
currently available".
- E1.10 Open the log view of the runtime workbench via Window > Show
View > Error Log. Verify that it contains log entries about classloading
errors.
- E1.11 Double-click on one of the log entries. This will bring
up the Events Dialog. Use the Up and Down arrow to navigate from one
entry to the next.
- E1.12 Verify that the log entries that have a stack trace have a
different icon (one with a document background) than log entries with no stack
trace.
- E1.13 Close the runtime workbench.
Scenario F: Features and Update Sites
F1. Feature Creation
- F1.1 Create a plug-in project as in step A1.
- F1.2 Bring up the New Feature Creation wizard via File >
New...> Project > Plug-in Development > Feature Project.
- F1.3 Enter com.example.feature as the project
name. Click Next.
- F1.4 Set the feature name to Sample Feature. Click Next.
- F1.5 Select the com.example.xyz plug-in from F1.1. Press
Finish.
- F1.6 In the General Information section on the
Overview page of the feature editor, set to the Update site URL to
http://update.eclipse.org/testUpdates.
- F1.7 Set the Update site name to Main Eclipse
Update Site.
- F1.8 Switch to the Information page. Switch to
the Sites to Visit tab. Press Add.
- F1.9 Set the name of the discovery site to Main Eclipse Discovery Site
and the URL to
http://update.eclipse.org/testUpdates.
- F1.10 Save the file.
- F1.11 Switch to the feature.xml page.
Verify that the <plugin..> element has the unpack
attribute set to false.
F2.
Update Site Creation
- F2.1 Create a site project via File >
New...> Project > Plug-in development > Update Site Project. Click
Next.
- F2.2 Enter site as the name of the
project. Press Finish.
- F2.3 In the Managing The Site section, add the
com.example.feature and org.eclipse.pde features.
- F2.4 In the Managing The Site section,
press the Build All button.
- F2.5 Verify
that two feature JARs are created in the features folder of the site
project, and 8 plug-in Update JARs have been created in the plugins
folder.