verify(c1, c2);
}
@Test
public void testMultipleContainerStatusWithTimeout() throws Exception {
Container c1 = createMock(Container.class);
expect(c1.getId()).andReturn("c1").anyTimes();
expect(c1.isManaged()).andReturn(true).anyTimes();
expect(c1.isAlive()).andReturn(true).anyTimes();
expect(c1.getProvisionStatus()).andReturn("").times(3);
expect(c1.getProvisionStatus()).andReturn("analyzing").times(3);
expect(c1.getProvisionStatus()).andReturn("installing").times(3);
expect(c1.getProvisionStatus()).andReturn("success").anyTimes();
expect(c1.getSshUrl()).andReturn("container:8181").anyTimes();
expect(c1.getProvisionException()).andReturn(null).anyTimes();
Container c2 = createMock(Container.class);
expect(c2.getId()).andReturn("c2").anyTimes();
expect(c2.isManaged()).andReturn(true).anyTimes();
expect(c2.isAlive()).andReturn(false).times(3);
expect(c2.isAlive()).andReturn(true).anyTimes();
expect(c2.getProvisionStatus()).andReturn("").times(3);
expect(c2.getProvisionStatus()).andReturn("analyzing").times(3);
expect(c2.getProvisionStatus()).andReturn("installing").times(3);
expect(c2.getProvisionStatus()).andReturn("finalizing").anyTimes();
expect(c2.getSshUrl()).andReturn("container2:8181").anyTimes();
expect(c2.getProvisionException()).andReturn(null).anyTimes();
replay(c1, c2);
assertFalse(Provision.containerStatus(Arrays.asList(c1, c2), 10000L));
verify(c1, c2);