Search in sources :

Example 41 with PersonUUID

use of siena.base.test.model.PersonUUID in project siena by mandubian.

the class BaseTest method testGetUUID.

public void testGetUUID() {
    PersonUUID curie = getPersonUUID(UUID_CURIE.id);
    assertEquals(UUID_CURIE, curie);
}
Also used : PersonUUID(siena.base.test.model.PersonUUID)

Example 42 with PersonUUID

use of siena.base.test.model.PersonUUID in project siena by mandubian.

the class BaseTest method testFilterOperatorEqualString.

public void testFilterOperatorEqualString() {
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("firstName", "Albert").get();
    assertNotNull(person);
    assertEquals(UUID_EINSTEIN, person);
}
Also used : PersonUUID(siena.base.test.model.PersonUUID)

Example 43 with PersonUUID

use of siena.base.test.model.PersonUUID in project siena by mandubian.

the class BaseTest method testIterLimitOffsetUUID.

public void testIterLimitOffsetUUID() {
    Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).order("n").iter(2, 1);
    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++;
    }
}
Also used : PersonUUID(siena.base.test.model.PersonUUID) ArrayList(java.util.ArrayList)

Example 44 with PersonUUID

use of siena.base.test.model.PersonUUID in project siena by mandubian.

the class BaseTest method testIterFilterLimitOffset.

public void testIterFilterLimitOffset() {
    Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).filter("n>", 1).order("n").iter(2, 1);
    assertNotNull(people);
    PersonUUID[] array = new PersonUUID[] { UUID_EINSTEIN };
    int i = 0;
    for (PersonUUID PersonIntKey : people) {
        assertEquals(array[i], PersonIntKey);
        i++;
    }
}
Also used : PersonUUID(siena.base.test.model.PersonUUID)

Example 45 with PersonUUID

use of siena.base.test.model.PersonUUID in project siena by mandubian.

the class BaseTest method testDeleteUUID.

public void testDeleteUUID() {
    PersonUUID curie = getPersonUUID(UUID_CURIE.id);
    pm.delete(curie);
    List<PersonUUID> people = queryPersonUUIDOrderBy("n", 0, false).fetch();
    assertNotNull(people);
    assertEquals(2, people.size());
    assertEquals(UUID_TESLA, people.get(0));
    assertEquals(UUID_EINSTEIN, people.get(1));
}
Also used : PersonUUID(siena.base.test.model.PersonUUID)

Aggregations

PersonUUID (siena.base.test.model.PersonUUID)69 ArrayList (java.util.ArrayList)15 List (java.util.List)5 QueryOptionGaeContext (siena.gae.QueryOptionGaeContext)4 SienaException (siena.SienaException)2 SienaRestrictedApiException (siena.SienaRestrictedApiException)1