verify(c1, c2);
}
@Test(expected = ProvisionException.class)
public void testMultipleProvisionSuccessWithFailure() 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.isAliveAndOK()).andReturn(true).anyTimes();
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.isAliveAndOK()).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("error").anyTimes();
expect(c2.getSshUrl()).andReturn("container2:8181").anyTimes();
expect(c2.getProvisionException()).andReturn(null).anyTimes();
makeThreadSafe(c1, true);
makeThreadSafe(c2, true);
replay(c1, c2);
Provision.provisioningSuccess(Arrays.asList(c1, c2), 10000L, ContainerCallback.DO_NOTHING);