From: Steve F. <st...@m3...> - 2005-04-24 21:11:44
|
So what are we actually testing here? That SUT calls something that=20 incidentally forks a thread? Maybe the real solution is to encapsulate=20= that forking and mock /that/ behaviour. On the other hand, when Nat finishes his port of jMock, it will be=20 possible to implement something like a InTime constraint within the=20 framework. S. On 18 Apr 2005, at 22:48, Dean Hiller wrote: > Is there a way to use NMock to test subsystems that have different=20 > threads. > =A0 > Ie. I want to do something like this > =A0 > mockListener.setTimeout(10000); > =A0 > SysUnderTest.addClientListener(mockListener); > SysUnderTest.invokeToStart(); > =A0 > CalledMethod m =3D = mockListener.expectMethodCall(=93someMethodOnListener=94); > =A0 > Where expectMethodCall actually does a Monitor.Wait(timeout) because=20= > the method =93someMethodOnListener=94 is > Invoked on a different thread and not invoked on the=20 > SysUnderTest.invokeToStart() client thread(ie. The test thread) > =A0 > Is there a way to do this?=A0 Java=92s mocklib does this very nicely = for=20 > this type of testing.= |