private void assertTransform(String id, List<String> source, Map<String,String> expectedHeaders) throws IOException, SAXException
{
String prefix = "/" + getClass().getPackage().getName().replace('.', '/') + "/" + id + "/";
PluginJarBuilder builder = new PluginJarBuilder();
Set<String> allDirs = newHashSet();
for (String path : source)
{
builder.addFormattedResource(path, getResource(prefix + path));
String[] dirs = path.split("/");
StringBuilder pwd = new StringBuilder();
for (int x=0; x<dirs.length - 1; x++)
{
pwd.append(dirs[x]).append("/");
if (allDirs.add(pwd.toString()))
{
builder.addResource(pwd.toString(), "");
}
}
}
File jar = builder.buildWithNoManifest();
File zip = new File(jar.getPath() + ".zip");
FileUtils.moveFile(jar, zip);
final JarPluginArtifact jarArtifact = new JarPluginArtifact(zip);
JsonManifest jsonMf = new JsonManifestHandler().read(jarArtifact);