1
2
3 package org.virtualmock.matcher;
4
5 import junit.framework.Test;
6 import junit.framework.TestCase;
7 import org.hansel.CoverageDecorator;
8
9
10 /***
11 * Tests the AlwaysMatcher class
12 *
13 * @author Chad Woolley
14 * @version $Revision: 1.2 $
15 */
16 public class AlwaysMatcherTest extends TestCase {
17 ArgMatcher matcher = null;
18
19 /***
20 * Test constructor
21 *
22 * @param testTitle title of the test
23 */
24 public AlwaysMatcherTest(String testTitle) {
25 super(testTitle);
26 }
27
28 /***
29 * Hansel support
30 *
31 * @return the decorated Test
32 */
33 public static Test suite() {
34 CoverageDecorator cd =
35 new CoverageDecorator(AlwaysMatcherTest.class,
36 new Class[] {AlwaysMatcher.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 matcher = new AlwaysMatcher();
50 }
51
52 /***
53 * Tear down the test
54 *
55 * @throws Exception any exception thrown during teardown.
56 */
57 public void tearDown() throws Exception {
58 super.tearDown();
59 }
60
61 /***
62 * Test the matches method
63 */
64 public void testMatches() {
65 assertTrue(matcher.matches("something", "something else"));
66 }
67 }