Bug 248924

Summary: [plug-in registry] pde.runtime unit tests
Product: [Eclipse Project] PDE Reporter: Jacek Pospychala <jacek.pospychala>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: bugday, helpwanted
Version: 4.0   
Target Milestone: 3.5 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 81322    
Attachments:
Description Flags
org.eclipse.pde.runtime.tests.zip
none
org.eclipse.pde.runtime.tests.zip
none
patch caniszczyk: iplog+

Description Jacek Pospychala CLA 2008-09-29 06:51:49 EDT
Similarly to bug 248508 for error log view, unit tests for pde.runtime may be of great benefit for everybody: plug-in maintainers as well as others who'd like to extend or reuse it.
Comment 1 Jacek Pospychala CLA 2008-10-23 09:55:30 EDT
Created attachment 115930 [details]
org.eclipse.pde.runtime.tests.zip

source code of tests plugin. It contains 3 classes:
AbstractRegistyModelTest - unit tests for registry model, independent from backend
LocalModelTest - run AbstractRegistryModelTests on Local backend
TestUtils - util classes used i unit tests

Additionally testplugins directory contains a simple plug-in that's used during install/uninstall to generate some real notifications from OSGi.
Comment 2 Jacek Pospychala CLA 2008-10-23 09:55:35 EDT
Created attachment 115931 [details]
org.eclipse.pde.runtime.tests.zip

source code of tests plugin. It contains 3 classes:
AbstractRegistyModelTest - unit tests for registry model, independent from backend
LocalModelTest - run AbstractRegistryModelTests on Local backend
TestUtils - util classes used i unit tests

Additionally testplugins directory contains a simple plug-in that's used during install/uninstall to generate some real notifications from OSGi.
Comment 3 Jacek Pospychala CLA 2008-10-23 09:56:59 EDT
Created attachment 115932 [details]
patch

Patch to pde.runtime, that makes all tests should pass.
I've found this issues when creating junit tests.
Comment 4 Jacek Pospychala CLA 2008-10-23 09:57:58 EDT
Tests give 48% coverage to pde.runtime.model package which contains all the logic behind the view.
Comment 5 Chris Aniszczyk CLA 2008-10-23 14:55:44 EDT
done.

> 20081023

Thanks Jacek! I moved and refactored the tests to live in the org.eclipse.pde.ui.tests plug-in.