|
28 | 28 | import hudson.tasks.junit.CaseResult;
|
29 | 29 | import hudson.util.*;
|
30 | 30 | import hudson.util.ChartUtil.NumberOnlyBuildLabel;
|
| 31 | + |
| 32 | +import java.awt.*; |
| 33 | +import java.io.IOException; |
| 34 | +import java.util.Collections; |
| 35 | +import java.util.List; |
| 36 | +import java.util.Map; |
| 37 | +import java.util.concurrent.ConcurrentHashMap; |
| 38 | +import jenkins.model.RunAction2; |
31 | 39 | import org.jfree.chart.ChartFactory;
|
32 | 40 | import org.jfree.chart.JFreeChart;
|
33 | 41 | import org.jfree.chart.axis.CategoryAxis;
|
|
44 | 52 | import org.kohsuke.stapler.export.Exported;
|
45 | 53 | import org.kohsuke.stapler.export.ExportedBean;
|
46 | 54 |
|
47 |
| -import java.awt.*; |
48 |
| -import java.io.IOException; |
49 |
| -import java.util.Collections; |
50 |
| -import java.util.List; |
51 |
| -import java.util.Map; |
52 |
| -import java.util.concurrent.ConcurrentHashMap; |
53 |
| - |
54 | 55 | /**
|
55 | 56 | * Common base class for recording test result.
|
56 | 57 | *
|
|
61 | 62 | * @author Kohsuke Kawaguchi
|
62 | 63 | */
|
63 | 64 | @ExportedBean
|
64 |
| -public abstract class AbstractTestResultAction<T extends AbstractTestResultAction> implements HealthReportingAction { |
65 |
| - public final AbstractBuild<?,?> owner; |
| 65 | +public abstract class AbstractTestResultAction<T extends AbstractTestResultAction> implements HealthReportingAction, RunAction2 { |
| 66 | + public transient AbstractBuild<?,?> owner; |
66 | 67 |
|
67 | 68 | private Map<String,String> descriptions = new ConcurrentHashMap<String, String>();
|
68 | 69 |
|
| 70 | + /** @since 1.544 */ |
| 71 | + protected AbstractTestResultAction() {} |
| 72 | + |
| 73 | + /** @deprecated Use the default constructor and just call {@link Run#addAction} to associate the build with the action. */ |
| 74 | + @Deprecated |
69 | 75 | protected AbstractTestResultAction(AbstractBuild owner) {
|
70 | 76 | this.owner = owner;
|
71 | 77 | }
|
72 | 78 |
|
| 79 | + @Override public void onAttached(Run<?, ?> r) { |
| 80 | + this.owner = (AbstractBuild<?,?>) r; |
| 81 | + } |
| 82 | + |
| 83 | + @Override public void onLoad(Run<?, ?> r) { |
| 84 | + this.owner = (AbstractBuild<?,?>) r; |
| 85 | + } |
| 86 | + |
73 | 87 | /**
|
74 | 88 | * Gets the number of failed tests.
|
75 | 89 | */
|
|
0 commit comments