Skip to content
Permalink
Browse files

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

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

import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.model.FreeStyleProject;
import hudson.plugins.ws_cleanup.PreBuildCleanup;
import hudson.plugins.ws_cleanup.WsCleanup;
import hudson.tasks.ArtifactArchiver;
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;
@@ -40,6 +43,28 @@
project.getBuildWrappersList().add(new PreBuildCleanup(null, true, "", ""));
assertTrue(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 testMavenCleanupWorkspacePublisher() throws Exception {
MavenModuleSet project = j.createMavenProject("WithPublisher");
project.getPublishersList().add(new WsCleanup(null, true, true, true, true, true, true, true, true, ""));
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 testMatrixProjectCleanupWorkspacePublisher() throws Exception {
MatrixProject project = j.createMatrixProject("WithoutSystem");
project.getPublishersList().add(new WsCleanup(null, true, true, true, true, true, true, true, true, ""));
assertFalse(checker.executeCheck(project));
}
@Test public void testControlComment() throws Exception {
FreeStyleProject project = j.createFreeStyleProject();
assertFalse(checker.isIgnored(project.getDescription()));

0 comments on commit 8aca943

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