use of org.apache.maven.plugins.war.util.WebappStructure in project maven-plugins by apache.
the class WebappStructureTest method testRegisterSamePathTwiceForced.
public void testRegisterSamePathTwiceForced() {
final String path = "WEB-INF/web.xml";
final WebappStructure structure = new WebappStructure(new ArrayList<Dependency>());
structure.registerFile("overlay1", path);
assertEquals("overlay1", structure.getOwner(path));
assertTrue("owner replacement should have returned true", structure.registerFileForced("currentBuild", path));
assertEquals("currentBuild", structure.getOwner(path));
}
use of org.apache.maven.plugins.war.util.WebappStructure in project maven-plugins by apache.
the class WebappStructureTest method testRegisterSamePathTwice.
public void testRegisterSamePathTwice() {
final WebappStructure structure = new WebappStructure(new ArrayList<Dependency>());
structure.registerFile("overlay1", "WEB-INF/web.xml");
assertFalse(structure.registerFile("currentBuild", "WEB-INF/web.xml"));
}
use of org.apache.maven.plugins.war.util.WebappStructure in project maven-plugins by apache.
the class WebappStructureTest method testDependencyAnalysisWithNewDependency.
public void testDependencyAnalysisWithNewDependency() {
final List<Dependency> dependencies = new ArrayList<Dependency>();
dependencies.add(createDependency("groupTest", "artifactTest", "1.0"));
final WebappStructure cache = new WebappStructure(dependencies);
final List<Dependency> newDependencies = new ArrayList<Dependency>(dependencies);
final Dependency newDependency = createDependency("groupTest", "nexArtifact", "2.0");
newDependencies.add(newDependency);
final WebappStructure webappStructure = new WebappStructure(newDependencies, cache);
webappStructure.analyseDependencies(new WebappStructure.DependenciesAnalysisCallback() {
int count = 0;
public void unchangedDependency(Dependency dependency) {
if (count == 0) {
count++;
} else {
fail("Should have called unchanged dependency only once");
}
}
public void newDependency(Dependency dependency) {
if (!newDependency.equals(dependency)) {
fail("Called new dependency with an unexpected dependency " + dependency);
}
}
public void removedDependency(Dependency dependency) {
fail("Should have failed to trigger this callback");
}
public void updatedVersion(Dependency dependency, String previousVersion) {
fail("Should have failed to trigger this callback");
}
public void updatedScope(Dependency dependency, String previousScope) {
fail("Should have failed to trigger this callback");
}
public void updatedOptionalFlag(Dependency dependency, boolean previousOptional) {
fail("Should have failed to trigger this callback");
}
public void updatedUnknown(Dependency dependency, Dependency previousDep) {
fail("Should have failed to trigger this callback");
}
});
}
Aggregations