1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.rule;
4   
5   import java.util.Map;
6   import junit.framework.TestCase;
7   
8   
9   /***
10   * Tests the RuleParser class.
11   *
12   * @author Chad Woolley
13   * @version $Revision: 1.3 $
14   */
15  public class RuleParserTest extends TestCase {
16      RuleParser ruleParser = null;
17      String key = null;
18      int ruleEnforcementLevel = -1;
19  
20      /***
21       * Set up the test
22       *
23       * @throws Exception any exception thrown during setup.
24       */
25      public void setUp() throws Exception {
26          super.setUp();
27          System.out.print("TODO: " + this.getClass() + " IS DISABLED");
28          ruleParser = new RuleParser();
29          key = "ALL_RECORDED_CALLS_MUST_BE_INVOKED";
30  
31          ruleEnforcementLevel = Rule.FAIL;
32      }
33  
34      /***
35       * DOCUMENT ME! (Method)
36       */
37      public void xtestCanGetRules() {
38          // TODO: parser doesn't work under Junit, but works from main method!
39          Map ruleEnforcementLevels = ruleParser.getRuleEnforcementLevels();
40          Integer ruleEnforcementLevelInteger =
41              (Integer) ruleEnforcementLevels.get(key);
42          int parsedRuleEnforcementLevel = ruleEnforcementLevelInteger.intValue();
43          assertEquals(ruleEnforcementLevel, parsedRuleEnforcementLevel);
44      }
45  
46      /***
47       * Hansel support
48       */
49  
50      /*
51         public static Test suite() {
52             CoverageDecorator cd = new CoverageDecorator(RuleParserTest.class,
53                     new Class[] { RuleParser.class });
54             cd.setDisplayStatistics(true);
55             return cd;
56         }
57       */
58      public void testDummy() {
59      }
60  }