1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_test_XSimpleTest_idl__
24#define __com_sun_star_test_XSimpleTest_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#endif
33
34
35//=============================================================================
36
37module com { module sun { module star { module test {
38
39//=============================================================================
40/**
41	A simple interface to test a service or interface implementation.
42*/
43published interface XSimpleTest: com::sun::star::uno::XInterface
44{
45	//-------------------------------------------------------------------------
46	/**
47		Test the object TestObject against the test specified with TestName. This test
48		does not change the semantic state of the object, so it can be called on a existing
49		component that will used further on.
50		Note : This can be a strong test limitation. There are some components, that cannot
51		perform their full test scenario.
52		@param TestName		the name of the test. Must be an interface, service or implementation name.
53		Note : The name is only used by the test component to distinguish
54		between test scenarios.
55		@param 	TestObject	The instance to be tested.
56
57		@throws IllegalArgumentException
58			if the test does not support TestName or TestObject is null.
59	*/
60	void testInvariant( [in] string TestName,
61			 [in] com::sun::star::uno::XInterface TestObject )
62			raises( com::sun::star::lang::IllegalArgumentException );
63
64	//-------------------------------------------------------------------------
65	/**
66		Test the object TestObject against the test specified with TestName. This test
67		changes the state of the object. The object may be useless afterwards.
68		(e.g. a closed XOutputStream). The method in general may be called multipe times with a new
69		test object instance.
70		Note : These tests should include the testInvariant test.
71		Note : Each test scenario should be independent of each other, so even if a scenario
72		didn't pass the test, the other test can still be performed. The error messages
73		are cumulative.
74
75		@param TestName		The name of the test. Must be an interface, service or implementation name.
76		Note : The name is only used by the test component to distinguish
77		between test scenarios.
78		@param 	TestObject	The instance to be tested.
79		@param   hTestHandle Internal test handle. Handle for first test is always 0.
80		Handle of next test is  returned by the method.
81		@return  Handle of the next test. -1 if this was the last test.
82
83		@throws IllegalArgumentException
84			if the test does not support TestName or
85		TestObject is null.
86	*/
87	long test( [in] string TestName,
88			 [in] com::sun::star::uno::XInterface TestObject,
89			 [in] long hTestHandle )
90			raises( com::sun::star::lang::IllegalArgumentException );
91
92	//-------------------------------------------------------------------------
93	/**States if one of the last test has failed. This is cumulative.
94		@return true if all test have been passed successfully. false if an error has occurred.
95
96	*/
97	boolean testPassed();
98
99	//-------------------------------------------------------------------------
100	// DOCUMENTATION MISSING FOR XSimpleTest::getErrors
101	sequence<string> getErrors();
102
103	//-------------------------------------------------------------------------
104	// DOCUMENTATION MISSING FOR XSimpleTest::getErrorExceptions
105	sequence<any> getErrorExceptions();
106
107	//-------------------------------------------------------------------------
108	// DOCUMENTATION MISSING FOR XSimpleTest::getWarnings
109	sequence<string> getWarnings();
110
111};
112
113//=============================================================================
114
115}; }; }; };
116
117#endif
118