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));
  }
  private void assertTransform(String expectedFile, String sourceFile)
      throws IOException, ParserConfigurationException, SAXException, TransformerException {
    DOMSource source = toDataSource(sourceFile);
    Transformer transformer = toTransformer("PreGenerator.xsl");

    StringWriter writer = new StringWriter();
    StreamResult result = new StreamResult(writer);
    transformer.transform(source, result);
    XmlUtil.assertEquals(
        loadEtalon(expectedFile).replaceAll("\\s+", " "),
        writer.toString().replaceAll("\\s+", " "));
  }
  public void test_generateWithoutInclude_mysql() throws Exception {
    MockUtil util = MockUtil.setupEnvironment("withoutInclude/withoutInclude-mysql-pom.xml");
    Mojo mojo = lookupMojo("generate", util.getPomFile());

    mojo.execute();

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

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