1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.verify;
4   
5   import junit.framework.Test;
6   
7   import org.hansel.CoverageDecorator;
8   import org.virtualmock.test.testcase.EasyMockTestCase;
9   
10  
11  
12  /***
13   * Tests the VerificationManager class
14   *
15   * @author Chad Woolley
16   * @version $Revision: 1.2 $
17   */
18  public class VerificationManagerTest extends EasyMockTestCase {
19      VerificationManager verificationManager = null;
20  
21      /***
22       * Hansel support
23       *
24       * @return the decorated Test
25       */
26      public static Test suite() {
27          CoverageDecorator cd = new CoverageDecorator(VerificationManagerTest.class,
28                  new Class[] { VerificationManager.class });
29          cd.setDisplayStatistics(true);
30  
31          return cd;
32      }
33  
34      /***
35       * Set up the test
36       *
37       * @throws Exception any exception thrown during setup.
38       */
39      public void setUp() throws Exception {
40          super.setUp();
41          verificationManager = new VerificationManager(mockRuleManager);
42      }
43  
44      /***
45       * Tear down the test
46       *
47       * @throws Exception any exception thrown during teardown.
48       */
49      public void tearDown() throws Exception {
50          super.tearDown();
51      }
52  
53      /***
54       * Test unsuccessful verification
55       */
56      public void testVerify() {
57          mockRuleManager.checkAllRulesInCurrentPhase();
58          controlRuleManager.replay();
59  
60          verificationManager.verify();
61  
62          controlRuleManager.verify();
63      }
64  }