@Test(groups = "Integration") public void testInstallClasspathCopyTo() throws Exception { File dest = new File(Os.tmp(), "sshMachineLocationTest_dir/"); dest.mkdir(); try { int result = host.installTo("classpath://brooklyn/config/sample.properties", Urls.mergePaths(dest.getAbsolutePath(), "sample.properties")); assertEquals(result, 0); String contents = ArchiveUtils.readFullyString(new File(dest, "sample.properties")); assertTrue(contents.contains("Property 1"), "contents missing expected phrase; contains:\n"+contents); } finally { dest.delete(); } }
@Test(groups = "Integration") public void testInstallUrlTo() throws Exception { File dest = new File(Os.tmp(), "sshMachineLocationTest_dir/"); dest.mkdir(); try { int result = host.installTo("https://raw.github.com/brooklyncentral/brooklyn/master/README.md", Urls.mergePaths(dest.getAbsolutePath(), "README.md")); assertEquals(result, 0); String contents = ArchiveUtils.readFullyString(new File(dest, "README.md")); assertTrue(contents.contains("http://brooklyncentral.github.com"), "contents missing expected phrase; contains:\n"+contents); } finally { dest.delete(); } }