protected static Response checkAndDeleteJson(String table, String row, String column, String valueToCheck) throws IOException, JAXBException { return checkAndDeleteJson(table, row, column, valueToCheck, null); }
protected static Response checkAndDeletePB(String table, String row, String column, String value) throws IOException { return checkAndDeletePB(table, row, column, value, null); }
protected static Response checkAndDeletePB(String table, String row, String column, String value, HashMap<String,String> cellsToDelete) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=delete"); return checkAndDeleteValuePB(path.toString(), table, row, column, value, cellsToDelete); } protected static Response checkAndDeleteValuePB(String url, String table,
protected static Response getValueXML(String table, String row, String column) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append('/'); path.append(column); return getValueXML(path.toString()); }
protected static Response getValueJson(String table, String row, String column) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append('/'); path.append(column); return getValueJson(path.toString()); }
protected static Response getValuePB(String table, String row, String column) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append('/'); path.append(column); return getValuePB(path.toString()); }
protected static Response incrementValueJson(String table, String row, String column, String value) throws IOException, JAXBException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=increment"); return putValueJson(path.toString(), table, row, column, value); } }
protected static Response checkAndPutValuePB(String table, String row, String column, String valueToCheck, String valueToPut) throws IOException { return checkAndPutValuePB(table,row,column,valueToCheck,valueToPut,null); } protected static Response checkAndPutValuePB(String table, String row,
protected static Response checkAndDeleteXML(String table, String row, String column, String valueToCheck) throws IOException, JAXBException { return checkAndDeleteXML(table, row, column, valueToCheck, null); } protected static Response checkAndDeleteXML(String table, String row,
protected static Response checkAndPutValueXML(String table, String row, String column, String valueToCheck, String valueToPut) throws IOException, JAXBException { return checkAndPutValueXML(table,row,column,valueToCheck,valueToPut, null); }
protected static Response getValueXML(String table, String startRow, String endRow, String column) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(startRow); path.append(","); path.append(endRow); path.append('/'); path.append(column); return getValueXML(path.toString()); }
protected static void checkValueJSON(String table, String row, String column, String value) throws IOException, JAXBException { Response response = getValueJson(table, row, column); assertEquals(200, response.getCode()); assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type")); ObjectMapper mapper = new JacksonJaxbJsonProvider() .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); assertEquals(Bytes.toString(cell.getValue()), value); }
protected static void checkValuePB(String table, String row, String column, String value) throws IOException { Response response = getValuePB(table, row, column); assertEquals(200, response.getCode()); assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type")); CellSetModel cellSet = new CellSetModel(); cellSet.getObjectFromMessage(response.getBody()); RowModel rowModel = cellSet.getRows().get(0); CellModel cell = rowModel.getCells().get(0); assertEquals(Bytes.toString(cell.getColumn()), column); assertEquals(Bytes.toString(cell.getValue()), value); }
protected static Response appendValueJson(String table, String row, String column, String value) throws IOException, JAXBException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=append"); return putValueJson(path.toString(), table, row, column, value); }
protected static Response checkAndPutValuePB(String table, String row, String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells) throws IOException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=put"); return checkAndPutValuePB(path.toString(), table, row, column, valueToCheck, valueToPut, otherCells); }
protected static Response checkAndDeleteXML(String table, String row, String column, String valueToCheck, HashMap<String,String> cellsToDelete) throws IOException, JAXBException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=delete"); return checkAndDeleteXML(path.toString(), table, row, column, valueToCheck, cellsToDelete); }
protected static Response checkAndPutValueXML(String table, String row, String column, String valueToCheck, String valueToPut, HashMap<String,String> otherCells) throws IOException, JAXBException { StringBuilder path = new StringBuilder(); path.append('/'); path.append(table); path.append('/'); path.append(row); path.append("?check=put"); return checkAndPutValueXML(path.toString(), table, row, column, valueToCheck, valueToPut, otherCells); }
protected static void checkValueXML(String url, String table, String row, String column, String value) throws IOException, JAXBException { Response response = getValueXML(url); assertEquals(200, response.getCode()); assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type")); CellSetModel cellSet = (CellSetModel) xmlUnmarshaller.unmarshal(new ByteArrayInputStream(response.getBody())); RowModel rowModel = cellSet.getRows().get(0); CellModel cell = rowModel.getCells().get(0); assertEquals(Bytes.toString(cell.getColumn()), column); assertEquals(Bytes.toString(cell.getValue()), value); }
protected static void checkIncrementValueJSON(String table, String row, String column, long value) throws IOException, JAXBException { Response response = getValueJson(table, row, column); assertEquals(200, response.getCode()); assertEquals(Constants.MIMETYPE_JSON, response.getHeader("content-type")); ObjectMapper mapper = new JacksonJaxbJsonProvider() .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); assertEquals(Bytes.toLong(cell.getValue()), value); }
protected static void checkIncrementValuePB(String table, String row, String column, long value) throws IOException { Response response = getValuePB(table, row, column); assertEquals(200, response.getCode()); assertEquals(Constants.MIMETYPE_PROTOBUF, response.getHeader("content-type")); CellSetModel cellSet = new CellSetModel(); cellSet.getObjectFromMessage(response.getBody()); RowModel rowModel = cellSet.getRows().get(0); CellModel cell = rowModel.getCells().get(0); assertEquals(Bytes.toString(cell.getColumn()), column); assertEquals(Bytes.toLong(cell.getValue()), value); }