1
2
3 package org.virtualmock.configuration;
4
5 import junit.framework.Test;
6 import junit.framework.TestCase;
7 import org.hansel.CoverageDecorator;
8
9
10 /***
11 * Tests the RuleConfig class
12 *
13 * @author Chad Woolley
14 * @version $Revision: 1.1 $
15 */
16 public class RuleConfigTest extends TestCase {
17 RuleConfig ruleConfig = null;
18
19 /***
20 * Set up the test
21 *
22 * @throws Exception any exception thrown during setup.
23 */
24 public void setUp() throws Exception {
25 super.setUp();
26 ruleConfig = new RuleConfig();
27 }
28
29 /***
30 * Hansel support
31 *
32 * @return the decorated Test
33 */
34 public static Test suite() {
35 CoverageDecorator cd =
36 new CoverageDecorator(RuleConfigTest.class,
37 new Class[] {RuleConfig.class});
38 cd.setDisplayStatistics(true);
39
40 return cd;
41 }
42
43 /***
44 * Tear down the test
45 *
46 * @throws Exception any exception thrown during teardown.
47 */
48 public void tearDown() throws Exception {
49 super.tearDown();
50 }
51
52 /***
53 * Tests the addRuleType and getRuleType methods
54 */
55 public void testCanAddRuleType() {
56 String expectedRuleType = "org.virtualmock.ExampleRule";
57
58 ruleConfig.setRuleType(expectedRuleType);
59
60 String ruleType = ruleConfig.getRuleType();
61 assertEquals(expectedRuleType, ruleType);
62 }
63 }