Jump to: navigation, search

Difference between revisions of "PDE/Testing/Scenarios"

< PDE‎ | Testing
(End-to-End Scenarios)
(Plug-in Search in Mixed Namespaces)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== End-to-End Scenarios ==
 
== End-to-End Scenarios ==
  
These scenarios will test a range of important functionality in PDE
+
These scenarios will test a range of important functionality in PDE.  Some of these areas are tested in more detail below.
 
* Plug-in/Feature/Update site/Product creation wizards
 
* Plug-in/Feature/Update site/Product creation wizards
 
* Plug-in/Feature/Update Site/Product editors
 
* Plug-in/Feature/Update Site/Product editors
Line 55: Line 55:
 
=== Export and Install ===
 
=== Export and Install ===
 
* Create an Eclipse plug-in that adds a view (see [[#End-to-End_Scenarios]])
 
* Create an Eclipse plug-in that adds a view (see [[#End-to-End_Scenarios]])
* Use the  
+
* Use the install into host option during export
 +
* Check that the plug-in can be uninstalled
 +
* Try increasing the plug-in version and upgrading the installed plug-in
  
 
=== Export and Import ===
 
=== Export and Import ===
Line 92: Line 94:
 
* Launch an old style application without p2
 
* Launch an old style application without p2
 
* Must use update configurator
 
* Must use update configurator
 +
 +
=== Target Weaving ===
 +
* When launching a runtime workbench its target platform will use plug-ins from the host's workspace
  
 
== Target Management ==
 
== Target Management ==
Line 133: Line 138:
 
* From the top level menu, select Search > Search... to bring up the Search dialog.
 
* From the top level menu, select Search > Search... to bring up the Search dialog.
 
* Click on the Plug-in Search tab.  Enter *.debug.ui.* as a search string.  Leave all defaults as-is.  Press the Search button.
 
* Click on the Plug-in Search tab.  Enter *.debug.ui.* as a search string.  Leave all defaults as-is.  Press the Search button.
* Verify that the Search view opens and that it contains 31 hits.
+
* Verify that the Search view opens and that it contains 36 (as of 3.6.2) hits; the hit count is assuming that you are testing on a vanilla Eclipse installation with no workspace bundles that reference a debug UI extension point.
 
* Double-click on the first hit to open the manifest editor of the org.eclipse.debug.ui plug-in.
 
* Double-click on the first hit to open the manifest editor of the org.eclipse.debug.ui plug-in.
 
* Verify that the editor opens to the plugin.xml source page and that the extension point ID is visible and correctly selected.  Also verify that the arrow in the margin is on the correct line.
 
* Verify that the editor opens to the plugin.xml source page and that the extension point ID is visible and correctly selected.  Also verify that the arrow in the margin is on the correct line.
Line 151: Line 156:
 
* Bring up the search dialog via Search > Search... from the top level menu.
 
* Bring up the search dialog via Search > Search... from the top level menu.
 
* On the Plug-in Search tab, enter org.eclipse.pde.core.* as the search string.  In the Limit To group, select Declarations.  Press the Search button.
 
* On the Plug-in Search tab, enter org.eclipse.pde.core.* as the search string.  In the Limit To group, select Declarations.  Press the Search button.
* Verify that the search view opens with 5 matches.
+
* Verify that the search view opens with 5 matches (4 if you are testing a version of Eclipse < 3.6).
 
* Double-click on the org.eclipse.pde.core.parsers search hit.  Verify that it correctly locates the extension point on the plugin.xml source page of the com.example.xyz plug-in.
 
* Double-click on the org.eclipse.pde.core.parsers search hit.  Verify that it correctly locates the extension point on the plugin.xml source page of the com.example.xyz plug-in.
 
* Double-click on the org.eclipse.pde.source search hit.  Verify that the extension point declaration is correctly located on the plugin.xml source page of the org.eclipse.pde.core plug-in.
 
* Double-click on the org.eclipse.pde.source search hit.  Verify that the extension point declaration is correctly located on the plugin.xml source page of the org.eclipse.pde.core plug-in.
Line 258: Line 263:
 
* Plug-ins, features, update sites, etc.
 
* Plug-ins, features, update sites, etc.
 
* Using templates
 
* Using templates
 +
 +
== Editors ==
 +
* Manifest, plugin.xml, build.properties
  
 
== Log View ==  
 
== Log View ==  
 
* We need some example logs to test
 
* We need some example logs to test
 +
 +
== Add to Java Search ==
 +
=== Add Target to Java Search ===
 +
* Turn on option from main preference page
 +
* Check that the External Libraries project is created and populated with correct dependencies
 +
* Change the active target platform and check the project
 +
* Restart Eclipse, make sure project is populated correctly
 +
* Turn off option from main preference page, make sure dependencies get removed
 +
 +
=== Manual Add to Java Search ===
 +
* Open Plug-ins View
 +
* Select different plug-ins, right click, add to java search
 +
* Select different plug-ins, remove them from java search
 +
* Make sure project is created / updated with each change
 +
 +
=== Combined Search ===
 +
* Turn on add target to java search from main preference page
 +
* Open Plug-ins View
 +
* Add some plug-ins to java search
 +
* You should be warned that this will put it in manual mode
 +
* Change target platform, search path shouldn't be updated
 +
 +
== P2 Integration ==
 +
 +
=== Export and Install ===
 +
* Create a new plug-in with a view/toolbar/etc
 +
* Export as plug-in, choose option to Install Into Host
 +
* Make sure options on second tab are disabled
 +
* Run the export, after restart the view should be available
 +
* Modify the code, make sure project has a qualifier in the version
 +
* Export and install again, make sure code was updated
 +
* Open the Installation Details through the About Dialog
 +
* Uninstall the patch
 +
* Check that p2 can treat the export location as a repository
 +
 +
=== p2 Enabled Selfhosting ===
 +
* Create an Eclipse Launch Configuration, turn on "Support Software Installation" option
 +
* Launch the self-hosted workbench
 +
* Run p2 operations (install, update, export and install, p2 pref pages)
 +
* Make sure that the profile has been written out in the configuration area and remains after restart
 +
* Make sure that the profile is recreated after shutting down and starting again

Latest revision as of 17:32, 20 January 2011

End-to-End Scenarios

These scenarios will test a range of important functionality in PDE. Some of these areas are tested in more detail below.

  • Plug-in/Feature/Update site/Product creation wizards
  • Plug-in/Feature/Update Site/Product editors
  • Launching

A Full Plug-in Development Cycle

  • From the top level menu, select Help > Cheatsheets... > Plug-in Development > Creating an Eclipse Plug-in. Press OK.
  • Go through this cheatsheet to explore all stages of the plug-in development cycle.

Creating an Rich Client Application

  • From the top level menu, select Help > Cheatsheets... > Plug-in Development > Creating a Rich Client Application. Press OK.
  • Go through this cheatsheet to create a standalone, fully-branded rich client application.

Import

Plug-in Import

  • Import from different targets (Eclipse installs, software sites, folders, etc.)
  • Import using current target, select a different target, or from a folder
  • Import as binary
    • Check that plug-in builds, plugin/manifest files, check plugin dependencies, check source available, check translation files, .properties and other resources
  • Import with linked source
    • Same checks as binary, also check that source links can be opened
  • Import with source
    • Same checks as binary, check that source folders exists and are in build.properties
    • Some plug-ins have multiple src folders (jdt.debug)
    • Some plug-ins automatically get imported as binary (swt)
    • Import plug-ins with no source, source in the target and internal source (source included in binary bundle during export)

Feature Import

  • Import from different target platform types (Eclipse installs, software sites, folders, etc.)
  • Import from a folder
  • Change binary import settings

Self-contained Workspace (Dani workspace)

  • Start with a new workspace
  • Disable your target platform (ensure preference page warns you)
  • Check out a plug-in from CVS that sits somewhere in the middle of the stack (org.eclipse.debug.ui)
  • The plug-in will have compile errors
  • Go to plug-in import wizard
  • Select "Import plug-ins and fragments required by existing workspace plug-ins"
  • After import, ensure plug-ins compile
    • Try importing as binary, with links, with source

Export

Plug-in Export

  • Export multiple plug-ins at once
  • Export into a folder and an archive
  • Change metadata creation
    • Check that multiple exports to same location updates metadata
  • Export with source, both internal and source bundles

Export and Install

  • Create an Eclipse plug-in that adds a view (see #End-to-End_Scenarios)
  • Use the install into host option during export
  • Check that the plug-in can be uninstalled
  • Try increasing the plug-in version and upgrading the installed plug-in

Export and Import

  • Export a new plug-in
    • Include internal source, package as individual jars
  • In a different workspace import the plug-in
    • Check that source and resources imported correctly

Feature Export

  • Export a custom feature or an imported feature
  • Test metadata generation
    • Can try installing the feature to test metadata
  • Other options work similar to #Plug-in_Export

Product Export

Launching

Launch Tabs

  • Change options on tabs and save the config
    • Tabs should not be dirty (apply enabled) when first opened
    • Some options disable other options

Common Cases

  • Check that workspace/log/config area clear options work
  • New configs should have arguments initialized from target platform
  • Turn on some tracing values

Plug-ins Tab

  • Test that table settings persist
  • Test automatic validation
  • Check start level settings (look at generated config.ini)

Launching with Update Manager

  • Launch an old style application without p2
  • Must use update configurator

Target Weaving

  • When launching a runtime workbench its target platform will use plug-ins from the host's workspace

Target Management

Preference Page

  • Warning if no target is active
  • Warning if backing file for active target is deleted
  • Preview pane shows locations in each target
  • Creating/editing/deleting/moving targets, hitting apply, etc shouldn't confuse the page
  • Restore defaults should select existing default target if available, create one if not

Edit Wizard / Editor

  • Create different types of targets
  • Both wizard and editor should be able to edit same file

Loading the RCP Target Definition

  • Open the Target Platform preference page via Window > Preferences... > Plug-in Development > Target Platform from the top level menu.
  • Press "Add...", select the "Template" radio button at the bottom of the wizard, and then choose the "Base RCP (with source)" target, and press "Next"
  • Verify that the "Locations" tab lists two features: org.eclipse.rcp and org.eclipse.rcp.source. Press "Finish".
  • Check (check box) the newly created target in the "Target Definitions" list to make it the active target.
  • Press OK to apply the changes and dismiss the preferences dialog.

Software Site Target Provisioner

  • Try different required software options (planner vs slicer problems)
  • Open the Target Platform preference pave via Window > Preferences... > Plug-in Development > Target Platform from the top level menu.
  • Press "Add...", ensure the "empty" target is selected, and press "Next".
  • Enter a name for the target definition - something like "Sofware Site Test".
  • Press "Add...", select "Software Site" and press "Next".
  • Use the "Add Software Site" page to select some IUs from a repository.
  • Pressing "Finish" will cause the required bundles to be downloaded and stored locally.
  • The "Plug-ins" tab will display all the bundles once they have been downloaded.
  • The "Software Site" provisioner allows specific versions of IUs to be selected.
  • You can add multiple sites to a target (although one is usually sufficient). However, this does allow for content to be derived from different sites (for example, the SDK from eclipse.org, and EMF from somewhere else).
  • You can add/remove sites/IUs from a target definition incrementally.
  • All target definitions share a local bundle pool (repository) in the org.eclipse.pde.core metadata area (.bundle_pool directory), and this respository is garbage collected as definitions are deleted.
  • All "software sites" contained in a target definition are managed by a p2 profile - but other locations (bundles sources) are not currently managed by the profile (for example, directories or installs). For this reason, it does not make a lot of sense to mix software sites with other types of locations.

Search

Classic Plug-in Search

  • From the top level menu, select Search > Search... to bring up the Search dialog.
  • Click on the Plug-in Search tab. Enter *.debug.ui.* as a search string. Leave all defaults as-is. Press the Search button.
  • Verify that the Search view opens and that it contains 36 (as of 3.6.2) hits; the hit count is assuming that you are testing on a vanilla Eclipse installation with no workspace bundles that reference a debug UI extension point.
  • Double-click on the first hit to open the manifest editor of the org.eclipse.debug.ui plug-in.
  • Verify that the editor opens to the plugin.xml source page and that the extension point ID is visible and correctly selected. Also verify that the arrow in the margin is on the correct line.
  • Using the Down Arrow in the Search view toolbar, navigate to the next hit.
  • Verify that the manifest editor for the org.eclipse.ant.ui plug-in opens with the extension hit visible and correctly selected.
  • Press the Down Arrow again. Verify that the selection moves to another hit within the same editor. Verify that a new editor does NOT open.
  • Close all manifest editors.

Plug-in Search in Mixed Namespaces

  • Bring up the New Plug-in Project creation wizard via File > New > Project... > Plug-in Project. Press Next.
  • Enter com.example.xyz as the project name. Press Next.
  • Accept all defaults and press Finish. Answer Yes when prompted to switch to the Plug-in Development perspective.
  • On the Extension Points page of the plug-in manifest editor, press Add...
  • Enter org.eclipse.pde.core.parsers as the extension point ID. Enter Parsers as the extension point name.
  • Uncheck the checkbox to edit the extension point schema. Press Finish.
  • Verify that the extension point was created. Save the file and close the editor.
  • Bring up the search dialog via Search > Search... from the top level menu.
  • On the Plug-in Search tab, enter org.eclipse.pde.core.* as the search string. In the Limit To group, select Declarations. Press the Search button.
  • Verify that the search view opens with 5 matches (4 if you are testing a version of Eclipse < 3.6).
  • Double-click on the org.eclipse.pde.core.parsers search hit. Verify that it correctly locates the extension point on the plugin.xml source page of the com.example.xyz plug-in.
  • Double-click on the org.eclipse.pde.source search hit. Verify that the extension point declaration is correctly located on the plugin.xml source page of the org.eclipse.pde.core plug-in.

PDE as a Java Search Participant

  • Check out the org.eclipse.pde.core plug-in project from HEAD.
  • Right-click on the org.eclipse.pde.core.plugin package and select References > Workspace from the context menu..
  • Verify that you get a search hit in the MANIFEST.MF file of the plug-in.
  • Double-click on the search hit. Verify that the manifest editor opens on the MANIFEST.MF source page with the org.eclipse.pde.core.plugin package highlighted in the Export-Package header.
  • Close the editor.
  • In the Package Explorer view, select References > Workspace from the context menu of the org.eclipse.pde.internal.core.variables.TargetHomeDynamicVariableResolver.
  • Verify that you get a search hit in the plugin.xml file of the plug-in.
  • Double-click on the search hit. Verify that TargetHomeDynamicVariableResolver is highlighted in the resolver attribute of the org.eclipse.core.variables.dynamicVariables extension.

Refactoring

Renaming Types

  • Bring up the New Plug-in Project creation wizard via File > New > Project... > Plug-in Project. Press Next.
  • Enter com.example.abc as the project name. Press Next.
  • Accept all defaults. Press Next.
  • Choose the Hello World template. Press Finish.
  • In the Package Explorer view, select Refactor > Rename... from the context menu of the com.example.abc.Activator type.
  • Enter BundleActivator as the new name and press Finish.
  • Turn to the MANIFEST.MF source tab of the plug-in editor and verify that there is no warning next to the Bundle-Activator header and that its value has been updated to reflect the new type name.
  • In the Package Explorer view, select Refactor > Rename... from the context menu of the com.example.abc.actions.SampleAction type.
  • Enter NewAction as the new name and press Finish.
  • Turn to the plugin.xml source tab of the plug-in editor and verify that there is no warnings in the margin and that the class attribute on line 21 references the new type name.

Renaming Packages and Subpackages

  • Turn to the Runtime page of the manifest editor of the com.example.abc plug-in.
  • In the Exported Packages section, press Add...
  • Verify that the selection dialog shows two packages. Select them both and save the file.
  • In the Package Explorer view, select the com.example.abc package and select Refactor > Rename... from the context menu.
  • In the Rename dialog, check the Rename subpackages checkbox.
  • Enter com.example.abc.def as the new package name. Press Finish.
  • Verify that NO warnings appear on the MANIFEST.MF or the plugin.xml files.
  • Turn to the MANIFEST.MF source tab of the plug-in editor and verify that the Bundle-Activator and Export-Package headers are now referencing the new package name.
  • Turn to the plugin.xml source tab of the plug-in editor and verify that the class attribute on line 21 references the new package name.

Cool Wizards

Externalize Manifests Wizard

  • Create a Hello World plug-in by repeating steps C1.1 - C1.4
  • Select the com.example.abc plug-in project and select Properties from its context menu.
  • On the Plug-in Development > Plug-in Manifest Compiler preference page, choose the Use project settings option.
  • Raise the severity level for Usage of non-exteranlized strings from IGNORE to ERROR. Press OK.
  • Answer Yes when prompted to rebuild the project.
  • Verify that the MANIFEST.MF file now has 2 errors and the plugin.xml has 4 errors.
  • Right-click on the com.example.abc project and select PDE Tools > Externalize Strings... from the context menu.
  • Verify that the Bundle-Name and Bundle-Vendor headers in the MANIFEST.MF file are flagged as non-extenalized.
  • Verify that there are four attributes in the plugin.xml that are flagged as non-externalized.
  • Accept all defaults and press Finish.
  • Verify that all errors have gone away.
  • Verify that a plugin.properties file was created at the root of the project containing six key-value pairs.
  • Verify that attributes/headers flagged in steps 8 and 9 now have keys that start with %

Organize Manifests Wizard

  • Check out the org.eclipse.pde.ui plug-in project from HEAD.
  • Open the manifest editor for the org.eclipse.pde.ui plug-in and go to the Runtime tab.
  • In the Exported Packages section, remove the org.eclipse.pde.ui.launcher and org.eclipse.pde.internal.ui.wizards.xhtml from the list.
  • Switch to the plugin.xml tab. On line 17, remove the $nl/ prefix from the value for the icon attribute. Save the file.
  • Bring up the Organize Manifests wizard via PDE Tools > Organize Manifests... from the context menu of the org.eclipse.pde.ui plug-in project.
  • Keep all default options. In the Internationalization section, check the first option. Press Finish.
  • This should undo the damage done in steps 3 and 4.
  • Select Compare With > Latest from HEAD from the context menu of the org.eclipse.pde.ui plug-in project.
  • Verify that there are no differences.

OSGi Applications

Create an OSGi bundle

  • Bring up the New Plug-in Project wizard via File > New > Project... > Plug-in Project. Press Next.
  • Enter com.example.bundle as the project name.
  • In the Target Platform section, choose the OSGi framework option. Leave Equinox as the selection. Press Next.
  • Accept all defaults. Press Next.
  • Choose the Hello OSGi Bundle template. Press Finish.
  • Verify that the manifest editor opens but does NOT show the Extensions and Extension Points tabs.

Run an OSGi bundle

  • Select Run As > Equinox Framework from the context menu of the com.example.bundle project.
  • Verify that the Console view opens and that it contains an osgi> prompt.
  • Verify that it says Hello World!! at the prompt
  • Press Enter to get a new prompt. Position the cursor after the > and type ss to display the list of installed bundles.
  • Verify that two bundles are listed as active: the system bundle and the com.example.bundle
  • Type stop 1 at the osgi> prompt to stop the com.example.bundle Bundle.
  • Verify that the message Goodbye World!! is printed to the console.
  • Type ss again at the osgi> prompt.
  • Verify that com.example.bundle is now listed as RESOLVED.
  • Type exit at the osgi> prompt to terminate the launch.

User Assistance

Context Help Editor

  • Bad XML
  • Spell checker
  • Button to register

Table of Contents Editor

  • Bad XML
  • Spell checker
  • Links to files
  • Button to register

Cheat Sheet Editor

Project Creation

  • Plug-ins, features, update sites, etc.
  • Using templates

Editors

  • Manifest, plugin.xml, build.properties

Log View

  • We need some example logs to test

Add to Java Search

Add Target to Java Search

  • Turn on option from main preference page
  • Check that the External Libraries project is created and populated with correct dependencies
  • Change the active target platform and check the project
  • Restart Eclipse, make sure project is populated correctly
  • Turn off option from main preference page, make sure dependencies get removed

Manual Add to Java Search

  • Open Plug-ins View
  • Select different plug-ins, right click, add to java search
  • Select different plug-ins, remove them from java search
  • Make sure project is created / updated with each change

Combined Search

  • Turn on add target to java search from main preference page
  • Open Plug-ins View
  • Add some plug-ins to java search
  • You should be warned that this will put it in manual mode
  • Change target platform, search path shouldn't be updated

P2 Integration

Export and Install

  • Create a new plug-in with a view/toolbar/etc
  • Export as plug-in, choose option to Install Into Host
  • Make sure options on second tab are disabled
  • Run the export, after restart the view should be available
  • Modify the code, make sure project has a qualifier in the version
  • Export and install again, make sure code was updated
  • Open the Installation Details through the About Dialog
  • Uninstall the patch
  • Check that p2 can treat the export location as a repository

p2 Enabled Selfhosting

  • Create an Eclipse Launch Configuration, turn on "Support Software Installation" option
  • Launch the self-hosted workbench
  • Run p2 operations (install, update, export and install, p2 pref pages)
  • Make sure that the profile has been written out in the configuration area and remains after restart
  • Make sure that the profile is recreated after shutting down and starting again