@Test(expectedExceptions = IllegalStateException.class) public void testWithoutInitThrowsIllegalStateException() { Statement command = exec("doFoo"); NodeMetadata node = new NodeMetadataBuilder().ids("id").status(Status.RUNNING).credentials( LoginCredentials.builder().user("tester").password("testpassword!").build()).build(); SshClient sshClient = createMock(SshClient.class); replay(sshClient); RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete testMe = new RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete( statusFactory, timeouts, Functions.forMap(ImmutableMap.of(node, sshClient)), eventBus, InitScriptConfigurationForTasks.create().appendIncrementingNumberToAnonymousTaskNames(), node, command, new RunScriptOptions()); testMe.call(); }
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
@Test(expectedExceptions = IllegalStateException.class) public void testWithoutInitThrowsIllegalStateException() { Statement command = exec("doFoo"); NodeMetadata node = new NodeMetadataBuilder().ids("id").status(Status.RUNNING).credentials( LoginCredentials.builder().user("tester").password("testpassword!").build()).build(); SshClient sshClient = createMock(SshClient.class); replay(sshClient); RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete testMe = new RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete( statusFactory, timeouts, Functions.forMap(ImmutableMap.of(node, sshClient)), eventBus, InitScriptConfigurationForTasks.create().appendIncrementingNumberToAnonymousTaskNames(), node, command, new RunScriptOptions()); testMe.call(); }
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 1));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 1));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));
assertEquals(testMe.call(), new ExecResponse("out", "err", 0));