Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: reflect changes to running test cases and adding test cases to the test suite

...

  1. Create a new JUnit Plug-in Test
  2. Test page. Change Test Runner to be JUnit 3.
  3. Test page. Change Project to org.apache.geronimo.testsuite.v22.
  4. Test page. Change Test class to org.apache.geronimo.testsuite.v22.ui.EclipseUITest.
  5. Arguments page. Set the VM Arguments to -Xms256m -Xmx256m -XX:MaxPermSize=128m
  6. Main page. Select Run a product and select org.eclipse.platform.ide
  7. Main page. Find where the build installed the launcher and point the workspace location to the eclipse/eclipse/plugins directory that was created during the mvn install process. Set the workspace (on the main tab) to something similar to C:\g\devtools\eclipse-plugin\trunk\testsuite\launcher\eclipse\eclipse\jdt_folder
    Image Removed Image Added
    Image Added

Adding test cases

The following steps are required when adding new testcases test cases to the GEP testsuitetest suite. Note that each new Eclipse plugin is the equivalent of an new testsuite, with each testsuite comprised of a single or multiple testcasestest case uses the org.apache.geronimo.testsuite.v22.testCases extension point.

  1. Create a new testsuite plugin in the testsuite\plugins directory. In order to build and execute properly from maven this new plugin must contain both a META-INF\MANIFEST.MF and a plugin.xml.
  2. Similarly, this new plugin must contain a pom.xml file to build the plugin, plus a test.xml ant script to execute the testsuite testcases using ant. The best examples for all these files are the existing testsuite(s).
  3. The testsuite\plugins\pom.xml file should be updated to build the new plugin.
  4. class that extends org.apache.geronimo.testsuite.v22.ui.AbstractTestCase and implement the buildTestCase(), runTestCase(), cleanupTestCase() methods. Each test case should leave the server and the workspace in the same state as when it was started.
  5. AbstractTestCase has several fields that provide useful methods for test case implementation.
    workbenchShell - Simply the Eclipse frame and all its GUI components
    abbotHelper - a wrapper for Abbot. Use this to make the GUI perform actions.
    serverTasks - performs several generic actions that can be taken on the Geronimo server, including showing the server overview page and publishing projects.
    projectTasks - performs generic actions that can be taken on projects, including creating and deleting.
    workbenchTasks - performs generic actions that can be taken in Eclipse, including opening the internal browser and changing the perspective.
  6. Update plugin.xml to use the org.apache.geronimo.testsuite.v22.testCases extension point. The class for the extension point is the class created above.
    Code Block
    
    <extension point="org.apache.geronimo.testsuite.v22.testCases">
        <testCase class="org.apache.geronimo.testsuite.v22.ui.Tutorial5MinuteTest">
        </testCase>
    </extension>
    
    The testsuite\launcher\testsuite.xml and testsuite\launcher\testsuite.properties files must be updated to invoke and refer to the new testsuite plugin.

  7. There are actually two instances of Eclipse running while the testsuite is running. The first instance will use the testsuite\launcher\workspace as its workspace, and the second instance, used by the Junit testcasesJUnit test cases, will utilize the testsuite\eclipse\eclipse\jdt_folder directory as its workspace. Normally, each separate testsuite will delete this jdt_folder just prior to starting. However, if a testsuite requires some workspace artifacts from a previous testsuite (i.e., a defined Geronimo server), the test.xml for that testsuite should be modified to remove the delete ant task for the jdt_folder.If additional arguments need to be passed to the testsuite jvm, the extraVMargs property should be set in the test.xml ant script for that plugin. For example:
    Code Block
    <property name="extraVMargs" value="-XX:MaxPermSize=128m" />
    
  8. JUnit will call the EclipseUITest class. This class is the main driver for the test suite. It will do a quick verification test to validate that Geronimo was installed and will start the server. Next it will loop through all the test case extensions, running each in turn. After it has finished all the test cases, it will uninstall the Geronimo server and close Eclipse.
  9. Finally, the new test case Finally, the new testsuite plugin must build and execute without errors from the maven build. And subsequent to the build, it must import into Eclipse and execute from within Eclipse without errors.

...