1 package com.sourceforge.jpatterns.core.configuration.model;
2
3 import com.zmicer.utils.LoggingUtils;
4 import junit.framework.Test;
5 import junit.framework.TestCase;
6 import junit.framework.TestSuite;
7 import org.apache.log4j.Logger;
8
9 /**
10 * $Author:: zmicer $<br/>
11 * $Rev:: 57 $<br/> * $Date:: 2007-08-23 09:16:37 #$<br/>
12 * $Date:: 2007-08-23 09:16:37 #$<br/>
13 */
14 public class JPatternsConfigsBeanTest extends TestCase
15 {
16 /**
17 * Logger instance.
18 */
19 final public static Logger LOG = Logger.getLogger(JPatternsConfigsBeanTest.class);
20
21 /**
22 * Instance of the covered class to be used below in the tests
23 */
24 private JPatternsConfigsBean m_jPatternsConfigsBean;
25
26 /**
27 * Contructor with name of test attribute.
28 *
29 * @param name name of the test
30 */
31 public JPatternsConfigsBeanTest(String name)
32 {
33 super(name);
34 m_jPatternsConfigsBean = new JPatternsConfigsBean();
35 }
36
37 /**
38 * Perform the set up functionality for the test.
39 *
40 * @throws Exception may occur in the case of some problems
41 */
42 public void setUp() throws Exception
43 {
44 super.setUp();
45 }
46
47 /**
48 * Perform the tear down functionality for the test
49 *
50 * @throws Exception may occur in the case of some problems
51 */
52 public void tearDown() throws Exception
53 {
54 super.tearDown();
55 }
56
57 /**
58 * Test suite method
59 *
60 * @return the built test suite
61 */
62 public static Test suite()
63 {
64 return new TestSuite(JPatternsConfigsBeanTest.class);
65 }
66
67 /**
68 * Tests {@link JPatternsConfigsBean#check}
69 *
70 * @throws Exception in the case smth. wrong occuried.
71 * @forversion 1.0
72 */
73 public void testCheck() throws Exception
74 {
75 // normal sub-case: no exception: check the default check result
76 try
77 {
78 assertTrue(m_jPatternsConfigsBean.check());
79 }
80 catch (Exception ex)
81 {
82 LoggingUtils.logException(LOG, ex, null, null);
83 fail("Exception should not occur for that case " + ex.getMessage());
84 }
85 }
86 }