1 package com.sourceforge.jpatterns.core;
2
3 import junit.framework.Test;
4 import junit.framework.TestCase;
5 import junit.framework.TestSuite;
6 import org.apache.log4j.Logger;
7
8 /**
9 * $Author:: zmicer $<br/>
10 * $Rev:: 57 $<br/> * $Date:: 2007-08-23 09:16:37 #$<br/>
11 */
12 public class JPExceptionTest extends TestCase
13 {
14 /**
15 * Logger instance.
16 */
17 final public static Logger LOG = Logger.getLogger(JPExceptionTest.class);
18
19 /**
20 * Contructor with name of test attribute.
21 *
22 * @param name name of the test
23 */
24 public JPExceptionTest(String name)
25 {
26 super(name);
27 }
28
29 /**
30 * Perform the set up functionality for the test.
31 *
32 * @throws Exception may occur in the case of some problems
33 */
34 public void setUp() throws Exception
35 {
36 super.setUp();
37 }
38
39 /**
40 * Perform the tear down functionality for the test
41 *
42 * @throws Exception may occur in the case of some problems
43 */
44 public void tearDown() throws Exception
45 {
46 super.tearDown();
47 }
48
49 /**
50 * Test suite method
51 *
52 * @return the built test suite
53 */
54 public static Test suite()
55 {
56 return new TestSuite(JPExceptionTest.class);
57 }
58
59 /**
60 * Tests {@link JPException#JPException}
61 *
62 * @throws Exception in the case smth. wrong occuried.
63 * @forversion 1.0
64 */
65 public void testJPatternsException() throws Exception
66 {
67 /**
68 * Instance to be covered
69 */
70 JPException m_JPException = new JPException();
71
72 final String MESSSAGE = "message";
73 final RuntimeException exception = new RuntimeException(MESSSAGE);
74 m_JPException = new JPException(MESSSAGE);
75 m_JPException = new JPException(MESSSAGE, exception);
76 m_JPException = new JPException(exception);
77 }
78 }