Test and coverage
We have unit tests, regression tests, and feature tests for quality assurance.
We have tests under
test/ directory. There are several test data
There are two type of tests.
- Unit tests
- Linting tests
OmegaT project prepare JaCoCo test suite to check test coverage.
When you use IDE such as IntelliJ IDEA or Eclipse, please access Gradle task menu
verification group to launch
Otherwise, you can run it from terminal
A test report will be appeared in
you can examine the result on your web browser.
SpotBugs static analysis tool
You are recommend to check your code with SpotBugs static analysis tool. We check it on CI/CD environment for every commit. We treat all SpotBugs issues as error.
You should fix all the SpotBugs errors before posting the patch to core team. When you push a GitHub Pull-Request, we always check unit tests and spotbugs test.
You can run spotbugs through
verification task group of IDE's Gradle tasks menu
Otherwise, you can run it on terminal
A test result will be appeared in
You are recommended to write unit tests when you modify or add features anywhere in OmegaT code. Test codes are organized in several sections/packages.
TestCore and TestCoreInitializer
There are two core test classes to perform headless test cases.
TestCore class provide a
setUpCore method to setup temporal omegat configuration and
dummy GUI parts such as dummy main window, dummy menu items and dummy editor panes.
Test writer can inherit
TestCore class and then concentrate to write actual cases.
Unit test for GUI is a bit difficult to write.
Many test cases use
SwingUtilities#invokeAndWait to change or get GUI properties.
Then it assert its value.
Filter writer are strongly recommended to write tests with variety of source files. You are also recommended to write tests with variety of options combinations.
There are linting test cases under
test/src/svn/ directory, where the name
come from histrical reason, our project managed the code on subversion repository
from the start year 2002 to 2015.
We have three type of tests.
|Check Bundle*.properties and shortcut properties
|Check copyright header
|Check plugin properties integrity