use of com.hazelcast.query.SampleObjects.Employee in project hazelcast by hazelcast.
the class QueryAdvancedTest method testOneMemberWithoutIndex.
@Test
public void testOneMemberWithoutIndex() {
HazelcastInstance instance = createHazelcastInstance(getConfig());
IMap<String, Employee> map = instance.getMap("employees");
QueryBasicTest.doFunctionalQueryTest(map);
}
use of com.hazelcast.query.SampleObjects.Employee in project hazelcast by hazelcast.
the class QueryAdvancedTest method testOneMemberSQLWithoutIndex.
@Test
public void testOneMemberSQLWithoutIndex() {
HazelcastInstance instance = createHazelcastInstance(getConfig());
IMap<String, Employee> map = instance.getMap("employees");
QueryBasicTest.doFunctionalSQLQueryTest(map);
Set<Map.Entry<String, Employee>> entries = map.entrySet(new SqlPredicate("active and age>23"));
assertEquals(27, entries.size());
}
use of com.hazelcast.query.SampleObjects.Employee in project hazelcast by hazelcast.
the class QueryAdvancedTest method testTwoMembers.
@Test
public void testTwoMembers() {
Config config = getConfig();
TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);
HazelcastInstance instance = nodeFactory.newHazelcastInstance(config);
nodeFactory.newHazelcastInstance(config);
IMap<String, Employee> map = instance.getMap("employees");
QueryBasicTest.doFunctionalQueryTest(map);
}
use of com.hazelcast.query.SampleObjects.Employee in project hazelcast by hazelcast.
the class QueryIndexingTest method assertGettersCalledNTimes.
private static void assertGettersCalledNTimes(Collection<Employee> matchingEmployees, int expectedCalls) {
for (Employee employee : matchingEmployees) {
verify(employee, times(expectedCalls)).getCity();
verify(employee, times(expectedCalls)).getName();
}
}
use of com.hazelcast.query.SampleObjects.Employee in project hazelcast by hazelcast.
the class QueryIndexingTest method newEmployees.
private static Map<Integer, Employee> newEmployees(int employeeCount) {
Map<Integer, Employee> employees = new HashMap<Integer, Employee>();
for (int i = 0; i < employeeCount; i++) {
Employee val;
if (i % 2 == 0) {
val = new Employee(i, null, null, 0, true, i);
} else {
val = new Employee(i, "name" + i, "city" + i, 0, true, i);
}
Employee spy = MockUtil.serializableSpy(Employee.class, val);
employees.put(i, spy);
}
return employees;
}
Aggregations