📄 testjbpmdemoexception.java
字号:
/** * $Source: /home/ws/rz65/CVS-Repository/WorkflowProjects/JBPM-Demo/src/test/testjbpmdemo/TestJBPMDemoException.java,v $ * $Revision: 1.1 $ * $Date: 2005/03/05 12:16:30 $ * $Author: rz65 $ * * Copyright (c) 2005 Universitaet Karlsruhe (TH) / Rechenzentrum (RZ-UNI-UKA) * * RZ-UNI-KA makes no representations or warranties about the suitability * of this software, either express or implied, including but not limited * to the implied warranties of merchantability, fitness for a particular * purpose, or non-infringement. RZ-UNI-KA shall not be liable for any * damages as a result of using, modifying or distributing this software * or its derivatives. */package testjbpmdemo;import jbpmdemo.JBPMDemoException;import testjbpmdemo.AbstractJBPMDemoTestCase;import junit.framework.Test;import junit.framework.TestSuite;import junit.textui.TestRunner;/** * A test case for the class {@link JBPMDemoException}. * * <p> * * @version $Revision: 1.1 $ * @author mailto:harald.meyer@rz.uni-karlsruhe.de */public class TestJBPMDemoException extends AbstractJBPMDemoTestCase { /** * Builds a test case instance. * * @param name * The name of the case. */ public TestJBPMDemoException(String name) { super(name); } /** * The stand-alone run main method. * * @param args * The run-time arguments (ignored) */ public static void main(String[] args) { TestRunner.run(suite()); } /** * Creates a test suite from this class. * * @return The test suite that covers all test... methods */ public static Test suite() { return new TestSuite(TestJBPMDemoException.class); } protected void setUp() throws Exception { setUpMessage = "my-message-" + randomLong(); setUpOtherException = new Exception("other exception"); } private JBPMDemoException ex; private Exception setUpOtherException; private String setUpMessage; /** * Checks the first constructor. */ public void testConstructor1() { ex = new JBPMDemoException(setUpMessage, setUpOtherException); assertNotNull("message must not be null.", ex.getMessage()); assertEquals("message mismatch.", setUpMessage, ex.getMessage()); assertNotNull("cause must not be null.", ex.getCause()); assertSame("cause mismatch.", setUpOtherException, ex.getCause()); } /** * Checks the second constructor. */ public void testConstructor2() { ex = new JBPMDemoException(setUpMessage); assertNotNull("message must not be null.", ex.getMessage()); assertEquals("message mismatch.", setUpMessage, ex.getMessage()); assertNull("cause must be null.", ex.getCause()); } /** * Checks the third constructor. */ public void testConstructor3() { ex = new JBPMDemoException(setUpOtherException); assertNotNull("message must not be null.", ex.getMessage()); assertNotNull("cause must not be null.", ex.getCause()); assertSame("cause mismatch.", setUpOtherException, ex.getCause()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -