EasyMock 2.3

Clover coverage report - EasyMock 2.3
Coverage timestamp: mar. juil. 10 2007 02:46:04 CEST
FRAMES NO FRAMES

file stats: | LOC: | 40 |  | Methods: | 7
| NCLOC: | 28 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

Result.java

-

100%

100%

100%

1 |  | /*
2 |  | * Copyright (c) 2001-2007 OFFIS, Tammo Freese.
3 |  | * This program is made available under the terms of the MIT License.
4 |  | */
5 |  | package org.easymock.internal;
6 |  |
7 |  | import org.easymock.IAnswer;
8 |  |
9 |  | public class Result implements IAnswer {
10 |  |
11 |  | private IAnswer value;
12 |  |
13 | 471 | private Result(IAnswer value) {
14 | 471 | this.value = value;
15 |  | }
16 |  |
17 | 51 | public static Result createThrowResult(final Throwable throwable) {
18 | 51 | return new Result(new IAnswer<Object>() {
19 | 76 | public Object answer() throws Throwable {
20 | 76 | throw throwable;
21 |  | }
22 |  | });
23 |  | }
24 |  |
25 | 410 | public static Result createReturnResult(final Object value) {
26 | 410 | return new Result(new IAnswer<Object>() {
27 | 429 | public Object answer() throws Throwable {
28 | 429 | return value;
29 |  | }
30 |  | });
31 |  | }
32 |  |
33 | 10 | public static Result createAnswerResult(IAnswer answer) {
34 | 10 | return new Result(answer);
35 |  | }
36 |  |
37 | 522 | public Object answer() throws Throwable {
38 | 522 | return value.answer();
39 |  | }
40 |  | }