Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: test ::

interface XTest
Description
A simple interface to test a service or interface implementation.

Methods' Summary
testInvariant Test the object TestObject against the test specified with TestName. This test does not change the semantic state of the object, so it can be called on a existing component that will used further on. Note: This can be a strong test limitation. There are some components, that cannot perform their full test scenario.  
test Test the object TestObject against the test specified with TestName. This test changes the state of the object. The object may be useless afterwards (e.g., a closed XOutputStream). The method in general may be called multiple times with a new test object instance. Note: Each test scenario should be independent of each other, so even if a scenario didn't pass the test, the other test can still be performed. The error messages are cumulative.  
testMultiThread Test the object TestObject against the test specified with TestName using several threads. That does NOT mean that testMultiThread should implement a test using several threads but that this test method should be designed to be called by several threads. So for example, it has to take into consideration that a test object state that is changed by the method can be changed again by another thread. So it's not necessarily a mistake if an expected state can't be confirmed after setting it. Besides that, everything is the same as described for the test method. If this way of testing with multiple threads is not appropriate for the component to be tested this method should not be implemented (it should only return -1) and a special multithread test adapted to the special needs of testing this component should be integrated in the test method.  
addTestListener registers an event listener, which will be called for reporting errors/exceptions and warnings and for protocol purpuses.  
removeTestListener unregisters an event listener which was registered with XTest::addTestListener().  
Methods' Details
testInvariant
void
testInvariant( [in] string  TestName,
[in] ::com::sun::star::uno::XInterface  TestObject )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Test the object TestObject against the test specified with TestName. This test does not change the semantic state of the object, so it can be called on a existing component that will used further on. Note: This can be a strong test limitation. There are some components, that cannot perform their full test scenario.
Parameter TestName
the name of the test. Must be an interface, service, or implementation name. Note: The name is only used by the test component to distinguish between test scenarios.
Parameter TestObject
The instance to be tested.
Throws
IllegalArgumentException if the test does not support TestName or TestObject is null.
test
long
test( [in] string  TestName,
[in] ::com::sun::star::uno::XInterface  TestObject,
[in] long  hTestHandle )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Test the object TestObject against the test specified with TestName. This test changes the state of the object. The object may be useless afterwards (e.g., a closed XOutputStream). The method in general may be called multiple times with a new test object instance. Note: Each test scenario should be independent of each other, so even if a scenario didn't pass the test, the other test can still be performed. The error messages are cumulative.
Parameter TestName
The name of the test. Must be an interface, service, or implementation name. Note: The name is only used by the test component to distinguish between test scenarios.
Parameter TestObject
The instance to be tested.
Parameter hTestHandle
Internal test handle. Handle for first test is always 0. Handle of next test is returned by the method.
Returns
Handle of the next test. -1 if this was the last test.
Throws
IllegalArgumentException if the test does not support TestName or TestObject is null.
testMultiThread
long
testMultiThread( [in] string  TestName,
[in] ::com::sun::star::uno::XInterface  TestObject,
[in] long  hTestHandle )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Test the object TestObject against the test specified with TestName using several threads. That does NOT mean that testMultiThread should implement a test using several threads but that this test method should be designed to be called by several threads. So for example, it has to take into consideration that a test object state that is changed by the method can be changed again by another thread. So it's not necessarily a mistake if an expected state can't be confirmed after setting it. Besides that, everything is the same as described for the test method. If this way of testing with multiple threads is not appropriate for the component to be tested this method should not be implemented (it should only return -1) and a special multithread test adapted to the special needs of testing this component should be integrated in the test method.
Parameter TestName
The name of the test. Must be an interface, service or implementation name. Note: The name is only used by the test component to distinguish between test scenarios.
Parameter TestObject
The instance to be tested.
Parameter hTestHandle
Internal test handle. Handle for first test is always 0. Handle of next test is returned by the method.
Returns
Handle of the next test. -1 if this was the last test.
Throws
IllegalArgumentException if the test does not support TestName or TestObject is null.
addTestListener
void
addTestListener( [in] XTestListener  xListener );

Description
registers an event listener, which will be called for reporting errors/exceptions and warnings and for protocol purpuses.
removeTestListener
void
removeTestListener( [in] XTestListener  xListener );

Description
unregisters an event listener which was registered with XTest::addTestListener().
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.