views:

14

answers:

2

Hi

I m working on a client-server program, where there is no test at all. When i try to do some test with two server, it's look like both server is connected to the same database. I think the reason is some bad use of static field.

So i wonder, is there a way to start two VM in a junit test?

+1  A: 

You are talking deep voodoo here. You could accomplish your goal by firing up two VMs, then having the two unit tests communicate and coordinate.

You are probably better with 'end-to-end' testing, where you initiate the test against the client. The client talks to the server, then responds to your test. You then assert that the results are correct given the state of the database.

Fred Haslam
A: 

Thans for you answer, but that's my point i don't know to "fire up" two VM's. Is there an other way than manually run two time java (i meen in an automated Test not with a shell)

BenZen