|
|
About Complex-testcasesThe structure of the complex tests is
quite straightforward. You only have to inherit from a base class,
called ComplexTestCase (
The first method has to return all available test methods, while the second should return a sensible name of the object, functionality or combination thereof that is tested. You may implement two more methods:
The methods are not mandatory and do not have to be implemented if they are not needed. As suggested by their names, before() is called before all other test methods, after() when all the test methods did finish. Note:
As a general rule, the result of a test is “ok”. There are two functions available to change this:
The OOoRunner that will execute your complex test provides you also with additional helpers and utilities. (See OOoRunner reference for details.) Before your test starts, the OOoRunner will connect or start StarOffice and provide a logging mechanism. You can reach the office in your test with the test parameters, represented by the variable param. With param.getMSF() you can get a MultiServiceFactory from the office and build your test from there. The logging is available with the
variable log, which offers a
Sample Complex TestTo illustrate the mechanisms and helpers, a simple commented complex test “for beginners” is listed:
Start The Complex TestsThe complex tests can be started similar to the other tests of the OOoRunner. You have to give a test-base for the complex tests, since as default the test-base for java fat-office tests is used. This can either be done with a “-tb java_complex” in the command-line call of the runner or with a “TestBase=java_complex” if you use an ini-file. Confer the General User Guide for more details on this. The test has to be given with a full qualified class name. For the sample test above the call would be:
java org.openoffice.Runner -tb java_complex -o complex.sample.CheckIndexedPropertyValues 1 Normally it would have been assert(String message, boolean condition), but assert is a keyword in Java 1.4 and thus forbidden to use. Last change: $Date: 2004/03/10 15:58:37 $ |



