|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Captures | Line # 12 | 4 | 3 | 100% |
1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (5) | |||
| Result | |||
|
0.71428573
|
org.easymock.tests2.CaptureTest.testPrimitive
org.easymock.tests2.CaptureTest.testPrimitive
|
1 PASS | |
|
0.71428573
|
org.easymock.tests2.CaptureTest.testCaptureRightOne
org.easymock.tests2.CaptureTest.testCaptureRightOne
|
1 PASS | |
|
0.71428573
|
org.easymock.tests2.CaptureTest.testPrimitiveVsObject
org.easymock.tests2.CaptureTest.testPrimitiveVsObject
|
1 PASS | |
|
0.71428573
|
org.easymock.tests2.CaptureTest.testAnd
org.easymock.tests2.CaptureTest.testAnd
|
1 PASS | |
|
0.71428573
|
org.easymock.tests.CapturesMatcherTest.test
org.easymock.tests.CapturesMatcherTest.test
|
1 PASS | |
| 1 | /* | |
| 2 | * Copyright (c) 2003-2008 OFFIS, Henri Tremblay. | |
| 3 | * This program is made available under the terms of the MIT License. | |
| 4 | */ | |
| 5 | package org.easymock.internal.matchers; | |
| 6 | ||
| 7 | import java.io.Serializable; | |
| 8 | ||
| 9 | import org.easymock.Capture; | |
| 10 | import org.easymock.IArgumentMatcher; | |
| 11 | ||
| 12 | public class Captures<T> implements IArgumentMatcher, Serializable { | |
| 13 | ||
| 14 | private static final long serialVersionUID = 5370646694100653250L; | |
| 15 | ||
| 16 | private Capture<T> capture; | |
| 17 | ||
| 18 | 11 |
public Captures(Capture<T> captured) { |
| 19 | 11 | this.capture = captured; |
| 20 | } | |
| 21 | ||
| 22 | 3 |
public void appendTo(StringBuffer buffer) { |
| 23 | 3 | buffer.append("capture(").append(capture).append(")"); |
| 24 | } | |
| 25 | ||
| 26 | 12 |
@SuppressWarnings("unchecked") |
| 27 | public boolean matches(Object actual) { | |
| 28 | 12 | capture.setValue((T) actual); |
| 29 | 12 | return true; |
| 30 | } | |
| 31 | } | |
|
||||||||||