File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\tasks\junit\TestObject.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Tom Huybrechts, Yahoo! Inc., InfraDNA, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24 package hudson.tasks.junit;
25
26 import hudson.model.AbstractBuild;
27 import hudson.model.AbstractModelObject;
28 import hudson.model.Api;
29 import hudson.tasks.test.AbstractTestResultAction;
30 import org.kohsuke.stapler.export.ExportedBean;
31
32 import java.io.Serializable;
33 import java.util.List;
34
35 /**
36 * Stub of base class for all test result objects. The real implementation of
37 * the TestObject is in hudson.tasks.test.TestObject. This class simply
38 * defines abstract methods so that legacy code will continue to compile.
39 *
40 * @deprecated
41 * Use {@link hudson.tasks.test.TestObject} instead.
42 *
43 * @author Kohsuke Kawaguchi
44 */
45 @ExportedBean
46 public abstract class TestObject extends AbstractModelObject implements Serializable {
47 public abstract AbstractBuild<?,?> getOwner() ;
48
49
50 public abstract TestObject getParent();
51
52 public abstract String getId();
53 /**
54 * Returns url relative to TestResult
55 */
56 public abstract String getUrl();
57
58 public abstract TestResult getTestResult();
59
60 public abstract AbstractTestResultAction getTestResultAction();
61
62 public abstract List<TestAction> getTestActions();
63
64 public abstract <T> T getTestAction(Class<T> klazz);
65
66 /**
67 * Gets the counter part of this {@link TestObject} in the previous run.
68 *
69 * @return null if no such counter part exists.
70 */
71 public abstract TestObject getPreviousResult();
72
73 public abstract TestObject getResultInBuild(AbstractBuild<?,?> build);
74
75 /**
76 * Time took to run this test. In seconds.
77 */
78 public abstract float getDuration();
79
80 /**
81 * Returns the string representation of the {@link #getDuration()}, in a
82 * human readable format.
83 */
84 public abstract String getDurationString();
85
86 public abstract String getDescription();
87
88 public abstract void setDescription(String description);
89
90 /**
91 * Exposes this object through the remote API.
92 */
93 public abstract Api getApi();
94
95 /**
96 * Gets the name of this object.
97 */
98 public abstract String getName();
99
100 /**
101 * Gets the version of {@link #getName()} that's URL-safe.
102 */
103 public abstract String getSafeName();
104
105 public abstract String getSearchUrl();
106
107 /**
108 * Gets the total number of passed tests.
109 */
110 public abstract int getPassCount();
111
112 /**
113 * Gets the total number of failed tests.
114 */
115 public abstract int getFailCount();
116
117 /**
118 * Gets the total number of skipped tests.
119 */
120 public abstract int getSkipCount();
121
122 /**
123 * Gets the total number of tests.
124 */
125 public abstract int getTotalCount();
126
127 public abstract History getHistory();
128
129 // public abstract Object getDynamic(String token, StaplerRequest req,
130 // StaplerResponse rsp);
131 //
132 // public abstract HttpResponse doSubmitDescription(
133 // @QueryParameter String description) throws IOException,
134 // ServletException;
135
136 }
137