Testing

There are several types of tests:

Unit Testing

Functional Testing

  • These are tests done from a running XWiki instance.
  • We are using Selenium RC to perform functional tests for GUI. We have created some JUnit extension to easily write Selenium tests in Java.
    • Existing tests can be found in trunks/xwiki-product-enterprise/distribution-test/selenium-tests/
  • We are using JUnit to perform functional tests for XMLRPC code. We have a JUnit extension framework for that too.
    • Existing tests can be found in trunks/xwiki-product-enterprise/distribution-test/xmlrpc-tests/
  • To run these tests on your local machine go to trunks-devs/ and type mvn install -Pxe,ci. This will build XWiki Enterprise and it's dependencies and run the tests on that (-Pci is needed since the tests are enabled by default only on the CI machine). Also check the Building page for more details.
  • If you only want to execute the tests on an already built XWiki Core, simply go in trunks/xwiki-product-enterprise/distribution-test/ and type mvn install
  • To run a specific test, pass the pattern property as in: mvn install -Dpattern=DeletePageTest (this will run the DeletePageTest - Note that you don't have to specify the extension). In addition if you wish to execute only a specific method from a Test Case class, you can pass the patternMethod property as in: mvn install -Dpattern=DeletePageTest -DpatternMethod=testDeletePageCanDoRedirect.
  • To enable debug output from the selenium server start maven with the -Ddebug=true switch and then all messages from the selenium server are saved to: distribution-test/selenium-tests/target/selenium/server.log.
  • To debug a functional Selenium test in your favourite Java IDE go in distribution-test/selenium-tests, edit the pom.xml to replace <background>true</background> with <background>false</background>, run mvn install, start the XWiki product version you wish to test, go in your IDE, find the test you wish to run, put breakpoints and run it in debug mode. Not only will you get the Java debugging power but you can also see the browser in action, check the rendered page in the browser (using for Firebug example), etc.

Performance Testing

  • These are memory leakage tests, load tests and speed of execution tests.
  • They are performed manually and in an ad hoc fashion for now.
See the Profiling topic for details on how to use a profiler for detecting performance issues.
Version 2.1 last modified by VincentMassol on 01/06/2008 at 15:49

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: VincentMassol on 2007/03/07 13:33
This wiki is licensed under a Creative Commons license
1.4.1.10194