|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| aoo-test/ | H | - | - | 27,001 | 22,497 |
| odf-validate/ | H | - | - | 31,362 | 27,009 |
| smoketestdoc/ | H | - | - | 2,993 | 2,101 |
| testassistant/ | H | - | - | 1,429 | 907 |
| testassistant.feature/ | H | - | - | 255 | 199 |
| testcommon/ | H | - | - | 9,874 | 5,641 |
| testgui/ | H | - | - | 20,727 | 17,357 |
| testuno/ | H | - | - | 42,668 | 28,154 |
| ODF-TESTING.md | H A D | 06-Nov-2026 | 6.7 KiB | 87 | 46 |
| README.md | H A D | 05-Nov-2026 | 6.7 KiB | 187 | 106 |
| build.xml | H A D | 02-Sep-2026 | 7.5 KiB | 200 | 155 |
| run | H A D | 25-Jan-2026 | 1.4 KiB | 30 | 6 |
| run.bat | H A D | 28-Feb-2025 | 1.3 KiB | 25 | 23 |
README.md
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18-->
19
20# Apache OpenOffice<sup>®</sup> Test
21
22Apache OpenOffice contains automated test suites that can be ran against the office. The test framework is written in **Java** and based on **JUnit 4**.
23
24This **trunk** branch is now the primary test suite for the **AOO41X** and **AOO42X** branches as well and those branches may not contain the latest tests or modifications.
25
26The test suite in main branches **AOO41X** and **AOO42X** can be ran against a normal installation of the office or a just built "installed" office.
27
28This currently requires the user running the tests to have previously built the office from source as some required dependencies for compiling the tests are used from the office build artifacts located in `main/solver`.
29Primarily these dependencies are things the Java UNO jars like juh, jurt, ridl, and unoil and tools like javamaker, regmerge, and idlc.
30
31This **trunk** branch has been updated to allow it to run "standalone" of an office build. The test suites in this branch do not require the user to have previously built the office. This **test** directory can also be copied to another location and used to test a builds of **trunk**, **AOO41X**, or **AOO42X**.
32
33This README is documentation for using the test suites without requiring an office build environment or having built the office from source in any branch.
34
35The Python harnesses that check ODF 1.2, 1.3 and 1.4 import, export and validity (`aoo-test` and `odf-validate`) are described in [ODF-TESTING.md](ODF-TESTING.md).
36
37## Prerequisites
38
39Apache Ant 1.10.x and Java JDK 1.8 are known to work. Windows platforms can use the 64-bit JDK even if OpenOffice has to use a 32-bit JRE.
40
41## Caution
42
43When switching branches especially between AOO versions it's recommended to delete the jars in `test/lib` which will make
44sure you get the correct versions of **JUnit** and **Hamcrest** libraries for your build since the test build will try to use the jars that are present but download the correct version if not found.
45
46## Installed Type Build Setup
47
48When we refer to an "installed" type build this means that you have built OpenOffice from source using build
49config flag `--with-package-format="installed"`.
50
51Compiling the tests now require an SDK to be included in the office directory layout. When compiling tests using an "installed"
52type build, the office and the SDK are in built into separate directories and need combined. One method is to copy them into
53the test directory layout.
54
55If you have just built an "installed" build of the office you should have environment variables set you can use.
56For example on my Linux machine my local OpenOffice source repo is `/home/carl/dev-git/openoffice` and my variables are set like this:
57
58```shell
59SOURCE_ROOT_DIR=/home/carl/dev-git/openoffice
60SRC_ROOT=/home/carl/dev-git/openoffice/main
61INPATH=unxlngx6.pro
62```
63
64If you are using a new terminal you can run your environment setup script from `main` like:
65
66```shell
67source ./LinuxX86-64Env.Set.sh
68```
69
70If you have not previously ran tests you may not have a `testspace` directory under `test`. If not create it:
71
72```shell
73mkdir $SOURCE_ROOT_DIR/test/testspace
74```
75
76And the directory for the office:
77
78```shell
79mkdir $SOURCE_ROOT_DIR/test/testspace/install
80```
81
82Now copy the "installed" office from the build location:
83
84```shell
85cp -r $SRC_ROOT/instsetoo_native/$INPATH/Apache_OpenOffice/installed/install/en-US/openoffice4 $SOURCE_ROOT_DIR/test/testspace/install/
86```
87
88Then copy the SDK into the office:
89
90```shell
91cp -r $SRC_ROOT/instsetoo_native/$INPATH/Apache_OpenOffice_SDK/installed/install/en-US/openoffice4/sdk $SOURCE_ROOT_DIR/test/testspace/install/openoffice4/
92```
93
94## Compiling the Tests
95
96The tests are built using Ant and passing an `openoffice.home` property with the location of the office needed for dependencies.
97
98"installed" build example:
99
100```shell
101ant -Dopenoffice.home="$PWD/testspace/install/openoffice4" compile
102```
103
104Or an office in the standard Linux installation directory:
105
106```shell
107ant -Dopenoffice.home="/opt/openoffice4" compile
108```
109
110Or Windows
111
112```shell
113ant -Dopenoffice.home="C:\Program Files (x86)\OpenOffice 4" compile
114```
115
116## Running Tests
117
118There are several test suites available. API test, Build Verification Test (BVT), Function Verification Test (FVT), and Performance Verification Test (PVT).
119
120The **API** test will test OpenOffice using UNO API tests ported from main/qadevOOo.
121
122The **Build Verification Test** Suite includes approximately fifty unit tests used for general build verification.
123
124The **Functional Verification Test** Suite includes almost nine hundred unit tests to more thoroughly test the office features and UI.
125_Not all tests are ran for each platform._
126
127### Running a Complete Test Suite
128
129BVT Example (Linux):
130
131```shell
132./run -Dopenoffice.home="$PWD/testspace/install/openoffice4" -tp bvt
133```
134
135BVT Example (Windows):
136
137```shell
138.\run.bat -Dopenoffice.home="C:\Program Files (x86)\OpenOffice 4" -tp bvt
139```
140
141FVT Example:
142
143```shell
144./run -Dopenoffice.home="$PWD/testspace/install/openoffice4" -tp fvt
145```
146
147API test Example (Linux):
148./run -Dopenoffice.home="$PWD/testspace/install/openoffice4" -tp api
149
150### Running a Single Class
151
152```shell
153./run -Dopenoffice.home="$PWD/testspace/install/openoffice4" -tc bvt.gui.BasicFunctionTest
154```
155
156### Running a Single Test Method
157
158```shell
159./run -Dopenoffice.home="$PWD/testspace/install/openoffice4" -tm bvt:bvt.gui.BasicFunctionTest.testFindFormulasAndValues
160```
161
162### Run Help
163
164```shell
165./run -help
166```
167
168## Test Results
169
170By default, the testing output is stored in `test/testspace/output.***` where *** is the test suite type.
171
172* result.xml: Test result in HTML.
173* result.html: Test result in XML.
174* screenshot/: Screenshot pictures when test assert is failed.
175
176Open `test/testspace/output.***/result.html` in your browser to see the testing report.
177
178## Cleaning Up
179
180Running clean will delete compiled classes and build directories.
181
182```shell
183ant clean
184```
185
186The `test/testspace` directory, test results and "installed" office if used need to be manually deleted when no longer needed.
187