Skip to content

Commit

Permalink
[JENKINS-42310] Added Test cases for the Artifact Lint defect
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Feb 25, 2017
1 parent 6f0d3c9 commit a90bc61
Showing 1 changed file with 37 additions and 0 deletions.
@@ -1,10 +1,13 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.model.FreeStyleProject;
import hudson.tasks.ArtifactArchiver;
import hudson.tasks.JavadocArchiver;
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;
Expand Down Expand Up @@ -38,6 +41,40 @@ public class ArtifactCheckerTestCase {
project.getPublishersList().add(new ArtifactArchiver("something","",false));
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMavenModuleJob() throws Exception {
MavenModuleSet project = j.createMavenProject();
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMavenArtifact() throws Exception {
MavenModuleSet project = j.createMavenProject();
project.getPublishersList().add(new JavadocArchiver("",false));
assertFalse(checker.executeCheck(project));
project.getPublishersList().add(new ArtifactArchiver("","",false));
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMavenProject();
project.getPublishersList().add(new ArtifactArchiver("something","",false));
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMatrixProject() throws Exception {
MatrixProject project = j.createMatrixProject();
assertFalse(checker.executeCheck(project));
}
@Issue("JENKINS-42310")
@Test public void testMatrixProjectArtifact() throws Exception {
MatrixProject project = j.createMatrixProject();
project.getPublishersList().add(new JavadocArchiver("",false));
assertFalse(checker.executeCheck(project));
project.getPublishersList().add(new ArtifactArchiver("","",false));
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMatrixProject();
project.getPublishersList().add(new ArtifactArchiver("something","",false));
assertFalse(checker.executeCheck(project));
}
@Test public void testControlComment() throws Exception {
FreeStyleProject project = j.createFreeStyleProject();
assertFalse(checker.isIgnored(project.getDescription()));
Expand Down

0 comments on commit a90bc61

Please sign in to comment.