Search in sources :

Example 11 with ReadableArchive

use of org.glassfish.api.deployment.archive.ReadableArchive in project Payara by payara.

the class InputJarArchiveTest method testNestedTopLevelDirEntryNames.

@Test
public void testNestedTopLevelDirEntryNames() {
    try {
        System.out.println("nested top-level directory entry names in InputJarArchive");
        final ReadableArchive arch = getArchiveForTest();
        ReadableArchive subArchive = arch.getSubArchive(NESTED_JAR_ENTRY_NAME);
        final Set<String> returnedNames = new HashSet<String>(subArchive.getDirectories());
        assertEquals("Returned nested top-level directories do not match expected", testJarTopLevelDirEntryNames(), returnedNames);
        retireArchive(arch);
    } catch (IOException ex) {
        ex.printStackTrace(System.out);
        fail("Error during test");
    }
}
Also used : IOException(java.io.IOException) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 12 with ReadableArchive

use of org.glassfish.api.deployment.archive.ReadableArchive in project Payara by payara.

the class InputJarArchiveTest method testTopLevelDirEntryNamesForInputJarArchive.

@Test
public void testTopLevelDirEntryNamesForInputJarArchive() {
    try {
        System.out.println("top-level directory entry names in InputJarArchive");
        final ReadableArchive arch = getArchiveForTest();
        final Set<String> returnedNames = new HashSet<String>(arch.getDirectories());
        assertEquals("Returned top-level directories do not match expected", testJarTopLevelDirEntryNames(), returnedNames);
        retireArchive(arch);
    } catch (IOException ex) {
        ex.printStackTrace(System.out);
        fail("Error during test");
    }
}
Also used : IOException(java.io.IOException) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 13 with ReadableArchive

use of org.glassfish.api.deployment.archive.ReadableArchive in project Payara by payara.

the class InputJarArchiveTest method testNonDirEnryNames.

@Test
public void testNonDirEnryNames() {
    try {
        System.out.println("non-directory entry names in InputJarArchive");
        final ReadableArchive arch = getArchiveForTest();
        final Set<String> returnedNames = new HashSet<String>(setFromEnumeration(arch.entries()));
        assertEquals("Returned non-directory entry names do not match expected", testStandAloneArchiveJarNonDirEntryNames(), returnedNames);
        retireArchive(arch);
    } catch (IOException ex) {
        ex.printStackTrace(System.out);
        fail("Error during test");
    }
}
Also used : IOException(java.io.IOException) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 14 with ReadableArchive

use of org.glassfish.api.deployment.archive.ReadableArchive in project Payara by payara.

the class FileArchiveTest method testCreateWithOlderLeftoverEntry.

@Test
public void testCreateWithOlderLeftoverEntry() throws Exception {
    System.out.println("testCreateWithOlderLeftoverEntry");
    final ReadableArchive instance = createWithOlderLeftoverEntry(usualEntryNames);
    getListOfFilesCheckForLogRecord((FileArchive) instance, usualExpectedEntryNames);
}
Also used : ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive) Test(org.junit.Test)

Example 15 with ReadableArchive

use of org.glassfish.api.deployment.archive.ReadableArchive in project Payara by payara.

the class FileArchiveTest method createAndPopulateAndCheckArchive.

private void createAndPopulateAndCheckArchive(final Set<String> entryNames) throws Exception {
    final ReadableArchive instance = createAndPopulateArchive(entryNames);
    checkArchive(instance, usualExpectedEntryNames);
}
Also used : ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive)

Aggregations

ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)97 IOException (java.io.IOException)46 File (java.io.File)28 URI (java.net.URI)18 ActionReport (org.glassfish.api.ActionReport)17 ExtendedDeploymentContext (org.glassfish.internal.deployment.ExtendedDeploymentContext)14 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)12 WritableArchive (org.glassfish.api.deployment.archive.WritableArchive)12 Application (com.sun.enterprise.deployment.Application)10 JarFile (java.util.jar.JarFile)10 ArchiveHandler (org.glassfish.api.deployment.archive.ArchiveHandler)10 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)10 ArrayList (java.util.ArrayList)9 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)9 ConfigurationDeploymentDescriptorFile (com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile)8 Logger (java.util.logging.Logger)8 DeploymentDescriptorFile (com.sun.enterprise.deployment.io.DeploymentDescriptorFile)7 Manifest (java.util.jar.Manifest)7 HashSet (java.util.HashSet)6 HashMap (java.util.HashMap)5