On Thu, May 8, 2008 at 2:38 AM, Richard Wallace
<[EMAIL PROTECTED]> wrote:
> throwing an exception, can we simply assume that if there is a
> currentUnitOfWork then we can just discard the unit? So
No. The check is in the tearDown so that people get the warning for
their own code under test (not the test itself) not behaving
correctly. Tests that uses UoW should (until we re-write Junit into a
QiUnit handling this properly) have the following pattern;
@Test
public void givenMoneyWhenBrokeExpectHappiness
throws Exception
{
UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
try
{
// your test stuff
uow.complete();
} catch( Exception e )
{
uow.discard();
throw e;
}
}
Ideas, design and implementation of a complete QiUnit, are greatly
appreciated, as usual, just dig in... How difficult can it be??
Cheers
Niclas
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev