CancellationException 异常

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());
        }

}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章