cancel
Showing results for 
Search instead for 
Did you mean: 

[Sticky] How to write a unit test

jbarrez
Star Contributor
Star Contributor
When encountering a bug in Activiti, the easiest way to reach the Activiti team and see it fixed is to create an issue in the Activiti Jira (http://jira.codehaus.org/browse/ACT).

Of course, a good description on how to reproduce the problem is crucial. But to make it really interesting for us (and to speed up things), the issue is accompanied by a unit test demonstrating the problem.

To simplify this process, we've created a 'unit test template' project which you can use: https://github.com/Activiti/activiti-unit-test-template
Add your failing unit test, zip up the project and attach it to the issue.

More about this template, read http://www.jorambarrez.be/blog/2012/09/24/how-to-write-a-unit-test/
27 REPLIES 27

kafeitu
Champ on-the-rise
Champ on-the-rise
When encountering a bug in Activiti, the easiest way to reach the Activiti team and see it fixed is to create an issue in the Activiti Jira (http://jira.codehaus.org/browse/ACT).

Of course, a good description on how to reproduce the problem is crucial. But to make it really interesting for us (and to speed up things), the issue is accompanied by a unit test demonstrating the problem.

To simplify this process, we've created a 'unit test template' project which you can use: https://github.com/Activiti/activiti-unit-test-template
Add your failing unit test, zip up the project and attach it to the issue.

More about this template, read http://www.jorambarrez.be/blog/2012/09/24/how-to-write-a-unit-test/

so good, I will use it to submit bugs. Smiley Tongue

powerranger520
Champ in-the-making
Champ in-the-making
thanks your share, it's usefull

criszhao
Champ in-the-making
Champ in-the-making
i'm getting error when i'm running unit test code you provided above.
The error messages:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
i've tried to add config in maven as metioned in userguide.
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.2</version>
</dependency>
however it does not work.
i've tried to add log4j, common-logging, slf4j jars to classpath and failed too.
can anyone help me? thanks a lot!

jbarrez
Star Contributor
Star Contributor

criszhao
Champ in-the-making
Champ in-the-making
I've updated the template to fix the logging: https://github.com/Activiti/activiti-unit-test-template/commit/a6b347263362d9b5385b81bd96cca225d2e16...
thanks a lot. It works now. :lol:

sonia600
Champ in-the-making
Champ in-the-making
Add your failing unit test, zip up the project and attach it to the issue

tassoc1
Champ in-the-making
Champ in-the-making
It seems that an account on Jira is required in order to submit a bug. How can I obtain it?
When I try to register, the following message is displayed:

"Not a member? To request an account, please contact your JIRA administrators."

But I can't find any administrators address.
Thanks in advance.

jbarrez
Star Contributor
Star Contributor

alxt
Champ in-the-making
Champ in-the-making
How perform unit-test for process with expression, calling service bean?
I try change activiti.cfg.xml, add my bean , but exception raised:
<code>    org.activiti.engine.ActivitiException: Unknown property used in expression: #{myBean.method()}</code>

In server this process working…