use of org.jetbrains.plugins.gradle.model.web.WebConfiguration.WebResource in project intellij-community by JetBrains.
the class WebConfigurationBuilderImplTest method testDefaultWarModel.
@Test
public void testDefaultWarModel() throws Exception {
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
List<WebConfiguration> ideaModule = ContainerUtil.mapNotNull(ideaModules, new Function<IdeaModule, WebConfiguration>() {
@Override
public WebConfiguration fun(IdeaModule module) {
return allModels.getExtraProject(module, WebConfiguration.class);
}
});
assertEquals(1, ideaModule.size());
WebConfiguration webConfiguration = ideaModule.get(0);
assertEquals(1, webConfiguration.getWarModels().size());
final WarModel warModel = webConfiguration.getWarModels().iterator().next();
assertEquals("src/main/webapp", warModel.getWebAppDirName());
assertArrayEquals(new String[] { "MANIFEST.MF", "additionalWebInf", "rootContent" }, ContainerUtil.map2Array(warModel.getWebResources(), new Function<WebResource, Object>() {
@Override
public String fun(WebResource resource) {
return resource.getFile().getName();
}
}));
}
Aggregations