Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "SMILA/Development Guidelines/Howto set up test environment"

 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Howto set up test environment ==
+
#REDIRECT [[SMILA/Documentation/HowTo/Create_a_test_bundle_(plug-in)]]
 
+
=== Introduction  ===
+
 
+
There are no specific steps to do for a test environment. You only have to follow the steps, that are describted in [[SMILA/Howto set up dev environment|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.
+
 
+
All test bundles in SMILA now contain a launch configuration that should "just work", so the following steps of setting this up are only necessary for new  test bundles. In this case you should consult the rest of this page, but also have a look at existing test bundles for details, e.g. which bundles to start in the config.ini.
+
 
+
=== Commons Logging for Tests (Junit) in Eclipse ===
+
 
+
Please add a log4j.properties to your Eclipse Configuration Folder:
+
 
+
sample configuration [[Image:Log4j.properties.zip|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
+
 
+
[[Image:LoggingInEclipse.png]]
+
 
+
 
+
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:
+
 
+
[[Image:LoggingInEclipseAll.png]]
+
 
+
=== 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 <tt>configuration</tt>. 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 <tt>config.ini</tt> 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 <tt>${workspace_loc:<em><name of test bundle></em>/configuration/config.ini}</tt> as the location. E.g. for bundle <tt>org.eclipse.smila.processing.test</tt> it should look like this:
+
 
+
[[Image:SMILA-test-lauch-with-config-ini.png]]
+

Latest revision as of 06:58, 25 January 2012

Back to the top