public Archive<?> generateDeployment(TestDeployment testDeployment, Collection<ProtocolArchiveProcessor> processors)
{
Archive<?> applicationArchive = testDeployment.getApplicationArchive();
if (applicationArchive instanceof ForgeArchive)
{
ForgeArchive deployment = ForgeArchive.class.cast(applicationArchive);
Collection<Archive<?>> auxiliaryArchives = testDeployment.getAuxiliaryArchives();
for (Archive<?> archive : auxiliaryArchives)
{
Map<ArchivePath, Node> content = archive.getContent(new Filter<ArchivePath>()
{
@Override
public boolean include(ArchivePath path)
{
return SHRINKWRAP_DESCRIPTOR_PATTERN.matcher(path.get()).matches();
}
});
// Reversing the paths to avoid concurrent modification exceptions
TreeSet<ArchivePath> toRemove = new TreeSet<ArchivePath>(Collections.reverseOrder());
toRemove.addAll(content.keySet());
for (ArchivePath path : toRemove)
{
archive.delete(path);
}
deployment.addAsLibrary(archive);
}
deployment.addClasses(ForgeArchive.class);
return deployment;
}
else if (applicationArchive instanceof ForgeRemoteAddon)
{