Hmm... According to the FAQ (http://jbehave.org/reference/stable/faq.html) it 
should be supported, there is even a code example :-/


On Apr 19, 2013, at 12:59 PM, Mauro Talevi wrote:

> Hi 
> 
> TestNG annotations are not supported. 
> 
> Have a look at example of multi threading:
> 
> https://github.com/jbehave/jbehave-core/tree/master/examples/threads
> 
> 
> On 19 Apr 2013, at 08:58, Kim Leppänen <[email protected]> wrote:
> 
>> I'm trying to create a Proof-of-Concept of using JBehave and TestNG 
>> together. What I want to do, is to run a story simultaneously in multiple 
>> threads in order to test my codes thread safety.
>> 
>> I have a simple class that only does one thing, calculates modulo 7 on a 
>> given integer value. I've created a simple BDD test for this class. I've set 
>> up my BDD test as described in JBehave "Getting started" documentation. The 
>> only difference is, that in my JUnitStory file, instead of using JUnit's 
>> @Test annotation, I've used TestNG's
>> 
>> @org.testng.annotations.Test(threadPoolSize = 10, invocationCount = 100, 
>> timeOut = 10000)
>> When I run the test, everything goes fine for the first 70-90% of the cases, 
>> then an exception occurs and the rest of the runs fail
>> 
>> ===============================================
>>   Default test
>>   Tests run: 100, Failures: 11, Skips: 0
>> ===============================================
>> 
>> 
>> The exception that occurs is
>> 
>> 
>> FAILED: run
>> java.util.concurrent.RejectedExecutionException
>>   at 
>> java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1774)
>>   at 
>> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:768)
>>   at 
>> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:656)
>>   at 
>> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)
>>   at org.jbehave.core.embedder.StoryManager.submit(StoryManager.java:203)
>>   at 
>> org.jbehave.core.embedder.StoryManager.runningStory(StoryManager.java:138)
>>   at 
>> org.jbehave.core.embedder.StoryManager.filterRunning(StoryManager.java:122)
>>   at 
>> org.jbehave.core.embedder.StoryManager.runningStoriesAsPaths(StoryManager.java:107)
>>   at 
>> org.jbehave.core.embedder.StoryManager.performStories(StoryManager.java:93)
>>   at org.jbehave.core.embedder.StoryManager.runStories(StoryManager.java:81)
>> ....
>> 
>> I'm relatively new to both JBehave and TestNG, so I was wondering if this 
>> could be simply a configuration issue or is it actually a bug in JBehave?
>> 
>> - Kim
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>> 
>>   http://xircles.codehaus.org/manage_email
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 


Reply via email to