@@ -0,0 +1,1153 @@
+package net.tascalate.concurrent;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.time.Duration;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class OrTimeoutExceptionTests %7B%0A    %0A    private TaskExecutorService executor;%0A%0A    @Before%0A    public void setUp() %7B%0A        executor = TaskExecutors.newFixedThreadPool(4);%0A    %7D%0A    %0A    @After%0A    public void tearDown() %7B%0A        executor.shutdown();%0A    %7D%0A    %0A    @Test%0A    public void testExceptionalOrTimeout() %7B%0A        Promise%3C?%3E p = %0A        CompletableTask%0A            .submit(this::doTask, executor)%0A            .orTimeout(Duration.ofSeconds(5L))%0A            .whenComplete((res, err) -%3E %7B%0A                if (res != null)%0A                    System.out.println(%22RESULT: %22 + res);%0A                else%0A                    System.out.println(%22ERROR: %22 + err.getMessage());%0A             %7D);%0A        p.join();%0A    %7D%0A    %0A    private String doTask () throws Exception %7B%0A        TimeUnit.SECONDS.sleep(3);%0A        if (null != System.out)%0A            throw new Exception(%22my error%22);%0A        return %22executed ok%22;%0A    %7D%0A%0A%7D%0A

Test for exceptional handling of Promise.orTimeout