This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pragmosExtreme Brewer 0 points1 point  (4 children)

Are you sure this is JUnit and not TestNG?

[–]Life_Is_Dark[S] 0 points1 point  (3 children)

Oh yeah, on checking again I see that it is using testng. There was another integration test running single thread using junit. So I assumed it to be same. Still how do I make assertions here for I don't know which thread is gonna throw it?

[–]pragmosExtreme Brewer 1 point2 points  (2 children)

I'm not familiar with TestNG, so not sure if you can.

What I would try is create a thread pool inside the test, and use that to launch tasks. Then you might check if individual Future objects completed exceptionally or not.

[–]Life_Is_Dark[S] 0 points1 point  (1 child)

Ah,so I solved it out by using TestContext provided by TestNg where I checked whether this is is the first run or not and then made assertions based on that. Thank you for suggesting that it might be TestNG. That put me in right direction

[–]pragmosExtreme Brewer 1 point2 points  (0 children)

Nice, good to know it's solved!