|
@@ -276,7 +276,8 @@ public class TestOzoneContainer {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void testCloseContainer() throws Exception {
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void testCloseContainer() throws Exception {
|
|
MiniOzoneCluster cluster = null;
|
|
MiniOzoneCluster cluster = null;
|
|
XceiverClient client = null;
|
|
XceiverClient client = null;
|
|
try {
|
|
try {
|
|
@@ -307,17 +308,19 @@ public class TestOzoneContainer {
|
|
client.connect();
|
|
client.connect();
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // Create container
|
|
|
|
+ ContainerProtos.ContainerCommandRequestProto request =
|
|
|
|
+ ContainerTestHelper.getCreateContainerRequest(containerName);
|
|
|
|
+ ContainerProtos.ContainerCommandResponseProto response =
|
|
|
|
+ client.sendCommand(request);
|
|
|
|
+ Assert.assertNotNull(response);
|
|
|
|
+ Assert.assertTrue(request.getTraceID().equals(response.getTraceID()));
|
|
|
|
+
|
|
ContainerProtos.ContainerCommandRequestProto writeChunkRequest =
|
|
ContainerProtos.ContainerCommandRequestProto writeChunkRequest =
|
|
ContainerTestHelper.getWriteChunkRequest(pipeline, containerName,
|
|
ContainerTestHelper.getWriteChunkRequest(pipeline, containerName,
|
|
keyName, 1024);
|
|
keyName, 1024);
|
|
|
|
|
|
- ContainerProtos.ContainerCommandRequestProto request;
|
|
|
|
- ContainerProtos.ContainerCommandResponseProto response;
|
|
|
|
-
|
|
|
|
- ContainerProtos.ContainerCommandRequestProto putKeyRequest =
|
|
|
|
- ContainerTestHelper.getPutKeyRequest(writeChunkRequest
|
|
|
|
- .getWriteChunk());
|
|
|
|
-
|
|
|
|
// Write Chunk before closing
|
|
// Write Chunk before closing
|
|
response = client.sendCommand(writeChunkRequest);
|
|
response = client.sendCommand(writeChunkRequest);
|
|
Assert.assertNotNull(response);
|
|
Assert.assertNotNull(response);
|
|
@@ -327,6 +330,9 @@ public class TestOzoneContainer {
|
|
.getTraceID()));
|
|
.getTraceID()));
|
|
|
|
|
|
|
|
|
|
|
|
+ ContainerProtos.ContainerCommandRequestProto putKeyRequest =
|
|
|
|
+ ContainerTestHelper.getPutKeyRequest(writeChunkRequest
|
|
|
|
+ .getWriteChunk());
|
|
// Put key before closing.
|
|
// Put key before closing.
|
|
response = client.sendCommand(putKeyRequest);
|
|
response = client.sendCommand(putKeyRequest);
|
|
Assert.assertNotNull(response);
|
|
Assert.assertNotNull(response);
|