File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\test\src\test\java\hudson\maven\MavenEmptyModuleTest.java.html

1 package hudson.maven;
2
3 import org.jvnet.hudson.test.HudsonTestCase;
4 import org.jvnet.hudson.test.Bug;
5 import org.jvnet.hudson.test.ExtractResourceSCM;
6
7
8 import hudson.Launcher;
9 import hudson.model.BuildListener;
10
11 import java.io.IOException;
12
13 /**
14 * @author Andrew Bayer
15 */
16 public class MavenEmptyModuleTest extends HudsonTestCase {
17 /**
18 * Verify that a build will work with a module <module></module> and a module <module> </module>
19 */
20 @Bug(4442)
21 public void testEmptyModuleParsesAndBuilds() throws Exception {
22 configureDefaultMaven();
23 MavenModuleSet m = createMavenProject();
24 m.getReporters().add(new TestReporter());
25 m.setScm(new ExtractResourceSCM(getClass().getResource("maven-empty-mod.zip")));
26 buildAndAssertSuccess(m);
27 }
28
29 private static class TestReporter extends MavenReporter {
30 private static final long serialVersionUID = 1L;
31
32 @Override
33 public boolean end(MavenBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
34 assertNotNull(build.getWorkspace());
35 return true;
36 }
37 }
38 }