1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.configuration;
4   
5   import java.io.InputStream;
6   import java.util.List;
7   import junit.framework.Test;
8   import junit.framework.TestCase;
9   import org.hansel.CoverageDecorator;
10  
11  
12  /***
13   * Tests the parsing of specific configuration data by the
14   * ConfigurationDigester class
15   *
16   * @author Chad Woolley
17   * @version $Revision: 1.4 $
18   */
19  public class ConfigDigesterDataTest extends TestCase {
20      ConfigDigester configDigester = null;
21      InputStream inputStream = null;
22      VMConfig vmConfig = null;
23  
24      /***
25       * Set up the test
26       *
27       * @throws Exception any exception thrown during setup.
28       */
29      public void setUp() throws Exception {
30          super.setUp();
31  
32          //        inputStream =
33          //            this.getClass().getResourceAsStream("virtualmock_sample.xml");
34          //        configDigester = new ConfigDigester(inputStream, false);
35          //
36          //        vmConfig = configDigester.getVMConfig();
37          // assertTrue(org.virtualmock.configuration.RuleConfig.class.isAssignableFrom(org.virtualmock.configuration.RuleConfig.class));
38      }
39  
40      /***
41       * Hansel support
42       *
43       * @throws Exception DOCUMENT ME! (Constructor Exception)
44       */
45  
46      //    public static Test suite() {
47      //        CoverageDecorator cd =
48      //            new CoverageDecorator(ConfigDigesterDataTest.class,
49      //                new Class[] {ConfigDigester.class});
50      //        cd.addTestClass(ConfigDigesterTest.class);
51      //        cd.setDisplayStatistics(true);
52      //
53      //        return cd;
54      //    }
55  
56      /***
57       * Tear down the test
58       *
59       * @throws Exception any exception thrown during teardown.
60       */
61      public void tearDown() throws Exception {
62          super.tearDown();
63      }
64  
65      /***
66       * DOCUMENT ME! (Method)
67       */
68      public void testDummy() {
69      }
70  
71      /***
72       * Tests that the classExclusionPattern configuration data can be correctly
73       * parsed.
74       */
75      public void xtestClassExclusionPatternIsDigested() {
76          List classExclusionPatterns = vmConfig.getClassExclusionPatterns();
77          assertNotNull(classExclusionPatterns);
78  
79          assertEquals(1, classExclusionPatterns.size());
80  
81          assertEquals("test.*", classExclusionPatterns.get(0));
82      }
83  
84      /***
85       * Tests that the RuleConfigs configuration data can be correctly parsed.
86       */
87      public void xtestRuleConfigsAreDigested() {
88          List ruleConfigs = vmConfig.getRuleConfigs();
89          assertNotNull(ruleConfigs);
90  
91          assertEquals(1, ruleConfigs.size());
92      }
93  
94      /***
95       * Tests that the VMConfig is not null after digestion.
96       */
97      public void xtestVMConfigIsCreatedAfterDigestion() {
98          assertNotNull(vmConfig);
99      }
100 }