How to create a Plugin which holds all the libraries (jars) required by a RCP Application?
Plugin:
1. test.core.lib
2. testPluginA
Library: junit.jar
Procedure:
1. Create Plugin: test.core.lib - A non-UI contributing plugin. This plugin would have only one class: Activator.
2. Create folder:lib on test.core.lib project. Copy junit.jar to lib folder.
3. Modify Plugin.xml of test.core.lib, Open Runtime tab, add this jar in classpath and expose all the packages of this jar.
4. Create Plugin: testPluginA - A UI contributing plugin. This plugin would have a default view, perspective and application classes.
5. Modify Plugin.xml of testPluginA - Open Dependency tab, add dependency on test.core.lib plugin.
6. Create a ViewTest class which extends junit.framework.TestCase. Add a test method like :
public static void testMessageHelloWorld(){
System.out.println("Test Class invoked showing message: Hello World");
}
7. Open View class, call this method in View's createPartControl() method.
8. Run testPluginA as eclipse application.
9. The following message should be displayed in console:
"Test Class invoked showing message: Hello World".
Tuesday, May 20, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment