Hi,

thank you, for your awnser.

I have no explicit configuration of the surefire plugin in my pom file. I use 
the implicit default configuration of the plugin. I am not sure, whats the 
default value for the "parallel" setting.

At the end of each test method I reset the state of the singleton instance to 
the initial state. So I am able to execute the test methods in each order 
without failing. But in the case several methods run in parallel, the side 
effects between the threads may cause the tests to fail.

greetings

-------- Original-Nachricht --------
> Datum: Sat, 20 Nov 2010 19:55:06 +0100
> Von: Kristian Rosenvold <[email protected]>
> An: Maven Users List <[email protected]>
> Betreff: Re: parallel execution of unit tests

> The way I read your explanation, I am not entirely convinced anything is
> being run in parallel; look for the "maven-surefire-plugin" in your pom
> and see if the "parallel" setting is active.
> 
> Much more likely you have static state in your tests that fails when
> multiple test methods are being run in the same vm invocation. If you
> try to run ALL the tests within the class at once from eclipse I bet
> they will fail. In this case you simply need to reset the static state
> between each test.
> 
> 
> Kristian
> 
> state, and does not 
> lø., 20.11.2010 kl. 18.22 +0100, skrev Iron Eagle:
> > Hi,
> > 
> > I have a problem with the junit (3.8.1) tests in a mvane project. While
> each unit test is successfull when I start it within eclipse, maven fails,
> when executing the tests.
> > 
> > I figured out, that the test methods of my junit test are executed
> parallel. This is bad, since the class under test is singleton. So in every 
> test
> method, the same instance is used. This has side effects in each test
> method, what leads into a failure.
> > 
> > Is this a known problem? is there a simple way to force s sequential
> execution of the unit tests? (I use junit 3.8.1, so I can not use anotations
> like @Depends)
> > 
> > best regards
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

-- 
GMX.at - Österreichs FreeMail-Dienst mit über 2 Mio Mitgliedern
E-Mail, SMS & mehr! Kostenlos: http://portal.gmx.net/de/go/atfreemail

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to