Search in sources :

Example 1 with CallableChainHandledException

use of org.eclipse.scout.rt.platform.job.internal.CallableChainHandledException in project scout.rt by eclipse.

the class JobAsyncExceptionTest method testExceptionInCallable.

@Test(expected = PlatformException.class)
public void testExceptionInCallable() throws Exception {
    P_JobManager jobManager = new P_JobManager();
    IFuture<Void> future = jobManager.schedule(new IRunnable() {

        @Override
        public void run() throws Exception {
            throw new PlatformException("Expected test exception");
        }
    }, Jobs.newInput().withRunContext(RunContexts.copyCurrent()));
    future.awaitDone();
    Assert.assertTrue(jobManager.e1 instanceof PlatformException);
    Assert.assertTrue(jobManager.e2 instanceof CallableChainHandledException);
    Assert.assertTrue(jobManager.e3 instanceof PlatformException);
}
Also used : PlatformException(org.eclipse.scout.rt.platform.exception.PlatformException) IRunnable(org.eclipse.scout.rt.platform.util.concurrent.IRunnable) CallableChainHandledException(org.eclipse.scout.rt.platform.job.internal.CallableChainHandledException) CallableChainHandledException(org.eclipse.scout.rt.platform.job.internal.CallableChainHandledException) PlatformException(org.eclipse.scout.rt.platform.exception.PlatformException) Test(org.junit.Test)

Aggregations

PlatformException (org.eclipse.scout.rt.platform.exception.PlatformException)1 CallableChainHandledException (org.eclipse.scout.rt.platform.job.internal.CallableChainHandledException)1 IRunnable (org.eclipse.scout.rt.platform.util.concurrent.IRunnable)1 Test (org.junit.Test)1