@@ -49,12 +49,7 @@ public void beforeTest() throws DockerException {
4949 dockerClient = new DockerClient ("http://localhost:4243" );
5050 LOG .info ("Creating image 'busybox'" );
5151
52- InputStream in = null ;
53- try {
54- in = dockerClient .pull ("busybox" );
55- } finally {
56- IOUtils .closeQuietly (in );
57- }
52+ dockerClient .pull ("busybox" );
5853
5954 assertNotNull (dockerClient );
6055 LOG .info ("======================= END OF BEFORETEST =======================\n \n " );
@@ -117,7 +112,6 @@ public void testDockerInfo() throws DockerException {
117112 assertTrue (dockerInfo .toString ().contains ("images" ));
118113 assertTrue (dockerInfo .toString ().contains ("debug" ));
119114
120- assertFalse (dockerInfo .debug );
121115 assertTrue (dockerInfo .containers > 0 );
122116 assertTrue (dockerInfo .images > 0 );
123117 assertTrue (dockerInfo .NFd > 0 );
@@ -448,7 +442,7 @@ public void removeContainer() throws DockerException {
448442 * */
449443
450444 @ Test
451- public void testPullImage () throws DockerException {
445+ public void testPullImage () throws DockerException , IOException {
452446
453447 String testImage = "joffrey/test001" ;
454448
@@ -461,22 +455,10 @@ public void testPullImage() throws DockerException {
461455 int imgCount = info .images ;
462456
463457 LOG .info ("Pulling image " + testImage );
464- InputStream in = dockerClient .pull (testImage );
465458
466- byte [] buffer = new byte [1024 ];
467- try {
468- BufferedInputStream bis = new BufferedInputStream (in );
469- int bytesRead = 0 ;
470- while ((bytesRead = bis .read (buffer )) != -1 ) {
471- Thread .sleep (200 );
472- String logChunk = new String (buffer , 0 , bytesRead );
473- LOG .info (logChunk );
474- }
475- } catch (IOException ex ) {
476- } catch (InterruptedException e ) {
477- } finally {
478- IOUtils .closeQuietly (in );
479- }
459+ String response = dockerClient .pull (testImage );
460+
461+ assertThat (response , containsString ("Pulling image e9aa60c60128cad1 () from joffrey/test001" ));
480462
481463 tmpImgs .add (testImage );
482464
0 commit comments