|
From: Michal K. <mic...@gm...> - 2009-01-09 09:12:31
|
Hi,
I have the following JUnit test executed under JPF.
public class MathTest {
@Test
public void add() {
System.out.println("add");
int x = Verify.getInt(1, 2);
}
@Test
public void divide() throws Exception {
System.out.println("divide");
}
}
And I'm curious why the second test 'divide' is run twice. Firstly I thought
it's clear, the 'add' test generates two values in the variable 'x' so the
division will be invoked twice as well. But later I realized that x is a local
variable that shouldn't affect the rest of the class. I think the state of VM
before the division is invoked should be the same in both cases. Am I right or not?
Thanks
Michal
|