Difference between revisions of "Checkapi"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
(Howto: change connection string from socket to named pipes)
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
=== Howto ===
 
=== Howto ===
 
At first you have to run a connectable office. This could be done by:
 
At first you have to run a connectable office. This could be done by:
./soffice "-accept=socket,host=0,port=8100;urp;"
 
 
When being on a machine used by more people, you should use a named pipe instead. You have to add the usage of the pipe in the [[RunnerProps]] file and start the office like this:
 
 
  ./soffice "-accept=pipe,name=$USER;urp;" &  # Unix
 
  ./soffice "-accept=pipe,name=$USER;urp;" &  # Unix
 
   soffice "-accept=pipemname=%USERNAME%;urp;" # Windows
 
   soffice "-accept=pipemname=%USERNAME%;urp;" # Windows
 +
 +
Since [[cwscheckapi|CwsCheckApi]]  is available the connection via socket is not the default anymore.
 +
DEPRECATED ./soffice "-accept=socket,host=0,port=8100;urp;"
 +
 +
In case of working on a shared machine, you should use a named pipe instead. Add the usage of the pipe in the [[RunnerProps]] file and start the office like this:
  
 
You can use any unique name as pipe name, but as the user-name is very well suited for this purpose, it is a good idea to use it.
 
You can use any unique name as pipe name, but as the user-name is very well suited for this purpose, it is a good idea to use it.
  
Now you can call CheckApi with an object to test as argument:
+
Now you can start CheckApi with an object as argument to test :
 
  checkapi -o <nowiki>sw.SwXBodyText</nowiki>
 
  checkapi -o <nowiki>sw.SwXBodyText</nowiki>
 
The ''runner'', which is called inside of the CheckApi, connects to the office and executes the UnoApiTest for the ImplementaionObject <nowiki>sw.SwXBodyText</nowiki>. Since CheckApi knows all interfaces of the ImplementationObject all correspond interface tests will be executed. At the end of such a test you will get a result of the test run.
 
The ''runner'', which is called inside of the CheckApi, connects to the office and executes the UnoApiTest for the ImplementaionObject <nowiki>sw.SwXBodyText</nowiki>. Since CheckApi knows all interfaces of the ImplementationObject all correspond interface tests will be executed. At the end of such a test you will get a result of the test run.
Line 31: Line 33:
 
;<tt><nowiki>checkapi -o sw.SwXBodyText::com::sun::star::text::Text -log true</nowiki></tt>:checks all properties of the service ''<nowiki>com::sun::star::text::Text</nowiki>'' on the ImplementationObject ''<nowiki>sw.SwXBodyText</nowiki>'' with enhanced output.
 
;<tt><nowiki>checkapi -o sw.SwXBodyText::com::sun::star::text::Text -log true</nowiki></tt>:checks all properties of the service ''<nowiki>com::sun::star::text::Text</nowiki>'' on the ImplementationObject ''<nowiki>sw.SwXBodyText</nowiki>'' with enhanced output.
  
;<tt>checkapi -p fwk</tt>:checks the hole project ''fwk'' with all its ImplementationObject""s.
+
;<tt>checkapi -p fwk</tt>:checks the module ''fwk'' with all its ImplementationObject's.
  
 
;<tt><nowiki>checkapi -sce myScenarioFile</nowiki></tt>:checks all objects and projects which described in the ScenarioFile.
 
;<tt><nowiki>checkapi -sce myScenarioFile</nowiki></tt>:checks all objects and projects which described in the ScenarioFile.
Line 37: Line 39:
  
 
-----
 
-----
 +
 
=== Parameter ===
 
=== Parameter ===
  
To control the CheckApi you can uses the RunnerProps file or some command line parameter.  
+
To control the CheckApi you can use the RunnerProps file or some command line parameter.  
  
The priority of the parameter is:
+
The priority of the parameters are:
 
# command line parameter
 
# command line parameter
 
# [[RunnerProps]] parameter
 
# [[RunnerProps]] parameter
 
# defaults
 
# defaults
  
== Command line parameter ==
+
-----
 +
 
 +
=== Command line parameter ===
 
;-log true: enhance the logging output
 
;-log true: enhance the logging output
 
;-debug true: enabled the debugging mode: enhancing of output
 
;-debug true: enabled the debugging mode: enhancing of output
 
;-p ''Project'':one complete project
 
;-p ''Project'':one complete project
 
;-sce ''[[ScenarioFile]]'':all jobs which are contained in the ScenarioFile
 
