@Test public void shouldDownloadLauncherJarIfLocalCopyIsStale_butShouldReturnWithoutDownloadingOrLaunchingAgent() throws Exception { File launcher = randomFile(AGENT_LAUNCHER_JAR); long original = launcher.length(); File agentFile = randomFile(AGENT_BINARY_JAR); long originalAgentLength = agentFile.length(); new AgentLauncherImpl().launch(launchDescriptor()); assertThat(launcher.length(), not(original)); assertThat(agentFile.length(), is(originalAgentLength)); }
@Test public void shouldDownloadLauncherJarIfLocalCopyIsStale() throws IOException { //because new invocation will take care of pulling latest agent down, and will then operate on it with the latest launcher -jj File staleJar = randomFile(AGENT_LAUNCHER_JAR); long original = staleJar.length(); new AgentLauncherImpl().launch(launchDescriptor()); assertThat(staleJar.length(), not(original)); }
@Test public void shouldDownload_AgentJar_IfTheCurrentJarIsStale() throws Exception { if (!OS_CHECKER.satisfy()) { TEST_AGENT_LAUNCHER.copyTo(AGENT_LAUNCHER_JAR); File staleJar = randomFile(AGENT_BINARY_JAR); long original = staleJar.length(); new AgentLauncherImpl().launch(launchDescriptor()); assertThat(staleJar.length(), not(original)); } }