Skip to content
Permalink
Browse files

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

  • Loading branch information...
v1v committed Feb 25, 2017
1 parent 6f0d3c9 commit a90bc61e7a0638eb415be30bcfcccb340d936f51
@@ -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;
@@ -38,6 +41,40 @@
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()));

0 comments on commit a90bc61

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