Skip to content

Commit

Permalink
Using JUnit Plug-in for FAQ instead of PDE JUnit test
Browse files Browse the repository at this point in the history
This aligns with the UI usage in the Eclipse IDE
  • Loading branch information
vogella committed Nov 22, 2024
1 parent df01153 commit 819a7f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 11 additions & 17 deletions docs/FAQ/FAQ_What_is_a_PDE_JUnit_test.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# FAQ What is a JUnit Plug-in test?


FAQ What is a PDE JUnit test?
=============================

PDE JUnit tests are used to write unit tests for your plug-ins. The tests themselves look exactly like any other JUnit test, organized into TestCase subclasses, one test per method, with setUp and tearDown methods for creating and discarding any state required by the test.




The difference with PDE JUnit tests is in how they are executed. Instead of using the standard JUnit class TestRunner, PDE JUnit tests are executed by a special test runner that launches another Eclipse instance in a separate VM-just like a runtime workbench-and executes the test methods within that workbench. This means your tests can call Eclipse Platform API, along with methods from your own plug-in, to exercise the functionality you want to test.



JUnit Plug-in tests are used to write unit tests for your plug-ins.
The tests themselves look exactly like any other JUnit test.

PDE JUnit tests are launched by selecting your test class and pressing **Run > Run As > JUnit Plug-in Test**. On the **Arguments** tab of the launch configuration dialog, you can choose what Eclipse application will be used to run your tests. By default, the Eclipse IDE workbench is used. If you are not testing user-interface components, you can choose **\[No Application\] - Headless Mode**. If you have written your own Eclipse application-such as a rich client application-you will need to write your own test runner application as well.



The difference with JUnit Plug-in s is in how they are executed.
Instead of using the standard JUnit class TestRunner, JUnit Plug-in tests are executed by a special test runner that launches another Eclipse instance in a separate VM-just like a runtime workbench-and executes the test methods within that workbench.
This means your tests can call Eclipse Platform API, along with methods from your own plug-in, to exercise the functionality you want to test.

JUnit Plug-in tests are launched by selecting your test class and pressing **Run > Run As > JUnit Plug-in Test**.
On the **Arguments** tab of the launch configuration dialog, you can choose what Eclipse application will be used to run your tests.
By default, the Eclipse IDE workbench is used.
If you are not testing user-interface components, you can choose **\[No Application\] - Headless Mode**.
If you have written your own Eclipse application-such as a rich client application-you will need to write your own test runner application as well.



Expand Down
2 changes: 1 addition & 1 deletion docs/FAQ/The_Official_Eclipse_FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ This chapter describes the mechanics of plug-in development, such as creating pl
* [FAQ How do I add images and other resources to a runtime JAR file?](./FAQ_How_do_I_add_images_and_other_resources_to_a_runtime_JAR_file.md "FAQ How do I add images and other resources to a runtime JAR file?")
* [FAQ Can I add icons declared by my plugin.xml in the runtime JAR?](./FAQ_Can_I_add_icons_declared_by_my_plugin_xml_in_the_runtime_JAR.md "FAQ Can I add icons declared by my plugin.xml in the runtime JAR?")
* [FAQ When does PDE change a plug-in's Java build path?](./FAQ_When_does_PDE_change_a_plug-ins_Java_build_path.md "FAQ When does PDE change a plug-in's Java build path?")
* [FAQ What is a PDE JUnit test?](./FAQ_What_is_a_PDE_JUnit_test.md "FAQ What is a PDE JUnit test?")
* [FAQ What is a JUnit Plug-in testt?](./FAQ_What_is_a_PDE_JUnit_test.md "FAQ What is a JUnit Plug-in test?")
* [FAQ Where can I find the Eclipse plug-ins?](./FAQ_Where_can_I_find_the_Eclipse_plug-ins.md "FAQ Where can I find the Eclipse plug-ins?")
* [FAQ How do I find a particular class from an Eclipse plug-in?](./FAQ_How_do_I_find_a_particular_class_from_an_Eclipse_plug-in.md "FAQ How do I find a particular class from an Eclipse plug-in?")
* [FAQ Why do I get a 'plug-in was unable to load class' error when I activate a menu or toolbar action?](./FAQ_Why_do_I_get_a_plug-in_was_unable_to_load_class_error_when_I_activate_a_menu_or_toolbar_action.md "FAQ Why do I get a 'plug-in was unable to load class' error when I activate a menu or toolbar action?")
Expand Down

0 comments on commit 819a7f9

Please sign in to comment.