Search in sources :

Example 81 with ByteIterator

use of com.yahoo.ycsb.ByteIterator 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);
}
Also used : Status(com.yahoo.ycsb.Status) StringByteIterator(com.yahoo.ycsb.StringByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) HashMap(java.util.HashMap) StringByteIterator(com.yahoo.ycsb.StringByteIterator) Test(org.junit.Test)

Example 82 with ByteIterator

use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.

the class RestClientTest method insert_200.

// Insert success.
@Test
public void insert_200() {
    HashMap<String, ByteIterator> data = new HashMap<String, ByteIterator>();
    data.put(DATA_TAG, new StringByteIterator(INPUT_DATA));
    Status status = rc.insert(null, VALID_RESOURCE, data);
    assertEquals(Status.OK, status);
}
Also used : Status(com.yahoo.ycsb.Status) StringByteIterator(com.yahoo.ycsb.StringByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) HashMap(java.util.HashMap) StringByteIterator(com.yahoo.ycsb.StringByteIterator) Test(org.junit.Test)

Example 83 with ByteIterator

use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.

the class RestClientTest method update_200.

@Test
public void update_200() {
    HashMap<String, ByteIterator> data = new HashMap<String, ByteIterator>();
    data.put(DATA_TAG, new StringByteIterator(INPUT_DATA));
    Status status = rc.update(null, VALID_RESOURCE, data);
    assertEquals(Status.OK, status);
}
Also used : Status(com.yahoo.ycsb.Status) StringByteIterator(com.yahoo.ycsb.StringByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) HashMap(java.util.HashMap) StringByteIterator(com.yahoo.ycsb.StringByteIterator) Test(org.junit.Test)

Example 84 with ByteIterator

use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.

the class RestClientTest method read_500.

// Server error.
@Test
public void read_500() {
    HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
    Status status = rc.read(null, INVALID_RESOURCE, null, result);
    assertEquals(Status.ERROR, status);
}
Also used : Status(com.yahoo.ycsb.Status) StringByteIterator(com.yahoo.ycsb.StringByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 85 with ByteIterator

use of com.yahoo.ycsb.ByteIterator in project YCSB by brianfrankcooper.

the class RestClientTest method read_403.

// Unauthorized request error.
@Test
public void read_403() {
    HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
    Status status = rc.read(null, UNAUTHORIZED_RESOURCE, null, result);
    assertEquals(Status.FORBIDDEN, status);
}
Also used : Status(com.yahoo.ycsb.Status) StringByteIterator(com.yahoo.ycsb.StringByteIterator) ByteIterator(com.yahoo.ycsb.ByteIterator) HashMap(java.util.HashMap) Test(org.junit.Test)

Aggregations

ByteIterator (com.yahoo.ycsb.ByteIterator)87 HashMap (java.util.HashMap)70 StringByteIterator (com.yahoo.ycsb.StringByteIterator)52 Status (com.yahoo.ycsb.Status)33 ByteArrayByteIterator (com.yahoo.ycsb.ByteArrayByteIterator)30 Test (org.junit.Test)30 DBException (com.yahoo.ycsb.DBException)20 Map (java.util.Map)14 IOException (java.io.IOException)8 EntityProperty (com.microsoft.azure.storage.table.EntityProperty)5 Vector (java.util.Vector)5 BaseDocument (com.arangodb.entity.BaseDocument)4 DynamicTableEntity (com.microsoft.azure.storage.table.DynamicTableEntity)4 DB (com.yahoo.ycsb.DB)4 ByteBuffer (java.nio.ByteBuffer)4 ArrayList (java.util.ArrayList)4 Put (org.apache.hadoop.hbase.client.Put)4 MongoCollection (com.allanbank.mongodb.MongoCollection)3 DocumentBuilder (com.allanbank.mongodb.bson.builder.DocumentBuilder)3 ArangoDBException (com.arangodb.ArangoDBException)3