use of org.codehaus.plexus.archiver.zip.ZipFile in project aries by apache.
the class EbaMojoTest method testBasicEbaWithDescriptor.
public void testBasicEbaWithDescriptor() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/basic-eba-with-descriptor/plugin-config.xml");
EbaMojo mojo = (EbaMojo) lookupMojo("eba", testPom);
assertNotNull(mojo);
String finalName = (String) getVariableValueFromObject(mojo, "finalName");
String workDir = (String) getVariableValueFromObject(mojo, "workDirectory");
String outputDir = (String) getVariableValueFromObject(mojo, "outputDirectory");
mojo.execute();
//check the generated eba file
File ebaFile = new File(outputDir, finalName + ".eba");
assertTrue(ebaFile.exists());
//expected files/directories inside the eba file
List expectedFiles = new ArrayList();
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.properties");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.xml");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/");
expectedFiles.add("META-INF/maven/org.apache.maven.test/");
expectedFiles.add("META-INF/maven/");
// expectedFiles.add( "META-INF/MANIFEST.MF" );
expectedFiles.add("META-INF/APPLICATION.MF");
expectedFiles.add("META-INF/");
expectedFiles.add("maven-artifact01-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact02-1.0-SNAPSHOT.jar");
ZipFile eba = new ZipFile(ebaFile);
Enumeration entries = eba.getEntries();
assertTrue(entries.hasMoreElements());
assertTrue(entries.hasMoreElements());
int missing = getSizeOfExpectedFiles(entries, expectedFiles);
assertEquals("Missing files: " + expectedFiles, 0, missing);
}
use of org.codehaus.plexus.archiver.zip.ZipFile in project aries by apache.
the class EbaMojoTest method testArchiveContentConfigurationAllBundles.
public void testArchiveContentConfigurationAllBundles() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/basic-eba-all-bundles/plugin-config.xml");
EbaMojo mojo = (EbaMojo) lookupMojo("eba", testPom);
assertNotNull(mojo);
String finalName = (String) getVariableValueFromObject(mojo, "finalName");
String workDir = (String) getVariableValueFromObject(mojo, "workDirectory");
String outputDir = (String) getVariableValueFromObject(mojo, "outputDirectory");
mojo.execute();
//check the generated eba file
File ebaFile = new File(outputDir, finalName + ".eba");
assertTrue(ebaFile.exists());
//expected files/directories inside the eba file
List expectedFiles = new ArrayList();
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.properties");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.xml");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/");
expectedFiles.add("META-INF/maven/org.apache.maven.test/");
expectedFiles.add("META-INF/maven/");
expectedFiles.add("META-INF/APPLICATION.MF");
expectedFiles.add("META-INF/");
expectedFiles.add("maven-artifact01-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact02-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact03-1.0-SNAPSHOT.jar");
ZipFile eba = new ZipFile(ebaFile);
Enumeration entries = eba.getEntries();
assertTrue(entries.hasMoreElements());
int missing = getSizeOfExpectedFiles(entries, expectedFiles);
assertEquals("Missing files: " + expectedFiles, 0, missing);
}
use of org.codehaus.plexus.archiver.zip.ZipFile in project aries by apache.
the class EbaMojoTest method testBasicEbaWithManifest.
public void testBasicEbaWithManifest() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/basic-eba-with-manifest/plugin-config.xml");
EbaMojo mojo = (EbaMojo) lookupMojo("eba", testPom);
assertNotNull(mojo);
String finalName = (String) getVariableValueFromObject(mojo, "finalName");
String workDir = (String) getVariableValueFromObject(mojo, "workDirectory");
String outputDir = (String) getVariableValueFromObject(mojo, "outputDirectory");
mojo.execute();
//check the generated eba file
File ebaFile = new File(outputDir, finalName + ".eba");
assertTrue(ebaFile.exists());
//expected files/directories inside the eba file
List expectedFiles = new ArrayList();
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.properties");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/pom.xml");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-eba-test/");
expectedFiles.add("META-INF/maven/org.apache.maven.test/");
expectedFiles.add("META-INF/maven/");
expectedFiles.add("META-INF/MANIFEST.MF");
expectedFiles.add("META-INF/APPLICATION.MF");
expectedFiles.add("META-INF/");
expectedFiles.add("maven-artifact01-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact02-1.0-SNAPSHOT.jar");
ZipFile eba = new ZipFile(ebaFile);
Enumeration entries = eba.getEntries();
assertTrue(entries.hasMoreElements());
int missing = getSizeOfExpectedFiles(entries, expectedFiles);
assertEquals("Missing files: " + expectedFiles, 0, missing);
}
use of org.codehaus.plexus.archiver.zip.ZipFile in project aries by apache.
the class EsaMojoTest method testBasicEsa.
private void testBasicEsa(String path, String extraExpectedFiles) throws Exception {
File testPom = new File(getBasedir(), path);
EsaMojo mojo = (EsaMojo) lookupMojo("esa", testPom);
assertNotNull(mojo);
String finalName = (String) getVariableValueFromObject(mojo, "finalName");
String workDir = (String) getVariableValueFromObject(mojo, "workDirectory");
String outputDir = (String) getVariableValueFromObject(mojo, "outputDirectory");
mojo.execute();
//check the generated esa file
File esaFile = new File(outputDir, finalName + ".esa");
assertTrue(esaFile.exists());
//expected files/directories inside the esa file
List expectedFiles = new ArrayList();
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/pom.properties");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/pom.xml");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/");
expectedFiles.add("META-INF/maven/org.apache.maven.test/");
expectedFiles.add("META-INF/maven/");
expectedFiles.add("META-INF/");
expectedFiles.add("maven-artifact01-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact02-1.0-SNAPSHOT.jar");
if (extraExpectedFiles != null) {
expectedFiles.add(extraExpectedFiles);
}
ZipFile esa = new ZipFile(esaFile);
Enumeration entries = esa.getEntries();
assertTrue(entries.hasMoreElements());
assertTrue(entries.hasMoreElements());
int missing = getSizeOfExpectedFiles(entries, expectedFiles);
assertEquals("Missing files: " + expectedFiles, 0, missing);
}
use of org.codehaus.plexus.archiver.zip.ZipFile in project aries by apache.
the class EsaMojoTest method testBasicEsaWithDescriptor.
public void testBasicEsaWithDescriptor() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/basic-esa-with-descriptor/plugin-config.xml");
EsaMojo mojo = (EsaMojo) lookupMojo("esa", testPom);
assertNotNull(mojo);
String finalName = (String) getVariableValueFromObject(mojo, "finalName");
String workDir = (String) getVariableValueFromObject(mojo, "workDirectory");
String outputDir = (String) getVariableValueFromObject(mojo, "outputDirectory");
mojo.execute();
//check the generated esa file
File esaFile = new File(outputDir, finalName + ".esa");
assertTrue(esaFile.exists());
//expected files/directories inside the esa file
List expectedFiles = new ArrayList();
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/pom.properties");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/pom.xml");
expectedFiles.add("META-INF/maven/org.apache.maven.test/maven-esa-test/");
expectedFiles.add("META-INF/maven/org.apache.maven.test/");
expectedFiles.add("META-INF/maven/");
expectedFiles.add("META-INF/");
expectedFiles.add("OSGI-INF/SUBSYSTEM.MF");
expectedFiles.add("OSGI-INF/");
expectedFiles.add("maven-artifact01-1.0-SNAPSHOT.jar");
expectedFiles.add("maven-artifact02-1.0-SNAPSHOT.jar");
ZipFile esa = new ZipFile(esaFile);
Enumeration entries = esa.getEntries();
assertTrue(entries.hasMoreElements());
assertTrue(entries.hasMoreElements());
int missing = getSizeOfExpectedFiles(entries, expectedFiles);
assertEquals("Missing files: " + expectedFiles, 0, missing);
}
Aggregations