use of org.apache.hadoop.ozone.client.OzoneClientStub in project ozone by apache.
the class TestBucketHead method setup.
@Before
public void setup() throws Exception {
clientStub = new OzoneClientStub();
clientStub.getObjectStore().createS3Bucket(bucketName);
// Create HeadBucket and setClient to OzoneClientStub
bucketEndpoint = new BucketEndpoint();
bucketEndpoint.setClient(clientStub);
}
use of org.apache.hadoop.ozone.client.OzoneClientStub in project ozone by apache.
the class TestBucketPut method setup.
@Before
public void setup() throws Exception {
// Create client stub and object store stub.
clientStub = new OzoneClientStub();
// Create HeadBucket and setClient to OzoneClientStub
bucketEndpoint = new BucketEndpoint();
bucketEndpoint.setClient(clientStub);
}
use of org.apache.hadoop.ozone.client.OzoneClientStub in project ozone by apache.
the class TestListParts method setUp.
@BeforeClass
public static void setUp() throws Exception {
OzoneClient client = new OzoneClientStub();
client.getObjectStore().createS3Bucket(OzoneConsts.S3_BUCKET);
HttpHeaders headers = Mockito.mock(HttpHeaders.class);
when(headers.getHeaderString(STORAGE_CLASS_HEADER)).thenReturn("STANDARD");
REST.setHeaders(headers);
REST.setClient(client);
REST.setOzoneConfiguration(new OzoneConfiguration());
Response response = REST.initializeMultipartUpload(OzoneConsts.S3_BUCKET, OzoneConsts.KEY);
MultipartUploadInitiateResponse multipartUploadInitiateResponse = (MultipartUploadInitiateResponse) response.getEntity();
assertNotNull(multipartUploadInitiateResponse.getUploadID());
uploadID = multipartUploadInitiateResponse.getUploadID();
assertEquals(200, response.getStatus());
String content = "Multipart Upload";
ByteArrayInputStream body = new ByteArrayInputStream(content.getBytes(UTF_8));
response = REST.put(OzoneConsts.S3_BUCKET, OzoneConsts.KEY, content.length(), 1, uploadID, body);
assertNotNull(response.getHeaderString("ETag"));
response = REST.put(OzoneConsts.S3_BUCKET, OzoneConsts.KEY, content.length(), 2, uploadID, body);
assertNotNull(response.getHeaderString("ETag"));
response = REST.put(OzoneConsts.S3_BUCKET, OzoneConsts.KEY, content.length(), 3, uploadID, body);
assertNotNull(response.getHeaderString("ETag"));
}
use of org.apache.hadoop.ozone.client.OzoneClientStub in project ozone by apache.
the class TestObjectPut method setup.
@Before
public void setup() throws IOException {
// Create client stub and object store stub.
clientStub = new OzoneClientStub();
// Create bucket
clientStub.getObjectStore().createS3Bucket(bucketName);
clientStub.getObjectStore().createS3Bucket(destBucket);
// Create PutObject and setClient to OzoneClientStub
objectEndpoint = new ObjectEndpoint();
objectEndpoint.setClient(clientStub);
objectEndpoint.setOzoneConfiguration(new OzoneConfiguration());
}
Aggregations