Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>5.27</version>
<version>5.28</version>
<relativePath />
</parent>

Expand Down
24 changes: 8 additions & 16 deletions src/test/java/hudson/plugins/plot/PlotBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ class PlotBuilderTest {
@Test
void testWithMinimalPipelineArgs(JenkinsRule r) throws Exception {
WorkflowJob p = r.createProject(WorkflowJob.class, "projectUnderTest");
p.setDefinition(new CpsFlowDefinition(
"""
p.setDefinition(new CpsFlowDefinition("""
node { \s
plot csvFileName: 'plot-minimal.csv',
group: 'My Data',
style: 'line'
}""",
true));
}""", true));
r.buildAndAssertSuccess(p);
}

@Test
void testWithXML(JenkinsRule r) throws Exception {
WorkflowJob p = r.createProject(WorkflowJob.class, "projectUnderTest");
p.setDefinition(new CpsFlowDefinition(
"""
p.setDefinition(new CpsFlowDefinition("""
node { \s
def content = '<my_data>'
content += '<test value1="123.456"/>'
Expand All @@ -44,16 +41,14 @@ void testWithXML(JenkinsRule r) throws Exception {
nodeType: 'NODESET',
xpath: 'my_data/test/@*']
]
}""",
true));
}""", true));
r.buildAndAssertSuccess(p);
}

@Test
void testWithCSV(JenkinsRule r) throws Exception {
WorkflowJob p = r.createProject(WorkflowJob.class, "projectUnderTest");
p.setDefinition(new CpsFlowDefinition(
"""
p.setDefinition(new CpsFlowDefinition("""
node { \s
def content = 'Avg,Median,90,min,max,samples,errors,error %'
content += '515.33,196,1117,2,16550,97560,360,0.37'
Expand All @@ -64,16 +59,14 @@ void testWithCSV(JenkinsRule r) throws Exception {
style: 'line',
yaxis: 'arbitrary',
csvSeries: [[file: 'data.csv']]
}""",
true));
}""", true));
r.buildAndAssertSuccess(p);
}

@Test
void testWithProperties(JenkinsRule r) throws Exception {
WorkflowJob p = r.createProject(WorkflowJob.class, "projectUnderTest");
p.setDefinition(new CpsFlowDefinition(
"""
p.setDefinition(new CpsFlowDefinition("""
node { \s
def content = 'YVALUE=1'
writeFile file: 'data.properties', text: content
Expand All @@ -86,8 +79,7 @@ void testWithProperties(JenkinsRule r) throws Exception {
[file: 'data.properties',
label: 'My Label']
]
}""",
true));
}""", true));
r.buildAndAssertSuccess(p);
}
}