Skip to content
Permalink
Browse files

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

  • Loading branch information...
v1v committed Feb 25, 2017
1 parent fc5ecde commit 41f434542d170df192fb9e03f2a9b6c56a73d6e2
Showing with 32 additions and 0 deletions.
  1. +32 −0 src/test/java/org/jenkins/ci/plugins/jenkinslint/check/NullSCMCheckerTestCase.java
@@ -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;
@@ -27,6 +30,35 @@
project.setScm(new hudson.plugins.git.GitSCM(""));
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 testMavenGitSCM() throws Exception {
MavenModuleSet project = j.createMavenProject();
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMavenProject();
project.setScm(new hudson.plugins.git.GitSCM(""));
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 testMatrixGitSCM() throws Exception {
MatrixProject project = j.createMatrixProject();
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMatrixProject();
project.setScm(new hudson.plugins.git.GitSCM(""));
assertFalse(checker.executeCheck(project));
}
@Test public void testControlComment() throws Exception {
FreeStyleProject project = j.createFreeStyleProject();
assertFalse(checker.isIgnored(project.getDescription()));

0 comments on commit 41f4345

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