Search in sources :

Example 1 with PersonLongAutoID

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

the class BaseAsyncTest method testIterLimitLongAutoID.

public void testIterLimitLongAutoID() {
    SienaFuture<Iterable<PersonLongAutoID>> future = pm.createQuery(PersonLongAutoID.class).order("n").iter(2);
    Iterable<PersonLongAutoID> people = future.get();
    assertNotNull(people);
    PersonLongAutoID[] array = new PersonLongAutoID[] { LongAutoID_TESLA, LongAutoID_CURIE };
    int i = 0;
    for (PersonLongAutoID person : people) {
        assertEquals(array[i], person);
        i++;
    }
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 2 with PersonLongAutoID

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

the class BaseAsyncTest method testOrderLongAutoId.

public void testOrderLongAutoId() {
    SienaFuture<List<PersonLongAutoID>> future = queryPersonLongAutoIDOrderBy("id", "", false).fetch();
    List<PersonLongAutoID> people = future.get();
    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++;
    }
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 3 with PersonLongAutoID

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

the class BaseAsyncTest method testIterFullLongAutoID.

public void testIterFullLongAutoID() {
    SienaFuture<Iterable<PersonLongAutoID>> future = pm.createQuery(PersonLongAutoID.class).order("n").iter();
    Iterable<PersonLongAutoID> people = future.get();
    assertNotNull(people);
    PersonLongAutoID[] array = new PersonLongAutoID[] { LongAutoID_TESLA, LongAutoID_CURIE, LongAutoID_EINSTEIN };
    int i = 0;
    for (PersonLongAutoID person : people) {
        assertEquals(array[i], person);
        i++;
    }
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 4 with PersonLongAutoID

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

the class BaseAsyncTest method testIterLimitOffsetLongAutoID.

public void testIterLimitOffsetLongAutoID() {
    SienaFuture<Iterable<PersonLongAutoID>> future = pm.createQuery(PersonLongAutoID.class).order("n").iter(2, 1);
    Iterable<PersonLongAutoID> people = future.get();
    assertNotNull(people);
    PersonLongAutoID[] array = new PersonLongAutoID[] { LongAutoID_CURIE, LongAutoID_EINSTEIN };
    int i = 0;
    for (PersonLongAutoID person : people) {
        assertEquals(array[i], person);
        i++;
    }
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Example 5 with PersonLongAutoID

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

the class BaseAsyncTest method testUpdateLongAutoID.

public void testUpdateLongAutoID() {
    PersonLongAutoID curie = getPersonLongAutoID(LongAutoID_CURIE.id);
    curie.lastName = "Sklodowska–Curie";
    pm.update(curie).get();
    PersonLongAutoID curie2 = getPersonLongAutoID(LongAutoID_CURIE.id);
    assertEquals(curie2, curie);
}
Also used : PersonLongAutoID(siena.base.test.model.PersonLongAutoID)

Aggregations

PersonLongAutoID (siena.base.test.model.PersonLongAutoID)47 SienaRestrictedApiException (siena.SienaRestrictedApiException)11 ArrayList (java.util.ArrayList)3 List (java.util.List)3 QueryFilter (siena.QueryFilter)2 QueryOption (siena.core.options.QueryOption)2 QueryOptionPage (siena.core.options.QueryOptionPage)2 Json (siena.Json)1 QueryFilterSearch (siena.QueryFilterSearch)1 QueryFilterSimple (siena.QueryFilterSimple)1 QueryOrder (siena.QueryOrder)1