use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.
the class TestStatusResource method testGetClusterStatusPB.
@Test
public void testGetClusterStatusPB() throws IOException {
Response response = client.get("/status/cluster", Constants.MIMETYPE_PROTOBUF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
StorageClusterStatusModel model = new StorageClusterStatusModel();
model.getObjectFromMessage(response.getBody());
validate(model);
response = client.get("/status/cluster", Constants.MIMETYPE_PROTOBUF_IETF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF_IETF, response.getHeader("content-type"));
model = new StorageClusterStatusModel();
model.getObjectFromMessage(response.getBody());
validate(model);
}
use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.
the class TestTableResource method testTableListPB.
@Test
public void testTableListPB() throws IOException, JAXBException {
Response response = client.get("/", Constants.MIMETYPE_PROTOBUF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
TableListModel model = new TableListModel();
model.getObjectFromMessage(response.getBody());
checkTableList(model);
response = client.get("/", Constants.MIMETYPE_PROTOBUF_IETF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF_IETF, response.getHeader("content-type"));
model = new TableListModel();
model.getObjectFromMessage(response.getBody());
checkTableList(model);
}
use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.
the class TestTableResource method testTableInfoPB.
@Test
public void testTableInfoPB() throws IOException, JAXBException {
Response response = client.get("/" + TABLE + "/regions", Constants.MIMETYPE_PROTOBUF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
TableInfoModel model = new TableInfoModel();
model.getObjectFromMessage(response.getBody());
checkTableInfo(model);
response = client.get("/" + TABLE + "/regions", Constants.MIMETYPE_PROTOBUF_IETF);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_PROTOBUF_IETF, response.getHeader("content-type"));
model = new TableInfoModel();
model.getObjectFromMessage(response.getBody());
checkTableInfo(model);
}
use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.
the class TestTableResource method testTableListXML.
@Test
public void testTableListXML() throws IOException, JAXBException {
Response response = client.get("/", Constants.MIMETYPE_XML);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
TableListModel model = (TableListModel) context.createUnmarshaller().unmarshal(new ByteArrayInputStream(response.getBody()));
checkTableList(model);
}
use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.
the class TestTableResource method testTableListJSON.
@Test
public void testTableListJSON() throws IOException {
Response response = client.get("/", Constants.MIMETYPE_JSON);
assertEquals(response.getCode(), 200);
assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
}
Aggregations