Package org.apache.hadoop.hbase.rest.provider

Examples of org.apache.hadoop.hbase.rest.provider.JacksonProvider


    builder.append(Constants.SCAN_LIMIT + "=20");
    Response response = client.get("/" + TABLE + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider()
        .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(20, count);
    checkRowsNotNull(model);
View Full Code Here


    builder.append(Constants.SCAN_LIMIT + "=20");
    Response response = client.get("/" + TABLE + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider()
        .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(20, count);
    checkRowsNotNull(model);
View Full Code Here

    builder.append(Constants.SCAN_COLUMN + "=a:test");
    Response response = client.get("/" + TABLE  + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider().locateMapper(CellSetModel.class,
      MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(0, count);
  }
View Full Code Here

    path.append(ROW_2);

    client.post(row_5_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_1));
    Response response = client.get(path.toString(), Constants.MIMETYPE_JSON);
    assertEquals(response.getCode(), 200);
    ObjectMapper mapper = new JacksonProvider().locateMapper(CellSetModel.class,
      MediaType.APPLICATION_JSON_TYPE);
    CellSetModel cellSet = (CellSetModel) mapper.readValue(response.getBody(), CellSetModel.class);
    assertEquals(1, cellSet.getRows().size());
    assertEquals(ROW_1, Bytes.toString(cellSet.getRows().get(0).getKey()));
    assertEquals(VALUE_1, Bytes.toString(cellSet.getRows().get(0).getCells().get(0).getValue()));
View Full Code Here

        CellModel.class,
        CellSetModel.class,
        RowModel.class);
    xmlMarshaller = context.createMarshaller();
    xmlUnmarshaller = context.createUnmarshaller();
    jsonMapper = new JacksonProvider()
    .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    client = new Client(new Cluster().add("localhost",
      REST_TEST_UTIL.getServletPort()));
  }
View Full Code Here

  protected static void checkValueJSON(String table, String row, String column,
      String value) throws IOException, JAXBException {
    Response response = getValueJson(table, row, column);
    assertEquals(response.getCode(), 200);
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider()
    .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    CellSetModel cellSet = mapper.readValue(response.getBody(), CellSetModel.class);
    RowModel rowModel = cellSet.getRows().get(0);
    CellModel cell = rowModel.getCells().get(0);
    assertEquals(Bytes.toString(cell.getColumn()), column);
View Full Code Here

    builder.append(Constants.SCAN_LIMIT + "=20");
    Response response = client.get("/" + TABLE + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider()
        .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(20, count);
    checkRowsNotNull(model);
View Full Code Here

    builder.append(Constants.SCAN_LIMIT + "=20");
    Response response = client.get("/" + TABLE + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider()
        .locateMapper(CellSetModel.class, MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(20, count);
    checkRowsNotNull(model);
View Full Code Here

    builder.append(Constants.SCAN_COLUMN + "=a:test");
    Response response = client.get("/" + TABLE  + builder.toString(),
      Constants.MIMETYPE_JSON);
    assertEquals(200, response.getCode());
    assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type"));
    ObjectMapper mapper = new JacksonProvider().locateMapper(CellSetModel.class,
      MediaType.APPLICATION_JSON_TYPE);
    CellSetModel model = mapper.readValue(response.getStream(), CellSetModel.class);
    int count = TestScannerResource.countCellSet(model);
    assertEquals(0, count);
  }
View Full Code Here

    path.append(ROW_2);

    client.post(row_5_url, Constants.MIMETYPE_BINARY, Bytes.toBytes(VALUE_1));
    Response response = client.get(path.toString(), Constants.MIMETYPE_JSON);
    assertEquals(response.getCode(), 200);
    ObjectMapper mapper = new JacksonProvider().locateMapper(CellSetModel.class,
      MediaType.APPLICATION_JSON_TYPE);
    CellSetModel cellSet = (CellSetModel) mapper.readValue(response.getBody(), CellSetModel.class);
    assertEquals(1, cellSet.getRows().size());
    assertEquals(ROW_1, Bytes.toString(cellSet.getRows().get(0).getKey()));
    assertEquals(VALUE_1, Bytes.toString(cellSet.getRows().get(0).getCells().get(0).getValue()));
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.rest.provider.JacksonProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.