| 1 | /* |
| 2 | * JTiger Unit Testing Framework for J2SE 1.5 |
| 3 | * Copyright (C) 2005 Tony Morris |
| 4 | * |
| 5 | * This software is licenced under the |
| 6 | * Common Public Licence version 1.0 |
| 7 | * http://www.opensource.org/licenses/cpl1.0.php |
| 8 | * |
| 9 | * You received a copy of this licence with this software. |
| 10 | */ |
| 11 | package org.jtiger.report.html; |
| 12 | |
| 13 | final class TestResultFactory |
| 14 | { |
| 15 | private TestResultFactory() |
| 16 | { |
| 17 | |
| 18 | } |
| 19 | |
| 20 | static TestResult newTestResult(final String name, final String exception, final String elapsedTime, |
| 21 | final String message, final String methodName, final String description, final String result) |
| 22 | { |
| 23 | return new TestResultImpl(name, exception, elapsedTime, message, methodName, description, result); |
| 24 | } |
| 25 | |
| 26 | private static final class TestResultImpl implements TestResult |
| 27 | { |
| 28 | private final String name; |
| 29 | private final String exception; |
| 30 | private final String elapsedTime; |
| 31 | private final String message; |
| 32 | private final String methodName; |
| 33 | private final String description; |
| 34 | private final String result; |
| 35 | |
| 36 | TestResultImpl(final String name, final String exception, final String elapsedTime, |
| 37 | final String message, final String methodName, final String description, final String result) |
| 38 | { |
| 39 | this.name = name; |
| 40 | this.exception = exception; |
| 41 | this.elapsedTime = elapsedTime; |
| 42 | this.message = message; |
| 43 | this.methodName = methodName; |
| 44 | this.description = description; |
| 45 | this.result = result; |
| 46 | } |
| 47 | |
| 48 | public String getName() |
| 49 | { |
| 50 | return name; |
| 51 | } |
| 52 | |
| 53 | public String getException() |
| 54 | { |
| 55 | return exception; |
| 56 | } |
| 57 | |
| 58 | public String getElapsedTime() |
| 59 | { |
| 60 | return elapsedTime; |
| 61 | } |
| 62 | |
| 63 | public String getMessage() |
| 64 | { |
| 65 | return message; |
| 66 | } |
| 67 | |
| 68 | public String getMethodName() |
| 69 | { |
| 70 | return methodName; |
| 71 | } |
| 72 | |
| 73 | public String getDescription() |
| 74 | { |
| 75 | return description; |
| 76 | } |
| 77 | |
| 78 | public String getResult() |
| 79 | { |
| 80 | return result; |
| 81 | } |
| 82 | } |
| 83 | } |