提交 ff255dc6 编写于 作者: K kohsuke

added a test to verify that the exclusion is working

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16737 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0be9ef54
......@@ -3,11 +3,15 @@ package hudson.maven;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.ExtractResourceSCM;
import hudson.tasks.Maven.MavenInstallation;
import hudson.tasks.ArtifactArchiver;
import hudson.model.Slave;
import hudson.model.Descriptor;
import java.net.URLClassLoader;
import java.util.Arrays;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
/**
* @author huybrechts
*/
......@@ -36,5 +40,16 @@ public class MavenProjectTest extends HudsonTestCase {
assertBuildStatusSuccess(project.scheduleBuild2(0).get());
}
/**
* Makes sure that {@link ArtifactArchiver} doesn't show up in the m2 job type config screen.
* This is to make sure that the exclusion in {@link MavenModuleSet.DescriptorImpl#isApplicable(Descriptor)}
* is working.
*/
public void testConfig() throws Exception {
MavenModuleSet p = createMavenProject();
HtmlPage page = new WebClient().getPage(p, "configure");
assertFalse(page.getWebResponse().getContentAsString().contains(hudson.getDescriptorByType(ArtifactArchiver.DescriptorImpl.class).getDisplayName()));
// but this should exist. This verifies that the approach of the test is sane (and for example, to make sure getContentAsString()!="")
assertTrue(page.getWebResponse().getContentAsString().contains(hudson.getDescriptorByType(RedeployPublisher.DescriptorImpl.class).getDisplayName()));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册