use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method testIterLimitOffsetUUID.
public void testIterLimitOffsetUUID() {
SienaFuture<Iterable<PersonUUID>> future = pm.createQuery(PersonUUID.class).order("n").iter(2, 1);
Iterable<PersonUUID> people = future.get();
assertNotNull(people);
@SuppressWarnings("serial") ArrayList<PersonUUID> l = new ArrayList<PersonUUID>() {
{
add(UUID_CURIE);
add(UUID_EINSTEIN);
}
};
int i = 0;
for (PersonUUID person : people) {
assertEquals(l.get(i), person);
i++;
}
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method getPersonUUID.
private PersonUUID getPersonUUID(String id) {
PersonUUID p = new PersonUUID();
p.id = id;
pm.get(p).get();
return p;
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method testGetUUID.
public void testGetUUID() {
PersonUUID curie = getPersonUUID(UUID_CURIE.id);
assertEquals(UUID_CURIE, curie);
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method testGetByKeyUUID.
public void testGetByKeyUUID() {
PersonUUID curie = pm.getByKey(PersonUUID.class, UUID_CURIE.id).get();
assertEquals(UUID_CURIE, curie);
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class GaeAsyncTest method testFilterWithOperatorNotEqualStateful.
public void testFilterWithOperatorNotEqualStateful() {
List<PersonUUID> l = getOrderedPersonUUIDs();
QueryAsync<PersonUUID> query = pm.createQuery(PersonUUID.class).filter("id!=", l.get(0).id).order("id").stateful().paginate(1);
SienaFuture<List<PersonUUID>> future = query.fetch();
List<PersonUUID> people = future.get();
QueryOptionGaeContext gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(1), people.get(0));
future = query.nextPage().fetch();
people = future.get();
gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(2), people.get(0));
}
Aggregations