Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
8   57   2   4
0   26   0,25   2
2     1  
1    
 
  MatchableArgumentsTest       Line # 31 8 0% 2 0 100% 1.0
 
  (2)
 
1    /**
2    * Copyright 2001-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16   
17    package org.easymock.tests;
18   
19    import static org.junit.Assert.*;
20   
21    import java.lang.reflect.Method;
22   
23    import org.easymock.internal.ExpectedInvocation;
24    import org.easymock.internal.Invocation;
25    import org.junit.Before;
26    import org.junit.Test;
27   
28    /**
29    * @author OFFIS, Tammo Freese
30    */
 
31    public class MatchableArgumentsTest {
32   
33    private Object[] arguments;
34   
35    private Object[] arguments2;
36   
 
37  2 toggle @Before
38    public void setup() {
39  2 arguments = new Object[] { "" };
40  2 arguments2 = new Object[] { "", "" };
41    }
42   
 
43  2 toggle @Test
44    public void testEquals() throws SecurityException, NoSuchMethodException {
45  2 final Method toPreventNullPointerExceptionm = Object.class.getMethod("toString", new Class[] {});
46   
47  2 final Object mock = new Object();
48   
49  2 final ExpectedInvocation matchableArguments = new ExpectedInvocation(new Invocation(mock,
50    toPreventNullPointerExceptionm, arguments), null);
51  2 final ExpectedInvocation nonEqualMatchableArguments = new ExpectedInvocation(new Invocation(mock,
52    toPreventNullPointerExceptionm, arguments2), null);
53   
54  2 assertFalse(matchableArguments.equals(null));
55  2 assertFalse(matchableArguments.equals(nonEqualMatchableArguments));
56    }
57    }