use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class GaeTest method testFilterWithOperatorNotEqualStateful.
public void testFilterWithOperatorNotEqualStateful() {
List<PersonUUID> l = getOrderedPersonUUIDs();
Query<PersonUUID> query = pm.createQuery(PersonUUID.class).filter("id!=", l.get(0).id).order("id").stateful().paginate(1);
List<PersonUUID> people = query.fetch();
QueryOptionGaeContext gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(1), people.get(0));
people = query.nextPage().fetch();
gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(2), people.get(0));
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class GaeTest method testFilterWithOperatorINStateful.
public void testFilterWithOperatorINStateful() {
List<PersonUUID> l = getOrderedPersonUUIDs();
Query<PersonUUID> query = pm.createQuery(PersonUUID.class).filter("id IN", Arrays.asList(l.get(0).id, l.get(1).id)).stateful().paginate(1);
List<PersonUUID> people = query.fetch();
QueryOptionGaeContext gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(0), people.get(0));
people = query.nextPage().fetch();
gaeCtx = (QueryOptionGaeContext) query.option(QueryOptionGaeContext.ID);
assertFalse(gaeCtx.useCursor);
assertNotNull(people);
assertEquals(1, people.size());
assertEquals(l.get(1), people.get(0));
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseTestNoAutoInc_DEFAULT method testIterFilter.
public void testIterFilter() {
Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).filter("n>", 1).order("n").iter();
assertNotNull(people);
PersonUUID[] array = new PersonUUID[] { UUID_CURIE, UUID_EINSTEIN };
int i = 0;
for (PersonUUID PersonIntKey : people) {
assertEquals(array[i], PersonIntKey);
i++;
}
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseTest method testIterFilter.
public void testIterFilter() {
Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).filter("n>", 1).order("n").iter();
assertNotNull(people);
PersonUUID[] array = new PersonUUID[] { UUID_CURIE, UUID_EINSTEIN };
int i = 0;
for (PersonUUID PersonIntKey : people) {
assertEquals(array[i], PersonIntKey);
i++;
}
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseTest method testGetByKeyUUID.
public void testGetByKeyUUID() {
PersonUUID curie = getByKeyPersonUUID(UUID_CURIE.id);
assertEquals(UUID_CURIE, curie);
}
Aggregations