Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "The Three Test Suite Modes"

 
Line 1: Line 1:
[PRE]
 
 
To ease the use of unit testing in our project, I have created three types of unit testing
 
To ease the use of unit testing in our project, I have created three types of unit testing
* Bare – clear Junit mode, the tester can exercise his class without referring to Eclipse API.
+
* Bare – clear Junit mode, the tester can exercise his class without referring to Eclipse API.
* Headless – using PHPIDE test framework, Eclipse API but still avoid referring to Eclipse workbench UI.
+
* Headless – using PHPIDE test framework, Eclipse API but still avoid referring to Eclipse workbench UI.
* GUI - using PHPIDE test framework along with Eclipse components without any constraints of UI.
+
* GUI - using PHPIDE test framework along with Eclipse components without any constraints of UI.
[/PRE]
+
  
Each one of the types has its own test suite, named: “<mode>TestSuite.java” and its own folder named “<mode>” under org.eclipse.php.test plug-in.  
+
 
 +
Each one of the types has its own test suite, named: “''<mode>''<code>TestSuite.java</code>” and its own folder named “''<mode>''” under <code>org.eclipse.php.test</code> plug-in.  
 
Creating a new test class under that folder automatically assigns the test into its test suite.
 
Creating a new test class under that folder automatically assigns the test into its test suite.
  
 
How to run / debug the suites
 
How to run / debug the suites
 
* Bare
 
* Bare
      Create Launch under the “Junit” element and direct to “org.eclipse.php.test.BareTestSuite” test class.  
+
# Create Launch under the “Junit” element and direct to “org.eclipse.php.test.BareTestSuite” test class.  
 +
[[Image:bare_test.jpg]]
 
* Headless
 
* Headless
      1. Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.HeadlessTestSuite” test class  
+
# Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.HeadlessTestSuite” test class  
      2. On the Main tab, choose “[No Application] – Headless mode” in the program to run filed.
+
# On the Main tab, choose “[No Application] – Headless mode” in the program to run filed.
      3. On the Arguments tab fill in the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=false” (disables the UI actions)
+
[[Image:headless_main.jpg]]
* GUI:
+
# On the Arguments tab fill in the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=false” (disables the UI actions)
      1. Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.GUITestSuite” test class  
+
[[Image:headless_arg.jpg]]
      2. On the Main tab, choose “org.eclipse.ui.ide.workbench” in the program to run filed.
+
* GUI:
      3. On the Arguments tab fill the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=true” (enables the UI actions)
+
# Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.GUITestSuite” test class  
 +
# On the Main tab, choose “org.eclipse.ui.ide.workbench” in the program to run filed.
 +
# On the Arguments tab fill the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=true” (enables the UI actions)

Revision as of 03:28, 23 November 2006

To ease the use of unit testing in our project, I have created three types of unit testing

  • Bare – clear Junit mode, the tester can exercise his class without referring to Eclipse API.
  • Headless – using PHPIDE test framework, Eclipse API but still avoid referring to Eclipse workbench UI.
  • GUI - using PHPIDE test framework along with Eclipse components without any constraints of UI.


Each one of the types has its own test suite, named: “<mode>TestSuite.java” and its own folder named “<mode>” under org.eclipse.php.test plug-in. Creating a new test class under that folder automatically assigns the test into its test suite.

How to run / debug the suites

  • Bare
  1. Create Launch under the “Junit” element and direct to “org.eclipse.php.test.BareTestSuite” test class.

Bare test.jpg

  • Headless
  1. Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.HeadlessTestSuite” test class
  2. On the Main tab, choose “[No Application] – Headless mode” in the program to run filed.

Headless main.jpg

  1. On the Arguments tab fill in the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=false” (disables the UI actions)

Headless arg.jpg

  • GUI:
  1. Create Launch under the “Junit Plug-in Test” element and direct to “org.eclipse.php.test.GUITestSuite” test class
  2. On the Main tab, choose “org.eclipse.ui.ide.workbench” in the program to run filed.
  3. On the Arguments tab fill the VM arguments “-ea -DCreateGolden=false -DEnableWorkbench=true” (enables the UI actions)

Back to the top