use of io.fabric8.internal.ContainerImpl in project fabric8 by jboss-fuse.
the class ContainerLifecycleCommandsTest method testStopAllMatchingContainers.
@Test
public void testStopAllMatchingContainers() throws Exception {
// should preserve order
containers("c1", "c3", "c2");
ContainerImpl c1 = newContainer("c1");
ContainerImpl c2 = newContainer("c2");
ContainerImpl c3 = newContainer("c3");
expect(this.fabricService.adapt(CuratorFramework.class)).andReturn(this.curatorFramework).anyTimes();
expect(this.fabricService.getContainers()).andReturn(new Container[] { c1, c3, c2 });
this.fabricService.stopContainer(c1, false);
expect(this.fabricService.adapt(CuratorFramework.class)).andReturn(this.curatorFramework).anyTimes();
expect(this.fabricService.getContainers()).andReturn(new Container[] { c1, c3, c2 });
this.fabricService.stopContainer(c3, false);
expect(this.fabricService.adapt(CuratorFramework.class)).andReturn(this.curatorFramework).anyTimes();
expect(this.fabricService.getContainers()).andReturn(new Container[] { c1, c3, c2 });
this.fabricService.stopContainer(c2, false);
replay(this.fabricService, this.commandSession);
this.stop.execute(this.commandSession);
verify(this.fabricService);
}
Aggregations