Skip to content
Permalink
Browse files

[JENKINS-42310] Added Test cases for the JobAssignedLabel Lint defect

  • Loading branch information...
v1v committed Feb 24, 2017
1 parent e3b1b5a commit bb790ad2efb3b01d017afba95d6195f26701c625
@@ -1,8 +1,11 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.model.FreeStyleProject;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;

import static org.junit.Assert.assertFalse;
@@ -32,6 +35,32 @@
project.save();
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMavenModuleJob() throws Exception {
MavenModuleSet project = j.createMavenProject();
assertTrue(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMavenDescription() throws Exception {
MavenModuleSet project = j.createMavenProject("WithoutSystem");
j.createSlave("test",null);
project.setAssignedLabel(j.jenkins.getLabel("test"));
project.save();
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMatrixProject() throws Exception {
MatrixProject project = j.createMatrixProject();
assertTrue(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMatrixProjectDescription() throws Exception {
MatrixProject project = j.createMatrixProject("WithoutSystem");
j.createSlave("test",null);
project.setAssignedLabel(j.jenkins.getLabel("test"));
project.save();
assertFalse(checker.executeCheck(project));
}
@Test public void testControlComment() throws Exception {
FreeStyleProject project = j.createFreeStyleProject();
assertFalse(checker.isIgnored(project.getDescription()));

0 comments on commit bb790ad

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