KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > easymock > tests > EqualsMatcherTest


1 /*
2  * Copyright (c) 2001-2005 OFFIS. This program is made available under the terms of
3  * the MIT License.
4  */

5 package org.easymock.tests;
6
7 import junit.framework.TestCase;
8
9 import org.easymock.ArgumentsMatcher;
10 import org.easymock.MockControl;
11
12 public class EqualsMatcherTest extends TestCase {
13     final ArgumentsMatcher MATCHER = MockControl.EQUALS_MATCHER;
14
15     public void testEquals() {
16         assertTrue(MATCHER.matches(null, null));
17         assertFalse(MATCHER.matches(null, new Object JavaDoc[0]));
18         assertFalse(MATCHER.matches(new Object JavaDoc[0], null));
19         assertFalse(MATCHER.matches(new Object JavaDoc[] { "" }, new Object JavaDoc[] { null }));
20         assertFalse(MATCHER.matches(new Object JavaDoc[] { null }, new Object JavaDoc[] { "" }));
21         assertTrue(MATCHER
22                 .matches(new Object JavaDoc[] { null }, new Object JavaDoc[] { null }));
23     }
24
25     public void testDifferentNumberOfArguments() {
26         assertFalse(MATCHER.matches(new Object JavaDoc[2], new Object JavaDoc[3]));
27     }
28 }
Popular Tags