Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
SMILA/Development Guidelines/Howto set up test environment
Contents
Howto set up test environment
Introduction
There are no specific steps to do for a test environment. You only have to follow the steps, that are describted in Howto set up dev environment. And you have to develop your tests with Junit 3.8, because at the moment the build process is running the tests with Junit 3.8, too.
Commons Logging for Tests (Junit) in Eclipse
Please add a log4j.properties to your Eclipse Configuration Folder:
sample configuration File:Log4j.properties.zip
and add to every Junit Plugin Test Launch Configuration the following VM Arguments:
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dlog4j.configuration=file:${eclipse_home}configuration/log4j.properties -Xms40m -Xmx256m
Eclipse can be configured that it will add this lines every time a Junit Test Plugin Launch Configuration is created.
Following Configuration is needed for this:
Specific configurations for tests
Some test bundles contain additional configuration or test data files, you can recognize this in that the bundle contains a folder configuration. In this case usually the following VM arguments must be set:
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dlog4j.configuration=file:configuration/log4j.properties -Dorg.eclipse.smila.utils.config.root=./configuration
Additionally, there is often a config.ini file in this configuration folder that describes which bundles have to be autostarted before the test can run to enable the services to be tested. In this case, you can configure the test launch to use this file on the "Configuration" tab of the launch dialog by selecting "Use existing configuration file as a template" and entering ${workspace_loc:<name of test bundle>/configuration/config.ini} as the location. E.g. for bundle org.eclipse.smila.processing.test it should look like this: