use of org.apache.ignite.springdata.misc.Person in project ignite by apache.
the class IgniteSpringDataQueriesSelfTest method testSliceOfCacheEntries.
/** */
public void testSliceOfCacheEntries() {
Slice<Cache.Entry<Integer, Person>> slice = repo2.findBySecondNameIsNot("lastName18", new PageRequest(3, 4));
assertEquals(4, slice.getSize());
for (Cache.Entry<Integer, Person> entry : slice) assertFalse("lastName18".equals(entry.getValue().getSecondName()));
}
use of org.apache.ignite.springdata.misc.Person in project ignite by apache.
the class IgniteSpringDataQueriesSelfTest method testTopPart.
/** */
public void testTopPart() {
Iterable<Person> top = repo.findTopByFirstNameContaining("person4");
Iterator<Person> iter = top.iterator();
Person person = iter.next();
assertFalse(iter.hasNext());
assertTrue(person.getFirstName().startsWith("person4"));
}
use of org.apache.ignite.springdata.misc.Person in project ignite by apache.
the class IgniteSpringDataQueriesSelfTest method beforeTestsStarted.
@Override
protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
ctx = new AnnotationConfigApplicationContext();
ctx.register(ApplicationConfiguration.class);
ctx.refresh();
repo = ctx.getBean(PersonRepository.class);
repo2 = ctx.getBean(PersonSecondRepository.class);
for (int i = 0; i < CACHE_SIZE; i++) repo.save(i, new Person("person" + Integer.toHexString(i), "lastName" + Integer.toHexString((i + 16) % 256)));
}
use of org.apache.ignite.springdata.misc.Person in project ignite by apache.
the class IgniteSpringDataQueriesSelfTest method testQueryWithSort.
/** */
public void testQueryWithSort() {
List<Person> persons = repo.queryWithSort("^[a-z]+$", new Sort(Sort.Direction.DESC, "secondName"));
Person previous = persons.get(0);
for (Person person : persons) {
assertTrue(person.getSecondName().compareTo(previous.getSecondName()) <= 0);
assertTrue(person.getFirstName().matches("^[a-z]+$"));
previous = person;
}
}
use of org.apache.ignite.springdata.misc.Person in project ignite by apache.
the class IgniteSpringDataQueriesSelfTest method testFindOneValue.
/** */
public void testFindOneValue() {
Person person = repo.findTopBySecondNameStartingWith("lastName18");
assertNotNull(person);
assertTrue(person.getSecondName().startsWith("lastName18"));
}
Aggregations