KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > runner > TestReferenceFailure


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  * David Saff (saff@mit.edu) - initial API and implementation
11  * (bug 102632: [JUnit] Support for JUnit 4.)
12  *******************************************************************************/

13
14 package org.eclipse.jdt.internal.junit.runner;
15
16
17
18
19 public class TestReferenceFailure {
20
21     private final ITestIdentifier fTest;
22
23     private final String JavaDoc fTrace;
24
25     private final String JavaDoc fStatus;
26
27     private FailedComparison fComparison;
28
29     public TestReferenceFailure(ITestIdentifier ref, String JavaDoc status, String JavaDoc trace) {
30         this(ref, status, trace, null);
31     }
32
33     public TestReferenceFailure(ITestIdentifier reference, String JavaDoc status,
34             String JavaDoc trace, FailedComparison comparison) {
35         fTest = reference;
36         fStatus = status;
37         fTrace = trace;
38         fComparison = comparison;
39     }
40
41     public TestReferenceFailure(ITestReference reference, String JavaDoc status, String JavaDoc trace) {
42         this(reference.getIdentifier(), status, trace);
43     }
44
45     public String JavaDoc getStatus() {
46         return fStatus;
47     }
48
49     public String JavaDoc getTrace() {
50         return fTrace;
51     }
52
53     public ITestIdentifier getTest() {
54         return fTest;
55     }
56
57     public String JavaDoc toString() {
58         return fStatus + " " + fTest.getName(); //$NON-NLS-1$
59
}
60
61     public boolean equals(Object JavaDoc obj) {
62         TestReferenceFailure f = (TestReferenceFailure) obj;
63         return f.fTest.equals(fTest) && f.fStatus.equals(fStatus)
64                 && f.fTrace.equals(fTrace);
65     }
66
67     public void setComparison(FailedComparison comparison) {
68         fComparison = comparison;
69     }
70
71     public FailedComparison getComparison() {
72         return fComparison;
73     }
74 }
75
Popular Tags