Closed GoogleCodeExporter closed 8 years ago
Hmmm, interesting.
Is this a real case from the code or you are testing mockito in anger?
Quickly thinking about implementation it seems quite difficult so I'm not sure
I will
fix it soon.
Original comment by szcze...@gmail.com
on 20 Jan 2010 at 6:42
Yes, I did encounter this issue on a real test case where I was expecting two
different kind of events on same trigger. I have no hatred against Mockito,
indeed it
is now my favourite mocking framework :)
The test case is of course only for reference.
I know, refactoring the test into the one below works around the problem and it
is
arguably a better test case:
@Test
public void abInorder(){
List list=mock(List.class);
fill(list);
InOrder inOrder = inOrder(list);
inOrder.verify(list).add("a");
inOrder.verify(list).add("b");
}
@Test
public void xyInorder(){
List list=mock(List.class);
fill(list);
InOrder inOrder = inOrder(list);
inOrder.verify(list).add("x");
inOrder.verify(list).add("y");
}
private void fill(List list) {
list.add("a");
list.add("x");
list.add("b");
list.add("y");
}
Original comment by bahri.ge...@gmail.com
on 20 Jan 2010 at 7:04
Oh I see ;)
Are you willing to take a stab at implementation?
Original comment by szcze...@gmail.com
on 20 Jan 2010 at 7:10
I think I've encountered the same problem. I wanted to test several ordered
events in
the same test, the order in the individual series of events was important, but
not
the order between the series. It worked on my local machine, but not on our CI
server.
What I mean to say is that I agree there are use cases for this scenario, other
than
"testing Mockito in anger" :)
Original comment by daniel.b...@gmail.com
on 10 Feb 2010 at 1:03
This issue is waiting for the patch from users
Original comment by szcze...@gmail.com
on 14 Feb 2010 at 12:34
Original comment by szcze...@gmail.com
on 14 Feb 2010 at 9:54
Original comment by szcze...@gmail.com
on 11 Mar 2010 at 10:24
This issue was closed by revision r1921.
Original comment by szcze...@gmail.com
on 14 Mar 2010 at 9:22
Original comment by szcze...@gmail.com
on 17 Mar 2010 at 8:32
Original issue reported on code.google.com by
bahri.ge...@gmail.com
on 20 Jan 2010 at 3:16