private MavenModuleSet createProject(final String scmResource) throws Exception { MavenModuleSet project = createMavenProject(); MavenInstallation mi = configureDefaultMaven(); project.setScm(new ExtractResourceSCM(getClass().getResource(scmResource))); project.setMaven(mi.getName()); project.setLocalRepository(new PerJobLocalRepositoryLocator()); return project; }
@Bug(6779) public void testDeleteSetBuildDeletesModuleBuilds() throws Exception { MavenModuleSet project = createProject("maven-multimod.zip"); project.setLocalRepository(new DefaultLocalRepositoryLocator()); project.setGoals("install"); buildAndAssertSuccess(project); buildAndAssertSuccess(project.getModule("org.jvnet.hudson.main.test.multimod:moduleB")); buildAndAssertSuccess(project); assertEquals(2, project.getBuilds().size()); // Module build does not add a ModuleSetBuild project.getFirstBuild().delete(); // A#1, B#1 and B#2 should all be deleted too assertEquals( 1, project.getModule("org.jvnet.hudson.main.test.multimod:moduleA").getBuilds().size()); assertEquals( 1, project.getModule("org.jvnet.hudson.main.test.multimod:moduleB").getBuilds().size()); }