// Initialize
long waitForLaunch = 750L;
// Make a new PojoBean
PojoBean bean = new PojoBean();
// Start a new job for Pojo to invoke and hold
Thread otherThread = new RunPojoBeanSuspend(bean);
otherThread.start();
// Let the process start
try
{
Thread.sleep(waitForLaunch);
}
catch (InterruptedException e)
{
throw new RuntimeException(e);
}
// Ensure we can't get the current invocation that's in
// the other Thread's scope
TestCase.assertEquals("Scoping of CurrentInvocation is not limited per Thread", null, CurrentInvocation
.getCurrentInvocation());
// Let the other Thread complete
synchronized(bean){
bean.notify();
}
// Wait for other thread to die
try
{