| 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.framework; |
| 12 | |
| 13 | import static org.jtiger.framework.TestResultType.FAILURE; |
| 14 | import static org.jtiger.framework.TestResultType.FAILURE_SETUP; |
| 15 | import static org.jtiger.framework.TestResultType.FAILURE_TEARDOWN; |
| 16 | |
| 17 | |
| 18 | final class TestFailureFactory |
| 19 | { |
| 20 | private TestFailureFactory() |
| 21 | { |
| 22 | |
| 23 | } |
| 24 | |
| 25 | static TestFailure newTestFailure() |
| 26 | { |
| 27 | return new TestFailureImpl(); |
| 28 | } |
| 29 | |
| 30 | private static final class TestFailureImpl implements TestFailure |
| 31 | { |
| 32 | TestFailureImpl() |
| 33 | { |
| 34 | |
| 35 | } |
| 36 | |
| 37 | public boolean isFailure(final TestResultType result) |
| 38 | { |
| 39 | return result == FAILURE || |
| 40 | result == FAILURE_SETUP || |
| 41 | result == FAILURE_TEARDOWN; |
| 42 | } |
| 43 | } |
| 44 | } |