@@ -137,8 +137,9 @@ public void execStartAttachStdin() throws Exception {
137137 .exec (new ExecStartResultCallback (stdout , System .err ))
138138 .awaitCompletion (5 , TimeUnit .SECONDS );
139139
140- assertTrue (completed , "The process was not finished." );
141140 assertEquals (stdout .toString ("UTF-8" ), "STDIN\n " );
141+ assertTrue (completed , "The process was not finished." );
142+
142143 }
143144
144145 @ Test ()
@@ -156,7 +157,7 @@ public void execStartAttachStdinToShell() throws Exception {
156157
157158 dockerClient .startContainerCmd (container .getId ()).exec ();
158159
159- InputStream stdin = new ByteArrayInputStream ("ls\n " .getBytes ());
160+ InputStream stdin = new ByteArrayInputStream ("ls\n exit \ n " .getBytes ());
160161
161162 ByteArrayOutputStream stdout = new ByteArrayOutputStream ();
162163
@@ -201,8 +202,9 @@ public void execStartNotAttachedStdin() throws Exception {
201202 .exec (new ExecStartResultCallback (stdout , System .err ))
202203 .awaitCompletion (5 , TimeUnit .SECONDS );
203204
205+ assertEquals (stdout .toString (), "" );
204206 // with v1.22 of the remote api the server closed the connection when no stdin was attached while exec create, so completed was true
205207 assertFalse (completed , "The process was not finished." );
206- assertEquals ( stdout . toString (), "" );
208+
207209 }
208210}
0 commit comments