use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.
the class BaseTestNoAutoInc_DEFAULT method testOrderLongAutoId.
public void testOrderLongAutoId() {
List<PersonLongAutoID> people = queryPersonLongAutoIDOrderBy("id", "", false).fetch();
assertNotNull(people);
assertEquals(3, people.size());
PersonLongAutoID[] array = new PersonLongAutoID[] { LongAutoID_TESLA, LongAutoID_CURIE, LongAutoID_EINSTEIN };
int i = 0;
for (PersonLongAutoID person : people) {
assertEquals(array[i], person);
i++;
}
}
use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.
the class BaseTest method getPersonLongAutoID.
private PersonLongAutoID getPersonLongAutoID(Long id) {
PersonLongAutoID p = new PersonLongAutoID();
p.id = id;
pm.get(p);
return p;
}
use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.
the class BaseTest method testRestoreQueryOption.
public void testRestoreQueryOption() {
QueryOption optRestored = (QueryOption) JsonSerializer.deserialize(QueryOption.class, Json.loads("{\"type\":\"" + QueryOptionPage.class.getName() + "\", \"value\": {\"pageType\": \"TEMPORARY\", \"state\": \"PASSIVE\", \"pageSize\": 0, \"type\": 1} }"));
Query<PersonLongAutoID> query = pm.createQuery(PersonLongAutoID.class);
QueryOption opt = query.option(QueryOptionPage.ID);
assertEquals(opt, optRestored);
}
use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.
the class BaseTest method testGetLongAutoID.
public void testGetLongAutoID() {
PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
assertEquals(LongAutoID_CURIE, curie);
}
use of siena.base.test.model.PersonLongAutoID in project siena by mandubian.
the class BaseTest method testDumpQueryOption.
public void testDumpQueryOption() {
Query<PersonLongAutoID> query = pm.createQuery(PersonLongAutoID.class);
QueryOption opt = query.option(QueryOptionPage.ID);
Json dump = opt.dump();
String str = JsonSerializer.serialize(dump).toString();
assertNotNull(str);
assertEquals("{\"value\": {\"pageType\": \"TEMPORARY\", \"state\": \"PASSIVE\", \"pageSize\": 0, \"type\": 1}, \"type\": \"" + QueryOptionPage.class.getName() + "\"}", str);
}
Aggregations