public void test_generateWithoutInclude() throws Exception {
    MockUtil util = MockUtil.setupEnvironment("withoutInclude/withoutInclude-pom.xml");
    Mojo mojo = lookupMojo("generate", util.getPomFile());

    mojo.execute();

    assertExist("./target/withoutInclude/server/resources/conf/role.xml");
    assertExist("./target/withoutInclude/server/resources/conf/castor-config.xml");

    String expected =
        "<?xml version='1.0' encoding='ISO-8859-1'?>"
            + "<database name='DirectUseDB' engine='sybase'>"
            + "    <driver class-name='com.sybase.jdbc2.jdbc.SybDataSource' url='jdbc:sybase:Tds:notUSED'/>"
            + "    <mapping href='Mapping.xml'/>"
            + "</database>";

    String actual =
        FileUtil.loadContent(
            toFile("./target/withoutInclude/server/resources/conf/castor-config.xml"));
    XmlUtil.assertEquals(expected, actual);

    List compileSourceRoots = util.getProject().getCompileSourceRoots();
    assertEquals(2, compileSourceRoots.size());
    assertPath("target/withoutInclude/server/java", compileSourceRoots.get(0));
    assertPath("target/withoutInclude/client/java", compileSourceRoots.get(1));
  }
  public void test_generateWithDatagenInclude() throws Exception {
    MockUtil util = MockUtil.setupEnvironment("withDatagenInclude/withInclude-pom.xml");

    Mojo mojo = lookupMojo("generate", util.getPomFile());

    util.getProject().setFile(util.getPomFile());

    mojo.execute();

    assertExist("./target/withDatagenInclude/resources/conf/role.xml");
    assertExist("./target/withDatagenInclude/table/MY_REF.tab");
  }
  public void test_generateWithoutInclude_noConfiguration() throws Exception {
    new DirectoryFixture("./target/withDatagenInclude").doTearDown();

    MockUtil util =
        MockUtil.setupEnvironment("withDatagenInclude/withInclude-noConfiguration-pom.xml");

    Mojo mojo = lookupMojo("generate", util.getPomFile());

    util.getProject().setFile(util.getPomFile());

    mojo.execute();

    assertNotExist("./target/withDatagenInclude/resources/conf/role.xml");
    assertExist("./target/withDatagenInclude/table/MY_REF.tab");

    //        List compileSourceRoots = util.getProject().getCompileSourceRoots();
    //        assertEquals(0, compileSourceRoots.size());
  }