use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class RestClientTest method update_500.
@Test
public void update_500() {
HashMap<String, ByteIterator> data = new HashMap<String, ByteIterator>();
data.put(DATA_TAG, new StringByteIterator(INPUT_DATA));
Status status = rc.update(null, INVALID_RESOURCE, data);
assertEquals(Status.ERROR, status);
}
use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class RadosClientTest method insertTest.
@Test
public void insertTest() {
Status result = radosclient.insert(TABLE_NAME, KEY1, DATA);
assertEquals(Status.OK, result);
}
use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class HBaseClient1Test method testUpdate.
@Test
public void testUpdate() throws Exception {
final String key = "key";
final HashMap<String, String> input = new HashMap<String, String>();
input.put("column1", "value1");
input.put("column2", "value2");
final Status status = client.insert(tableName, key, StringByteIterator.getByteIteratorMap(input));
assertEquals(Status.OK, status);
// Verify result
final Get get = new Get(Bytes.toBytes(key));
final Result result = this.table.get(get);
assertFalse(result.isEmpty());
assertEquals(2, result.size());
for (final java.util.Map.Entry<String, String> entry : input.entrySet()) {
assertEquals(entry.getValue(), new String(result.getValue(Bytes.toBytes(COLUMN_FAMILY), Bytes.toBytes(entry.getKey()))));
}
}
use of site.ycsb.Status in project YCSB by brianfrankcooper.
the class HBaseClient1Test 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 IgniteClientTest method testDelete.
@Test
public void testDelete() throws Exception {
cluster.cache(DEFAULT_CACHE_NAME).clear();
final String key1 = "key1";
final Map<String, String> input1 = new HashMap<>();
input1.put("field0", "value1");
input1.put("field1", "value2");
final Status status1 = client.insert(DEFAULT_CACHE_NAME, key1, StringByteIterator.getByteIteratorMap(input1));
assertThat(status1, is(Status.OK));
assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1));
final String key2 = "key2";
final Map<String, String> input2 = new HashMap<>();
input2.put("field0", "value1");
input2.put("field1", "value2");
final Status status2 = client.insert(DEFAULT_CACHE_NAME, key2, StringByteIterator.getByteIteratorMap(input2));
assertThat(status2, is(Status.OK));
assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(2));
final Status status3 = client.delete(DEFAULT_CACHE_NAME, key2);
assertThat(status3, is(Status.OK));
assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1));
}
Aggregations