use of org.apache.maven.plugins.war.stub.MavenProject4CopyConstructor in project maven-plugins by apache.
the class WarMojoTest method testSimpleWar.
public void testSimpleWar() throws Exception {
String testId = "SimpleWar";
MavenProject4CopyConstructor project = new MavenProject4CopyConstructor();
String outputDir = getTestDirectory().getAbsolutePath() + "/" + testId + "-output";
File webAppDirectory = new File(getTestDirectory(), testId);
WarArtifact4CCStub warArtifact = new WarArtifact4CCStub(getBasedir());
String warName = "simple";
File webAppSource = createWebAppSource(testId);
File classesDir = createClassesDir(testId, true);
File xmlSource = createXMLConfigDir(testId, new String[] { "web.xml" });
project.setArtifact(warArtifact);
this.configureMojo(mojo, new LinkedList<String>(), classesDir, webAppSource, webAppDirectory, project);
setVariableValueToObject(mojo, "outputDirectory", outputDir);
setVariableValueToObject(mojo, "warName", warName);
mojo.setWebXml(new File(xmlSource, "web.xml"));
mojo.execute();
// validate jar file
File expectedJarFile = new File(outputDir, "simple.war");
assertJarContent(expectedJarFile, new String[] { "META-INF/MANIFEST.MF", "WEB-INF/web.xml", "pansit.jsp", "org/web/app/last-exile.jsp", "META-INF/maven/org.apache.maven.plugin.test/maven-war-plugin-test/pom.xml", "META-INF/maven/org.apache.maven.plugin.test/maven-war-plugin-test/pom.properties" }, new String[] { null, mojo.getWebXml().toString(), null, null, null, null });
}
Aggregations