Skip to content
Permalink
Browse files

avoid wildcard in @DataBoundConstructor

[FIXES JENKINS-41086]
  • Loading branch information
daspilker committed Feb 24, 2017
1 parent 2c37d53 commit 062b2150527bfa21cb7a22ed136aeba00b0422e7
@@ -166,7 +166,7 @@ public PerformancePublisher(int errorFailedThreshold,
boolean modeOfThreshold,
boolean failBuildIfNoResultFile,
boolean compareBuildPrevious,
List<? extends PerformanceReportParser> parsers,
List<PerformanceReportParser> parsers,
boolean modeThroughput) {

this.errorFailedThreshold = errorFailedThreshold;
@@ -8,16 +8,15 @@
import org.jvnet.hudson.test.TestBuilder;

import java.io.IOException;

import static java.util.Arrays.asList;
import java.util.Collections;

/**
* @author Kohsuke Kawaguchi
*/
public class PerformancePublisherTest extends HudsonTestCase {
public void testConfigRoundtrip() throws Exception {
PerformancePublisher before = new PerformancePublisher(10, 20, "", 0, 0, 0, 0, 0, false, "", false, false, false,
asList(new JMeterParser("**/*.jtl")), false);
Collections.<PerformanceReportParser>singletonList(new JMeterParser("**/*.jtl")), false);

FreeStyleProject p = createFreeStyleProject();
p.getPublishersList().add(before);
@@ -52,7 +51,7 @@ public boolean perform(AbstractBuild<?, ?> build,
}
});
p.getPublishersList().add(
new PerformancePublisher(0, 0, "", 0, 0, 0, 0, 0, false, "", false, false, false, asList(new JMeterParser(
new PerformancePublisher(0, 0, "", 0, 0, 0, 0, 0, false, "", false, false, false, Collections.<PerformanceReportParser>singletonList(new JMeterParser(
"**/*.jtl")), false));

FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0).get());
@@ -82,7 +81,7 @@ public boolean perform(AbstractBuild<?, ?> build,
}
});
p.getPublishersList().add(
new PerformancePublisher(0, 0, "", 0, 0, 0, 0, 0, false, "", false, false, false, asList(new JMeterParser(
new PerformancePublisher(0, 0, "", 0, 0, 0, 0, 0, false, "", false, false, false, Collections.<PerformanceReportParser>singletonList(new JMeterParser(
"${JOB_NAME}/*.jtl")), false));

FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0).get());
@@ -113,7 +112,7 @@ public boolean perform(AbstractBuild<?, ?> build,
}
});
p.getPublishersList().add(
new PerformancePublisher(0, 0, "test.jtl:100", 0, 0, 0, 0, 0, false, "", false, false, false, asList(new JMeterParser(
new PerformancePublisher(0, 0, "test.jtl:100", 0, 0, 0, 0, 0, false, "", false, false, false, Collections.<PerformanceReportParser>singletonList(new JMeterParser(
"**/*.jtl")), false));

FreeStyleBuild b = assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get());
@@ -144,7 +143,7 @@ public boolean perform(AbstractBuild<?, ?> build,
}
});
p.getPublishersList().add(
new PerformancePublisher(0, 0, "test.jtl:5000", 0, 0, 0, 0, 0, false, "", false, false, false, asList(new JMeterParser(
new PerformancePublisher(0, 0, "test.jtl:5000", 0, 0, 0, 0, 0, false, "", false, false, false, Collections.<PerformanceReportParser>singletonList(new JMeterParser(
"**/*.jtl")), false));

FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0).get());
@@ -173,7 +172,7 @@ public void buildUnstableAverageResponseTimeRelativeThreshold() throws Exception
FreeStyleProject p = createFreeStyleProject();

p.getPublishersList().add(
new PerformancePublisher(0, 0, null, 100.0d, 0, 50.0d, 0, 0, false, "ART", true, false, true, asList(new JUnitParser(
new PerformancePublisher(0, 0, null, 100.0d, 0, 50.0d, 0, 0, false, "ART", true, false, true, Collections.<PerformanceReportParser>singletonList(new JUnitParser(
"**/*.xml")), false));
// first build
p.getBuildersList().add(new TestBuilder() {
@@ -16,9 +16,9 @@
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.Result;
import hudson.plugins.performance.AbstractParser;
import hudson.plugins.performance.JMeterParser;
import hudson.plugins.performance.PerformancePublisher;
import hudson.plugins.performance.PerformanceReportParser;
import hudson.plugins.performance.constraints.AbstractConstraint.Escalation;
import hudson.plugins.performance.constraints.AbstractConstraint.Metric;
import hudson.plugins.performance.constraints.AbstractConstraint.Operator;
@@ -47,7 +47,7 @@ public void informationModeDoesntAffectBuildStatus() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -93,7 +93,7 @@ public void warningModeMakesBuildUnstable() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -139,7 +139,7 @@ public void errorModeMakesBuildFail() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -185,7 +185,7 @@ public void equalValuesWithNotGreaterOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -231,7 +231,7 @@ public void calculatedValueGreaterWithNotGreaterOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -277,7 +277,7 @@ public void equalValuesWithNotEqualOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -323,7 +323,7 @@ public void notEqualValueWithNotEqualOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -369,7 +369,7 @@ public void equalValuesWithNotLessOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,
@@ -415,7 +415,7 @@ public void calculatedValueLessWithNotLessOperator() throws Exception{
List<AbstractConstraint> abstractBuildsList = new ArrayList<AbstractConstraint>();
abstractBuildsList.add(absoluteConstraint);

List<AbstractParser> abstractParserList = new ArrayList<AbstractParser>();
List<PerformanceReportParser> abstractParserList = new ArrayList<PerformanceReportParser>();
abstractParserList.add(new JMeterParser("testResult.xml"));

PerformancePublisher performancePublisher = new PerformancePublisher(10, 20, "",0,0,0,0,0,false,"",false,true,false,

0 comments on commit 062b215

Please sign in to comment.
You can’t perform that action at this time.