1515import static org .hamcrest .Matchers .isEmptyString ;
1616import static org .hamcrest .Matchers .not ;
1717
18+ @ Test (groups = "integration" )
1819public class ExecStartCmdImplTest extends AbstractDockerClientTest {
1920 @ BeforeTest
2021 public void beforeTest () throws DockerException {
@@ -41,7 +42,7 @@ public void execStartTest() throws Exception {
4142 String containerName = "generated_" + new SecureRandom ().nextInt ();
4243
4344 CreateContainerResponse container = dockerClient
44- .createContainerCmd ("busybox" ).withCmd ("env " )
45+ .createContainerCmd ("busybox" ).withCmd ("top " )
4546 .withName (containerName ).exec ();
4647
4748 LOG .info ("Created container {}" , container .toString ());
@@ -50,13 +51,10 @@ public void execStartTest() throws Exception {
5051
5152 dockerClient .startContainerCmd (container .getId ()).exec ();
5253
53- dockerClient .waitContainerCmd (container .getId ()).exec ();
54-
55- ExecCreateCmdResponse execCreateCmdResponse = dockerClient .execCreateCmd (container .getId ()).withCmd ("touch" ,"file.log" ).exec ();
56-
54+ ExecCreateCmdResponse execCreateCmdResponse = dockerClient .execCreateCmd (container .getId ()).attachStdout (true ).withCmd ("touch" ,"file.log" ).exec ();
5755 dockerClient .execStartCmd (execCreateCmdResponse .getId ()).exec ();
5856
59- InputStream response = dockerClient .copyFileFromContainerCmd (container .getId (), "file.log" ).exec ();
57+ InputStream response = dockerClient .copyFileFromContainerCmd (container .getId (), "/ file.log" ).exec ();
6058 assertTrue (response .available () > 0 , "The file was not copied from the container." );
6159 }
6260}
0 commit comments