|
22 | 22 |
|
23 | 23 | import com.github.dockerjava.api.DockerClient; |
24 | 24 | import com.github.dockerjava.api.DockerException; |
25 | | -import com.github.dockerjava.api.async.ResultCallback; |
26 | 25 | import com.github.dockerjava.api.command.InspectContainerResponse; |
27 | 26 | import com.github.dockerjava.api.model.Frame; |
28 | | -import com.github.dockerjava.api.model.PullResponseItem; |
29 | 27 | import com.github.dockerjava.api.model.Volume; |
30 | 28 | import com.github.dockerjava.api.model.VolumeBind; |
31 | 29 | import com.github.dockerjava.core.DockerClientBuilder; |
32 | 30 | import com.github.dockerjava.core.DockerClientConfig; |
33 | 31 | import com.github.dockerjava.core.TestDockerCmdExecFactory; |
34 | | -import com.github.dockerjava.core.async.ResultCallbackTemplate; |
35 | 32 | import com.github.dockerjava.core.command.BuildImageResultCallback; |
36 | 33 | import com.github.dockerjava.core.command.LogContainerResultCallback; |
37 | 34 | import com.github.dockerjava.core.command.PullImageResultCallback; |
@@ -188,46 +185,11 @@ public static void assertContainerHasVolumes(InspectContainerResponse inspectCon |
188 | 185 | assertThat(volumes, contains(expectedVolumes)); |
189 | 186 | } |
190 | 187 |
|
191 | | -// public static class CollectFramesCallback extends CollectStreamItemCallback<CollectFramesCallback, Frame> { |
192 | | -// |
193 | | -// @Override |
194 | | -// public void onNext(Frame frame) { |
195 | | -// items.add(frame); |
196 | | -// log.append(new String(frame.getPayload())); |
197 | | -// } |
198 | | -// |
199 | | -// } |
200 | | - |
201 | 188 | protected String containerLog(String containerId) throws Exception { |
202 | 189 | return dockerClient.logContainerCmd(containerId).withStdOut() |
203 | 190 | .exec(new LogContainerTestCallback()).awaitCompletion().toString(); |
204 | 191 | } |
205 | 192 |
|
206 | | -// public static class CollectStreamItemCallback<RC_T extends ResultCallback<A_RES_T>, A_RES_T> extends |
207 | | -// ResultCallbackTemplate<RC_T, A_RES_T> { |
208 | | -// public final List<A_RES_T> items = new ArrayList<A_RES_T>(); |
209 | | -// |
210 | | -// protected final StringBuffer log = new StringBuffer(); |
211 | | -// |
212 | | -// @Override |
213 | | -// public void onError(Throwable throwable) { |
214 | | -// throwable.printStackTrace(); |
215 | | -// super.onError(throwable); |
216 | | -// } |
217 | | -// |
218 | | -// @Override |
219 | | -// public void onNext(A_RES_T item) { |
220 | | -// items.add(item); |
221 | | -// log.append("" + item); |
222 | | -// LOG.info(item.toString()); |
223 | | -// } |
224 | | -// |
225 | | -// @Override |
226 | | -// public String toString() { |
227 | | -// return log.toString(); |
228 | | -// } |
229 | | -// } |
230 | | - |
231 | 193 | public static class LogContainerTestCallback extends LogContainerResultCallback { |
232 | 194 | protected final StringBuffer log = new StringBuffer(); |
233 | 195 |
|
|
0 commit comments