Exemplo n.º 1
0
 @Test(dependsOnMethods = "testListImages")
 public void testCreateContainer() throws IOException, InterruptedException {
   Config containerConfig =
       Config.builder()
           .imageId(image.getId())
           .cmd(
               ImmutableList.of("/bin/sh", "-c", "while true; do echo hello world; sleep 1; done"))
           .build();
   container = api().createContainer("testCreateContainer", containerConfig);
   assertNotNull(container);
   assertNotNull(container.getId());
 }
Exemplo n.º 2
0
 @Test(dependsOnMethods = "testStopContainer", expectedExceptions = NullPointerException.class)
 public void testRemoveContainer() {
   api().removeContainer(container.getId());
   assertFalse(api().inspectContainer(container.getId()).getState().isRunning());
 }
Exemplo n.º 3
0
 @Test(dependsOnMethods = "testStartContainer")
 public void testStopContainer() {
   api().stopContainer(container.getId());
   assertFalse(api().inspectContainer(container.getId()).getState().isRunning());
 }
Exemplo n.º 4
0
 @Test(dependsOnMethods = "testCreateContainer")
 public void testStartContainer() throws IOException, InterruptedException {
   api().startContainer(container.getId());
   assertTrue(api().inspectContainer(container.getId()).getState().isRunning());
 }