Skip to content

Commit

Permalink
[JENKINS-46424] Added testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Aug 24, 2017
1 parent c5bfb5b commit 74a43d5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Expand Up @@ -216,6 +216,13 @@
<version>1.24</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jenkins-multijob-plugin</artifactId>
<version>1.21</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
@@ -0,0 +1,26 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;

import static org.junit.Assert.assertFalse;

/**
* NPE Test Case. Using another TestClass to be able to inject the LocalData using the Rule annotation
*
* @author Victor Martinez
*/
public class NPETestCase {
@Rule
public JenkinsRule j = new JenkinsRule();

@Issue("JENKINS-46424")
@LocalData
@Test public void testMultiJobWithNPEParameters() throws Exception {
assertFalse(new GroovySandboxChecker(true).executeCheck(j.getInstance().getItem("test_multi_stage")));
assertFalse(new GroovySystemExitChecker(true).executeCheck(j.getInstance().getItem("test_multi_stage")));
}
}
Binary file not shown.

0 comments on commit 74a43d5

Please sign in to comment.