Search in sources :

Example 26 with PersonUUID

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

the class BaseTest method testIterFullUUID.

public void testIterFullUUID() {
    Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).order("n").iter();
    assertNotNull(people);
    @SuppressWarnings("serial") ArrayList<PersonUUID> l = new ArrayList<PersonUUID>() {

        {
            add(UUID_TESLA);
            add(UUID_CURIE);
            add(UUID_EINSTEIN);
        }
    };
    int i = 0;
    for (PersonUUID person : people) {
        PersonUUID p = l.get(i);
        assertEquals(p, person);
        i++;
    }
}
Also used : PersonUUID(siena.base.test.model.PersonUUID) ArrayList(java.util.ArrayList)

Example 27 with PersonUUID

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

the class BaseTestNoAutoInc_2_FETCH method testFilterOperatorEqualUUID.

public void testFilterOperatorEqualUUID() {
    List<PersonUUID> l = getOrderedPersonUUIDs();
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("id", l.get(0).id).get();
    assertNotNull(person);
    assertEquals(l.get(0), person);
}
Also used : PersonUUID(siena.base.test.model.PersonUUID)

Example 28 with PersonUUID

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

the class BaseTestNoAutoInc_3_ITER method testIterFullUUID.

public void testIterFullUUID() {
    Iterable<PersonUUID> people = pm.createQuery(PersonUUID.class).order("n").iter();
    assertNotNull(people);
    @SuppressWarnings("serial") ArrayList<PersonUUID> l = new ArrayList<PersonUUID>() {

        {
            add(UUID_TESLA);
            add(UUID_CURIE);
            add(UUID_EINSTEIN);
        }
    };
    int i = 0;
    for (PersonUUID person : people) {
        PersonUUID p = l.get(i);
        assertEquals(p, person);
        i++;
    }
}
Also used : PersonUUID(siena.base.test.model.PersonUUID) ArrayList(java.util.ArrayList)

Example 29 with PersonUUID

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

the class BaseTestNoAutoInc_3_ITER 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 30 with PersonUUID

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

the class BaseTestNoAutoInc_DEFAULT method testFilterOperatorEqualInt.

public void testFilterOperatorEqualInt() {
    PersonUUID person = pm.createQuery(PersonUUID.class).filter("n", 3).get();
    assertNotNull(person);
    assertEquals(UUID_EINSTEIN, person);
}
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