Skip to content
Permalink
Browse files

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

  • Loading branch information...
v1v committed Feb 25, 2017
1 parent d6b7775 commit dfad147f6c7db6861bbb4f9f2843b1fbc21bcfed
Showing with 38 additions and 0 deletions.
  1. +38 −0 src/test/java/org/jenkins/ci/plugins/jenkinslint/check/JavadocCheckerTestCase.java
@@ -1,10 +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.WsCleanup;
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 +42,40 @@
project.getPublishersList().add(new JavadocArchiver("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 testMavenJavadoc() throws Exception {
MavenModuleSet project = j.createMavenProject();
project.getPublishersList().add(new ArtifactArchiver("","",false));
assertFalse(checker.executeCheck(project));
project.getPublishersList().add(new JavadocArchiver("",false));
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMavenProject();
project.getPublishersList().add(new JavadocArchiver("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 testMatrixProjectJavadoc() throws Exception {
MatrixProject project = j.createMatrixProject();
project.getPublishersList().add(new ArtifactArchiver("","",false));
assertFalse(checker.executeCheck(project));
project.getPublishersList().add(new JavadocArchiver("",false));
assertTrue(checker.executeCheck(project));
project.delete();
project = j.createMatrixProject();
project.getPublishersList().add(new JavadocArchiver("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 dfad147

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