Search in sources :

Example 6 with Response

use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.

the class TestTableResource method testTableInfoXML.

@Test
public void testTableInfoXML() throws IOException, JAXBException {
    Response response = client.get("/" + TABLE + "/regions", Constants.MIMETYPE_XML);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type"));
    TableInfoModel model = (TableInfoModel) context.createUnmarshaller().unmarshal(new ByteArrayInputStream(response.getBody()));
    checkTableInfo(model);
}
Also used : Response(org.apache.hadoop.hbase.rest.client.Response) TableInfoModel(org.apache.hadoop.hbase.rest.model.TableInfoModel) ByteArrayInputStream(java.io.ByteArrayInputStream) Test(org.junit.Test)

Example 7 with Response

use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.

the class TestTableResource method testTableInfoText.

@Test
public void testTableInfoText() throws IOException {
    Response response = client.get("/" + TABLE + "/regions", Constants.MIMETYPE_TEXT);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_TEXT, response.getHeader("content-type"));
}
Also used : Response(org.apache.hadoop.hbase.rest.client.Response) Test(org.junit.Test)

Example 8 with Response

use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.

the class TestTableResource method testTableListText.

@Test
public void testTableListText() throws IOException {
    Response response = client.get("/", Constants.MIMETYPE_TEXT);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_TEXT, response.getHeader("content-type"));
}
Also used : Response(org.apache.hadoop.hbase.rest.client.Response) Test(org.junit.Test)

Example 9 with Response

use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.

the class TestTableResource method testTableInfoJSON.

@Test
public void testTableInfoJSON() throws IOException {
    Response response = client.get("/" + TABLE + "/regions", Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
}
Also used : Response(org.apache.hadoop.hbase.rest.client.Response) Test(org.junit.Test)

Example 10 with Response

use of org.apache.hadoop.hbase.rest.client.Response in project hbase by apache.

the class TestVersionResource method testGetStargateVersionPB.

@Test
public void testGetStargateVersionPB() throws IOException {
    Response response = client.get("/version", Constants.MIMETYPE_PROTOBUF);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type"));
    VersionModel model = new VersionModel();
    model.getObjectFromMessage(response.getBody());
    validate(model);
    response = client.get("/version", Constants.MIMETYPE_PROTOBUF_IETF);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_PROTOBUF_IETF, response.getHeader("content-type"));
    model = new VersionModel();
    model.getObjectFromMessage(response.getBody());
    validate(model);
}
Also used : Response(org.apache.hadoop.hbase.rest.client.Response) StorageClusterVersionModel(org.apache.hadoop.hbase.rest.model.StorageClusterVersionModel) VersionModel(org.apache.hadoop.hbase.rest.model.VersionModel) Test(org.junit.Test)

Aggregations

Response (org.apache.hadoop.hbase.rest.client.Response)111 Test (org.junit.Test)90 CellSetModel (org.apache.hadoop.hbase.rest.model.CellSetModel)44 RowModel (org.apache.hadoop.hbase.rest.model.RowModel)34 CellModel (org.apache.hadoop.hbase.rest.model.CellModel)27 ByteArrayInputStream (java.io.ByteArrayInputStream)17 StringWriter (java.io.StringWriter)16 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)11 JacksonJaxbJsonProvider (org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)11 ScannerModel (org.apache.hadoop.hbase.rest.model.ScannerModel)10 HashMap (java.util.HashMap)9 Admin (org.apache.hadoop.hbase.client.Admin)9 JAXBContext (javax.xml.bind.JAXBContext)8 Unmarshaller (javax.xml.bind.Unmarshaller)8 Header (org.apache.http.Header)6 Map (java.util.Map)5 StorageClusterVersionModel (org.apache.hadoop.hbase.rest.model.StorageClusterVersionModel)5 NamespaceDescriptor (org.apache.hadoop.hbase.NamespaceDescriptor)4 NamespacesInstanceModel (org.apache.hadoop.hbase.rest.model.NamespacesInstanceModel)4 TestNamespacesInstanceModel (org.apache.hadoop.hbase.rest.model.TestNamespacesInstanceModel)4