use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.
the class StoreTest method testBrowseRecordAfterRemove.
@Test
public void testBrowseRecordAfterRemove() {
Multimap<String, TObject> data = Variables.register("data", HashMultimap.<String, TObject>create());
long record = TestData.getLong();
for (String key : getKeys()) {
for (int i = 0; i < TestData.getScaleCount() % 4; i++) {
TObject value = TestData.getTObject();
if (!data.containsEntry(key, value)) {
data.put(key, value);
add(key, value, record);
}
}
}
Iterator<Entry<String, TObject>> it = data.entries().iterator();
while (it.hasNext()) {
Entry<String, TObject> entry = it.next();
if (TestData.getScaleCount() % 3 == 0) {
it.remove();
remove(entry.getKey(), entry.getValue(), record);
}
}
Assert.assertEquals(data.asMap(), store.select(record));
}
use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.
the class StoreTest method testDescribeAfterAddAndRemoveSingle.
@Test
public void testDescribeAfterAddAndRemoveSingle() {
String key = TestData.getSimpleString();
TObject value = TestData.getTObject();
long record = TestData.getLong();
add(key, value, record);
remove(key, value, record);
Assert.assertFalse(store.describe(record).contains(key));
}
use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.
the class StoreTest method testBrowseKeyAfterRemove.
@Test
public void testBrowseKeyAfterRemove() {
Multimap<TObject, Long> data = Variables.register("data", TreeMultimap.<TObject, Long>create());
String key = TestData.getSimpleString();
for (TObject value : getValues()) {
for (int i = 0; i < TestData.getScaleCount() % 4; i++) {
long record = TestData.getLong();
if (!data.containsEntry(value, record)) {
data.put(value, record);
add(key, value, record);
}
}
}
Iterator<Entry<TObject, Long>> it = data.entries().iterator();
while (it.hasNext()) {
Entry<TObject, Long> entry = it.next();
if (TestData.getScaleCount() % 3 == 0) {
it.remove();
remove(key, entry.getKey(), entry.getValue());
}
}
Assert.assertEquals(data.asMap(), store.browse(key));
}
use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.
the class StoreTest method testFetchAfterAddSingleWithTime.
@Test
public void testFetchAfterAddSingleWithTime() {
String key = TestData.getSimpleString();
TObject value = TestData.getTObject();
long record = TestData.getLong();
long timestamp = Time.now();
add(key, value, record);
Assert.assertFalse(store.select(key, record, timestamp).contains(value));
}
use of com.cinchapi.concourse.thrift.TObject in project concourse by cinchapi.
the class StoreTest method testFetchAfterAddSingle.
@Test
public void testFetchAfterAddSingle() {
String key = TestData.getSimpleString();
TObject value = TestData.getTObject();
long record = TestData.getLong();
add(key, value, record);
Assert.assertTrue(store.select(key, record).contains(value));
}
Aggregations