package test.java.util.concurrent; import java.util.concurrent.CancellationException; import org.junit.Test; /** * CancellationException的测试类 * 取消了一个任务,并再次尝试获取任务执行结果将抛出该异常 * @author zqw * @date 2020-06-29 21:29:37 */ public class CancellationExceptionTest { /** * * @Param * @author zqw */ @Test public void testConstruct0()throws Exception{ CancellationException testObj=new CancellationException(); System.out.println(testObj.getMessage()); } /** * * @Param * @author zqw */ @Test public void testConstruct1()throws Exception{ CancellationException testObj=new CancellationException("cancellationException"); System.out.println(testObj.getMessage()); } }
CancellationException 异常
最新推荐文章于 2024-09-03 16:36:19 发布