;-sce ''[[ScenarioFile]]'':all jobs which are contained in the ScenarioFile
;-o ''Test-Object'':The ImplementationObject which should be tested
+
;-o ''Test-Object'':the ImplementationObject which should be tested
 
;-tdoc ''Test-Document-Path'':path where testdocuments could be found
 
;-tdoc ''Test-Document-Path'':path where testdocuments could be found
 
;-<nowiki>AutoRestart true</nowiki>:forces to restart the office if one test crashes the office. Useful in [[ScenarioFile]]
 
;-<nowiki>AutoRestart true</nowiki>:forces to restart the office if one test crashes the office. Useful in [[ScenarioFile]]
;-<nowiki>KeepDocument</nowiki>:the tests normaly closes the documents which opened for testing purposes. If this flag is set to ''true'' all documents are available at the end of the test.
+
;-<nowiki>KeepDocument</nowiki>:the tests normally close the documents which opened for testing purposes. If this flag is set to ''true'' all documents are available at the end of the test.
 
;-ini ''[[RunnerProps]]'': path to property file for CheckAPI. Default: $HOME/.runner.props
 
;-ini ''[[RunnerProps]]'': path to property file for CheckAPI. Default: $HOME/.runner.props
  
[[Category:QA]]
+
[[Category:Quality Assurance]]
 
[[Category:UNO-API]]
 
[[Category:UNO-API]]

Latest revision as of 20:27, 5 May 2008

The CheckApi script is a simple script to run the UnoApiTest""s inside a solar shell for one ImplementaionObject with one or more interface tests. The CheckApi is based on the runner (see http://qa.openoffice.org/qadevOOo_doc/index.html)

Howto

At first you have to run a connectable office. This could be done by:

./soffice "-accept=pipe,name=$USER;urp;" &   # Unix
 soffice "-accept=pipemname=%USERNAME%;urp;" # Windows

Since CwsCheckApi is available the connection via socket is not the default anymore.

DEPRECATED ./soffice "-accept=socket,host=0,port=8100;urp;"

In case of working on a shared machine, you should use a named pipe instead. Add the usage of the pipe in the RunnerProps file and start the office like this:

You can use any unique name as pipe name, but as the user-name is very well suited for this purpose, it is a good idea to use it.

Now you can start CheckApi with an object as argument to test :

checkapi -o sw.SwXBodyText

The runner, which is called inside of the CheckApi, connects to the office and executes the UnoApiTest for the ImplementaionObject sw.SwXBodyText. Since CheckApi knows all interfaces of the ImplementationObject all correspond interface tests will be executed. At the end of such a test you will get a result of the test run.

***** State for sw.SwXBodyText ******
Whole component: PASSED.OK
*************************************
Job -o sw.SwXBodyText done

Examples

checkapi -o sw.SwXBodyText
checks all interfaces on the ImplementationObject sw.SwXBodyText
checkapi -o sw.SwXBodyText::com::sun::star::text::XText
checks the interface com::sun::star::text::XText on the ImplementationObject sw.SwXBodyText
checkapi -o sw.SwXBodyText::com::sun::star::text::XText,com::sun::star::text::XTextRange
checks the interface com::sun::star::text::XText and the inteface com::sun::star::text::XTextRange on the ImplementationObject sw.SwXBodyText
checkapi -o sw.SwXBodyText::com::sun::star::text::Text -log true
checks all properties of the service com::sun::star::text::Text on the ImplementationObject sw.SwXBodyText with enhanced output.
checkapi -p fwk
checks the module fwk with all its ImplementationObject's.
checkapi -sce myScenarioFile
checks all objects and projects which described in the ScenarioFile.



Parameter

To control the CheckApi you can use the RunnerProps file or some command line parameter.

The priority of the parameters are:

  1. command line parameter
  2. RunnerProps parameter
  3. defaults

Command line parameter

-log true
enhance the logging output
-debug true
enabled the debugging mode: enhancing of output
-p Project
one complete project
-sce ScenarioFile
all jobs which are contained in the ScenarioFile
-o Test-Object
the ImplementationObject which should be tested
-tdoc Test-Document-Path
path where testdocuments could be found
-AutoRestart true
forces to restart the office if one test crashes the office. Useful in ScenarioFile
-KeepDocument
the tests normally close the documents which opened for testing purposes. If this flag is set to true all documents are available at the end of the test.
-ini RunnerProps
path to property file for CheckAPI. Default: $HOME/.runner.props
Personal tools