@@ -137,8 +137,9 @@ public void execStartAttachStdin() throws Exception {
137
137
.exec (new ExecStartResultCallback (stdout , System .err ))
138
138
.awaitCompletion (5 , TimeUnit .SECONDS );
139
139
140
- assertTrue (completed , "The process was not finished." );
141
140
assertEquals (stdout .toString ("UTF-8" ), "STDIN\n " );
141
+ assertTrue (completed , "The process was not finished." );
142
+
142
143
}
143
144
144
145
@ Test ()
@@ -156,7 +157,7 @@ public void execStartAttachStdinToShell() throws Exception {
156
157
157
158
dockerClient .startContainerCmd (container .getId ()).exec ();
158
159
159
- InputStream stdin = new ByteArrayInputStream ("ls\n " .getBytes ());
160
+ InputStream stdin = new ByteArrayInputStream ("ls\n exit \ n " .getBytes ());
160
161
161
162
ByteArrayOutputStream stdout = new ByteArrayOutputStream ();
162
163
@@ -201,8 +202,9 @@ public void execStartNotAttachedStdin() throws Exception {
201
202
.exec (new ExecStartResultCallback (stdout , System .err ))
202
203
.awaitCompletion (5 , TimeUnit .SECONDS );
203
204
205
+ assertEquals (stdout .toString (), "" );
204
206
// with v1.22 of the remote api the server closed the connection when no stdin was attached while exec create, so completed was true
205
207
assertFalse (completed , "The process was not finished." );
206
- assertEquals ( stdout . toString (), "" );
208
+
207
209
}
208
210
}
0 commit comments