Search in sources :

Example 16 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script35.

@Test
public void script35() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(containsName(person.accounts(), "anns")));
    System.out.println("*** script35: " + query);
    verifyUnorderedResults(query, "Jack Doe", "Ann Doe");
}
Also used : Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 17 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractEntityFinderTest method script06.

@Test
public void script06() throws EntityFinderException {
    Person person = templateFor(Person.class);
    // should return Joe and Ann Doe
    Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, ge(person.yearOfBirth(), 1973), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
    assertNames(entities, JOE, ANN);
}
Also used : EntityReference(org.qi4j.api.entity.EntityReference) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 18 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractEntityFinderTest method script04.

@Test
public void script04() throws EntityFinderException {
    Person person = templateFor(Person.class);
    // should return Joe and Ann Doe
    Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, eq(person.placeOfBirth().get().name(), "Kuala Lumpur"), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
    assertNames(entities, JOE, ANN);
}
Also used : EntityReference(org.qi4j.api.entity.EntityReference) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 19 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractEntityFinderTest method script11.

@Test
public void script11() throws EntityFinderException {
    Person person = templateFor(Person.class);
    // should return Joe Doe
    Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, isNotNull(person.email()), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
    assertNames(entities, JOE);
}
Also used : EntityReference(org.qi4j.api.entity.EntityReference) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 20 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractEntityFinderTest method script05.

@Test
public void script05() throws EntityFinderException {
    Person person = templateFor(Person.class);
    // should return Joe Doe
    Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, eq(person.mother().get().placeOfBirth().get().name(), "Kuala Lumpur"), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
    assertNames(entities, JOE);
}
Also used : EntityReference(org.qi4j.api.entity.EntityReference) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)76 Person (org.qi4j.test.indexing.model.Person)76 LocalDateTime (org.joda.time.LocalDateTime)12 EntityReference (org.qi4j.api.entity.EntityReference)11 QueryParam (org.qi4j.test.indexing.model.QueryParam)10 DateTime (org.joda.time.DateTime)8 ArrayList (java.util.ArrayList)7 Collection (java.util.Collection)7 LocalDate (org.joda.time.LocalDate)4 BigDecimal (java.math.BigDecimal)3 BigInteger (java.math.BigInteger)3 Ignore (org.junit.Ignore)3 Address (org.qi4j.test.indexing.model.Address)2 City (org.qi4j.test.indexing.model.City)2 Domain (org.qi4j.test.indexing.model.Domain)2 Female (org.qi4j.test.indexing.model.Female)2 Male (org.qi4j.test.indexing.model.Male)2 Protocol (org.qi4j.test.indexing.model.Protocol)2 URL (org.qi4j.test.indexing.model.URL)2 HashMap (java.util.HashMap)1