ArchiveUtils { public static void deploy(String archiveUrl, SshMachineLocation machine, String destDir) { deploy(MutableMap.<String, Object>of(), archiveUrl, machine, destDir); }  static List<String> installCommands(String fileName); static List<String> extractCommands(String fileName, String sourceDir, String targetDir, boolean extractJar); static List<String> extractCommands(String fileName, String sourceDir, String targetDir, boolean extractJar, boolean keepOriginal); static List<String> extractCommands(String fileName, String sourceDir); static void deploy(String archiveUrl, SshMachineLocation machine, String destDir); static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String destDir); static void deploy(String archiveUrl, SshMachineLocation machine, String destDir, String destFile); static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String destDir, String destFile); static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String tmpDir, String destDir, String destFile); static boolean deploy(ResourceUtils resolver, Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String destDir, boolean keepArchiveAfterUnpacking, String optionalTmpDir, String optionalDestFile); static int install(SshMachineLocation machine, String urlToInstall, String target); static int install(Map<String, ?> props, SshMachineLocation machine, String urlToInstall, String target, int numAttempts); static int install(ResourceUtils resolver, Map<String, ?> props, SshMachineLocation machine, String urlToInstall, String target, int numAttempts); static String readFullyString(File sourceFile); static void extractZip(final ZipFile zip, final String targetFolder); static final int NUM_RETRIES_FOR_COPYING; }
@Test(groups="Integration") public void testDeployZipWithNoOptionalArgsSupplied() throws Exception { boolean result = ArchiveUtils.deploy(resourceUtils, ImmutableMap.<String, Object>of(), origZip.getAbsolutePath(), machine, destDir.getAbsolutePath(), true, null, null); assertTrue(result); assertFilesEqual(new File(destDir, origZip.getName()), origZip); assertSubFilesEqual(destDir, archiveContents); }
@Test(groups="Integration") public void testDeployZipDeletingArchiveAfterUnpack() throws Exception { boolean result = ArchiveUtils.deploy(resourceUtils, ImmutableMap.<String, Object>of(), origZip.getAbsolutePath(), machine, destDir.getAbsolutePath(), false, null, null); assertTrue(result); assertFalse(new File(destDir, origZip.getName()).exists()); assertSubFilesEqual(destDir, archiveContents); }
@Test(groups="Integration") public void testDeployJarNotUnpacked() throws Exception { ArchiveUtils.deploy(origJar.getAbsolutePath(), machine, destDir.getAbsolutePath()); assertFilesEqual(new File(destDir, origJar.getName()), origJar); }
@Test(groups="Integration") public void testDeployExplicitDestFile() throws Exception { String destFile = "custom-destFile.jar"; ArchiveUtils.deploy(origJar.getAbsolutePath(), machine, destDir.getAbsolutePath(), destFile); assertFilesEqual(new File(destDir, destFile), origJar); }