use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class AsyncHBaseTest method testReadMissingRow.
@Test
public void testReadMissingRow() throws Exception {
final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
final Status status = client.read(tableName, "Missing row", null, result);
assertEquals(Status.NOT_FOUND, status);
assertEquals(0, result.size());
}
use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class CassandraCQLClientTest method testDelete.
@Test
public void testDelete() throws Exception {
insertRow();
final Status status = client.delete(TABLE, DEFAULT_ROW_KEY);
assertThat(status, is(Status.OK));
// Verify result
final Select selectStmt = QueryBuilder.select("field0", "field1").from(TABLE).where(QueryBuilder.eq(CassandraCQLClient.YCSB_KEY, DEFAULT_ROW_KEY)).limit(1);
final ResultSet rs = session.execute(selectStmt);
final Row row = rs.one();
assertThat(row, nullValue());
}
use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class CassandraCQLClientTest method testReadSingleColumn.
@Test
public void testReadSingleColumn() throws Exception {
insertRow();
final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
final Set<String> fields = Sets.newHashSet("field1");
final Status status = client.read(TABLE, DEFAULT_ROW_KEY, fields, result);
assertThat(status, is(Status.OK));
assertThat(result.entrySet(), hasSize(1));
final Map<String, String> strResult = StringByteIterator.getStringMap(result);
assertThat(strResult, hasEntry("field1", "value2"));
}
use of site.ycsb.Status in project gora by apache.
the class GoraClientTest method testInsert.
/**
* files are auto-generated. I have the code to add the license file
* accordingly Test insert.
*
* @throws GoraException
* the gora exception
*/
@Test
public void testInsert() throws GoraException {
Status result1 = benchmarkClient.insert(Constants.TEST_TABLE, Constants.TEST_KEY_1, DATA_TO_INSERT);
Status result2 = benchmarkClient.insert(Constants.TEST_TABLE, Constants.TEST_KEY_2, DATA_TO_INSERT);
Status result3 = benchmarkClient.insert(Constants.TEST_TABLE, Constants.TEST_KEY_3, DATA_TO_INSERT);
assertEquals(Status.OK, result1);
assertEquals(Status.OK, result2);
assertEquals(Status.OK, result3);
}
use of site.ycsb.Status in project gora by apache.
the class GoraClientTest method testCorrectness.
@Test
public void testCorrectness() {
Status result = benchmarkClient.insert(Constants.TEST_TABLE, Constants.TEST_KEY_4, INTEGER_DATA);
assertEquals(result, Status.OK);
try {
User user = readRecord(Constants.TEST_KEY_4);
assertEquals(190, sum(user));
} catch (GoraException e) {
LOG.info("There is a problem reading record from the datastore", e.getMessage(), e);
}
}
Aggregations