use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method testIterFilterLimitOffset.
public void testIterFilterLimitOffset() {
SienaFuture<Iterable<PersonUUID>> future = pm.createQuery(PersonUUID.class).filter("n>", 1).order("n").iter(2, 1);
Iterable<PersonUUID> people = future.get();
assertNotNull(people);
PersonUUID[] array = new PersonUUID[] { 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 BaseAsyncTest method testInsertUUID.
public void testInsertUUID() {
PersonUUID maxwell = new PersonUUID();
maxwell.firstName = "James Clerk";
maxwell.lastName = "Maxwell";
maxwell.city = "Edinburgh";
maxwell.n = 4;
pm.insert(maxwell).get();
assertNotNull(maxwell.id);
SienaFuture<List<PersonUUID>> future = queryPersonUUIDOrderBy("n", 0, false).fetch();
List<PersonUUID> people = future.get();
assertEquals(4, people.size());
assertEquals(UUID_TESLA, people.get(0));
assertEquals(UUID_CURIE, people.get(1));
assertEquals(UUID_EINSTEIN, people.get(2));
assertEquals(maxwell, people.get(3));
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseAsyncTest method testDeleteObjectNotFound.
public void testDeleteObjectNotFound() {
try {
PersonUUID p = new PersonUUID();
pm.delete(p);
fail();
} catch (Exception e) {
System.out.println("Everything is OK");
}
}
use of siena.base.test.model.PersonUUID in project siena by mandubian.
the class BaseTest method testIterFilterLimit.
public void testIterFilterLimit() {
Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).filter("n>", 1).order("n").iter(1);
assertNotNull(people);
PersonUUID[] array = new PersonUUID[] { UUID_CURIE };
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 testFilterOperatorEqualInt.
public void testFilterOperatorEqualInt() {
PersonUUID person = pm.createQuery(PersonUUID.class).filter("n", 3).get();
assertNotNull(person);
assertEquals(UUID_EINSTEIN, person);
}
Aggregations