use of com.hazelcast.nio.serialization.PortableTest.ParentPortableObject in project hazelcast by hazelcast.
the class QueryBasicTest method testQueryPortableField.
@Test(expected = QueryException.class)
public void testQueryPortableField() {
Config config = getConfig();
HazelcastInstance instance = createHazelcastInstance(config);
IMap<Object, Object> map = instance.getMap(randomMapName());
map.put(1, new GrandParentPortableObject(1, new ParentPortableObject(1L, new ChildPortableObject(1L))));
Collection<Object> values = map.values(new SqlPredicate("child > 0"));
values.size();
}
use of com.hazelcast.nio.serialization.PortableTest.ParentPortableObject in project hazelcast by hazelcast.
the class QueryBasicTest method testQueryUsingPortableObject.
private void testQueryUsingPortableObject(Config config, String mapName) {
addPortableFactories(config);
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
HazelcastInstance instance1 = factory.newHazelcastInstance(config);
HazelcastInstance instance2 = factory.newHazelcastInstance(config);
IMap<Object, Object> map = instance2.getMap(mapName);
Object key = generateKeyOwnedBy(instance1);
map.put(key, new ParentPortableObject(1L));
waitAllForSafeState(instance1, instance2);
Collection<Object> values = map.values(new SqlPredicate("timestamp > 0"));
assertEquals(1, values.size());
}
use of com.hazelcast.nio.serialization.PortableTest.ParentPortableObject in project hazelcast by hazelcast.
the class QueryBasicTest method testQueryUsingNestedPortableObject.
private void testQueryUsingNestedPortableObject(Config config, String name) {
addPortableFactories(config);
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(2);
HazelcastInstance instance1 = factory.newHazelcastInstance(config);
HazelcastInstance instance2 = factory.newHazelcastInstance(config);
IMap<String, GrandParentPortableObject> map = instance2.getMap(name);
String key = generateKeyOwnedBy(instance1);
map.put(key, new GrandParentPortableObject(1, new ParentPortableObject(1L, new ChildPortableObject(1L))));
waitAllForSafeState(instance1, instance2);
Collection<GrandParentPortableObject> values = map.values(new SqlPredicate("child.timestamp > 0"));
assertEquals(1, values.size());
values = map.values(new SqlPredicate("child.child.timestamp > 0"));
assertEquals(1, values.size());
}
Aggregations