From Developer Documents
Jump to navigation Jump to search


This package provides small set of tests for testing DB subsystem. Testing is divided into suites for different purposes as follows:

  • Regression: This suite is designed to verify the main functionality of the system. It should be run as often as possible when something changes.
  • Performance: This suite is designed to benchmark the solution.
  • Stress: This suite is designed to ensure long-term functionality of the solution. These tests are demanding and can only be run at selected times.


  • Individual tests and test suites can be run automatically or manually.
  • Handling of global paramters. These are among others:
    • running against virtual graph or server graph
    • transaction policy
    • java vm size
    • etc
  • Reporting of test results.
    • for individual tests and suites
      • performance time
      • configuration
    • history of previous tests

Running tests manually

Automated tests are run as ant script by hudson. The script is build.xml file in org.simantics.db.tests directory. The tests expect the same environment as the development environment for the db client i.e., etc.

The script needs to know where the target directory is. Target directory is the directory containing those dependent plugins that are not part of db client code, e.g. org.simantics.databord, etc. The default target directory is "${user.home}/targetDir". If this is not correct give the correct path with "-Dtarget.dir=<correct-path>".

  • Command "ant regression" runs the regression tests.
  • Command "ant performance" runs the performance tests.
  • Command "ant stress" runs the stress tests.

Running tests in Eclipse

Each test has its own launcher in launch directory and corresponding java class:

  • RegressionTests.launch and
  • PerformanceTests.launch and
  • StressTests.launch and
  • TempTests.launch and

Either run the launcher with run as junit test or open the class and run it as junit test. Note that the latter only works if you use run as junit. If you for example choose run as junit plugin test then eclipse will modify the launcher and thing will not work.

If you are using 64 bit eclipse the only way to get the tests working at the moment is to use 32 bit JRE.

Running tests in Hudson

The automated tests are run by Hudson. See [1]. The automated tests are run every night and the test environment is reloaded if there are any changes in the source plugins. See svn-externals properties [2] which is used by hudson to load tests environment. The target platform directory svn:target/branches/1.1 is not currently loaded automatically.

Writing tests using DB

Use the following test template:

public class TestXXX {
    Session session;
    public void connect() throws Exception {
        // Try to load and register the Driver instance with the driver manager

        // Connect to the server at the specified host and credentials.
        session = Manager.getSession("procore", InetSocketAddress.createUnresolved("localhost", 6667), 
                "Default User", "");        
    public void disconnect() throws Exception {
    public void sometest() throws Exception {
        // using session

The plugin must have org.simantics.db in dependency list and org.simantics.db.procore in imported packages list. Run the test as a plug-in test. It is enough to include the plugin org.simantics.db.procore.protocol and all its requirements to the run configuration of the test. You must run ProCore manually in port 6667 for the test to work.


Version SVN Source Tag
1.1.0 svn:db/tags/1.1.0/

Change Log


  • ...



  • Initial stab at regression test suite.
  • Initial stab virtual graph, transaction policy and vm parametrizations.