cancel
Showing results for 
Search instead for 
Did you mean: 

JUnit-Test with 50/50 chance to fail

ronnybr
Champ in-the-making
Champ in-the-making
Hello developer community,

I started working on ACT-1555 (https://jira.codehaus.org/browse/ACT-1555) and wrote a JUnit-test.
The code can be found here: https://github.com/rbraeunlich/activiti-unit-test-bean-lookup
Unfortunately, the test only has a 50/50 chance to show the error (at least it seems 50/50 to me Smiley Wink ).
Weld's BeanManager implementation uses a set to keep its resolved beans. The test fails (and shows the bug) only when the first bean in the set is not the @Alternative annotated bean.
I am not really satisfied with a test, which doesn't show the possible bug with certainty.
Do you guys hava an idea, how to write the test in a better way?
I also looked for a way to manipulate the BeanManager but didn't find one.
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Search the forum… Discussed recently

ronnybr
Champ in-the-making
Champ in-the-making
I am sorry, but which part of my question has been discussed recently?
BeanManager or JUnit tests that fail sometimes?
I can't find anything that matches my topic (only my thread, which led to the issue).

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
The 50/50 using the alternative…

http://www.lmgtfy.com/?q=cdi%20alternative%20activiti
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.