use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.
the class OrientDBClientTest method insertTest.
@Test
public void insertTest() {
String insertKey = "user0";
Map<String, ByteIterator> insertMap = insertRow(insertKey);
OPartitionedDatabasePool pool = orientDBClient.getDatabasePool();
try (ODatabaseDocumentTx db = pool.acquire()) {
ODictionary<ORecord> dictionary = db.getDictionary();
ODocument result = dictionary.get(insertKey);
assertTrue("Assert a row was inserted.", result != null);
for (int i = 0; i < NUM_FIELDS; i++) {
assertEquals("Assert all inserted columns have correct values.", result.field(FIELD_PREFIX + i), insertMap.get(FIELD_PREFIX + i).toString());
}
}
}
use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.
the class RadosClientTest method compareMap.
private void compareMap(HashMap<String, ByteIterator> src, HashMap<String, ByteIterator> dest) {
assertEquals(src.size(), dest.size());
Set setSrc = src.entrySet();
Iterator<Map.Entry> itSrc = setSrc.iterator();
for (int i = 0; i < 10; i++) {
Map.Entry<String, ByteIterator> entrySrc = itSrc.next();
assertEquals(entrySrc.getValue().toString(), dest.get(entrySrc.getKey()).toString());
}
}
use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.
the class RadosClientTest method updateTest.
@Test
public void updateTest() {
radosclient.insert(TABLE_NAME, KEY2, DATA);
Status result = radosclient.update(TABLE_NAME, KEY2, DATA_UPDATED);
assertEquals(Status.OK, result);
HashMap<String, ByteIterator> ret = new HashMap<String, ByteIterator>(10);
radosclient.read(TABLE_NAME, KEY2, DATA.keySet(), ret);
compareMap(DATA_UPDATED, ret);
radosclient.delete(TABLE_NAME, KEY2);
}
use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.
the class RestClientTest method read_200.
// Read success.
@Test
public void read_200() {
HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
Status status = rc.read(null, VALID_RESOURCE, null, result);
assertEquals(Status.OK, status);
assertEquals(result.get(RESPONSE_TAG).toString(), "HTTP GET response to: " + VALID_RESOURCE);
}
use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.
the class RestClientTest method read_404.
//Not found error.
@Test
public void read_404() {
HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
Status status = rc.read(null, ABSENT_RESOURCE, null, result);
assertEquals(Status.NOT_FOUND, status);
}
Aggregations