1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.call;
4   
5   import junit.framework.Test;
6   import junit.framework.TestCase;
7   import org.hansel.CoverageDecorator;
8   import org.virtualmock.call.InvokedCall;
9   import org.virtualmock.call.InvokedCallQueue;
10  import org.virtualmock.call.Signature;
11  
12  
13  /***
14   * Tests the InvokedCallQueue class
15   *
16   * @author Chad Woolley
17   * @version $Revision: 1.1 $
18   */
19  public class InvokedCallQueueTest extends TestCase {
20      InvokedCall call1 = null;
21      InvokedCall call2 = null;
22      InvokedCall call3 = null;
23      InvokedCallQueue queue = null;
24      Signature signatureA = null;
25      Signature signatureB = null;
26      Signature signatureC = null;
27      Signature signatureNotAdded = null;
28  
29      /***
30       * Hansel support
31       *
32       * @return the decorated Test
33       */
34      public static Test suite() {
35          CoverageDecorator cd = new CoverageDecorator(InvokedCallQueueTest.class,
36                  new Class[] { InvokedCallQueue.class });
37          cd.setDisplayStatistics(true);
38  
39          return cd;
40      }
41  
42      /***
43       * Set up the test
44       *
45       * @throws Exception any exception thrown during setup.
46       */
47      public void setUp() throws Exception {
48          super.setUp();
49          queue = new InvokedCallQueue();
50          signatureA = new Signature(String.class, "myMethod",
51                  new Class[] { String.class, Integer.class });
52  
53          // signatureB and signatureC are equal, but different objects 
54          signatureB = new Signature(String.class, "myMethod2",
55                  new Class[] { String.class, Integer.class });
56          signatureC = new Signature(String.class, "myMethod2",
57                  new Class[] { String.class, Integer.class });
58          signatureNotAdded = new Signature(String.class, "notAddedToQueue",
59                  new Class[] { String.class, Integer.class });
60          call1 = new InvokedCall(signatureA,
61                  new Object[] { "call1", new Integer(1) });
62          call2 = new InvokedCall(signatureB,
63                  new Object[] { "call2", new Integer(2) });
64          call3 = new InvokedCall(signatureC,
65                  new Object[] { "call2", new Integer(2) });
66      }
67  
68      /***
69       * Tear down the test
70       *
71       * @throws Exception any exception thrown during teardown.
72       */
73      public void tearDown() throws Exception {
74          super.tearDown();
75      }
76  
77      /***
78       * Placeholder for a future test
79       */
80      public void testPlaceholder() {
81      }
82  }