[jbpm-dev] [Design of JBoss jBPM] - Major refactoring of the jbpm3 core test suite

thomas.diesler@jboss.com do-not-reply at jboss.com
Mon Sep 15 08:49:37 EDT 2008


Folks,

https://jira.jboss.org/jira/browse/JBPM-1733

I the search for a solution to the "schemaCreate() on setUp()" it became apparent that dropping/creating the schema on setup for every test (i.e. 300 times) during the testrun is not a valid option.

It is only slightly better, if not equally bad, to clear the schema on setup. This is because the code for clearing the schema currently does this is a very "unintelligent" way by dropping/recreating foreign key constraints before deleting table content in an arbitrary order. This approach is invalid because it requires the jbpmtest user to have alter table privileges and also executes a very large number of DLL statements.

Rather the opposite should be tested, which is that an "ordinary" jbpm user does not have the privileges to alter jbpm tables.

JUnit works on the premises that a test sets up its own fixture and tears it down after ward. Generally, it is incorrect to delegate the cleanup of test N to setup of test N+1. Only test N can know what records have been created and should be removed afterwards.

I refactored the testsuite according to the above, with the result that neither createSchema() nor clearSchema() is called during setUp or tearDown.

As a result, the execution time of mysql tests drops from 25min to 8min

http://jbws.dyndns.org:8280/hudson/job/jBPM-Matrix/container=jboss422,database=mysql,jdk=jdk1.6/buildTimeTrend

and the execution time of postgresql tests drops from 5h to 20min, which allows them to run at all.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176501#4176501

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176501



More information about the jbpm-dev mailing list