* Test the default configuration (i.e. without any classpath/web/war DSL blocks) for a war project.
*/
@Test
public void testWarProjectDefaults() throws Exception {
Project project = ProjectBuilder.builder().build();
project.getPlugins().apply(WarPlugin.class);
project.getPlugins().apply(RebelPlugin.class);
callAfterEvaluated(project);
// Default classes directory
JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
File defaultClassesDir = javaConvention.getSourceSets().getByName("main").getOutput().getClassesDir();
// create directory by hand, as the Java plugin is not actually executing in our test
defaultClassesDir.mkdirs();
log.info("Default classes dir: " + defaultClassesDir.getAbsolutePath());
// Default resources directory
File defaultResourcesDir = javaConvention.getSourceSets().getByName("main").getOutput().getResourcesDir();
// create directory by hand, as the Java plugin is not actually executing in our test
defaultResourcesDir.mkdirs();
log.info("Default resources dir: " + defaultResourcesDir.getAbsolutePath());
// Default webapp directory
WarPluginConvention warConvention = project.getConvention().getPlugin(WarPluginConvention.class);
File defaultWebappDirectory = warConvention.getWebAppDir();
// create directory by hand, as the War plugin is not actually executing in our test
defaultWebappDirectory.mkdirs();
log.info("Default webapp dir: " + defaultWebappDirectory.getAbsolutePath());
// Get and execute the rebel task
RebelGenerateTask task = (RebelGenerateTask) project.getTasks().getByName(RebelPlugin.GENERATE_REBEL_TASK_NAME);
task.skipWritingRebelXml();
task.generate();
RebelMainModel model = task.getRebelModel();