@Ignore @Test public void testAddItemListenerIncludeValue() throws Exception { Boolean includeValue = true; HazelcastClient client = mock(HazelcastClient.class); ListenerManager listenerManager = mock(ListenerManager.class); ItemListenerManager itemListenerManager = mock(ItemListenerManager.class); when(listenerManager.getItemListenerManager()).thenReturn(itemListenerManager); when(client.getListenerManager()).thenReturn(listenerManager); when(client.getOutRunnable()).thenReturn(new OutRunnable(client, new HashMap(), new PacketWriter())); String name = "def"; ProxyHelper proxyHelper = mock(ProxyHelper.class); when(proxyHelper.getHazelcastClient()).thenReturn(client); Packet request = new Packet(); request.setName(name); request.setOperation(ClusterOperation.ADD_LISTENER); when(proxyHelper.createCall(request)).thenReturn(new Call(1L, request)); when(proxyHelper.createRequestPacket(ClusterOperation.ADD_LISTENER, null, null)).thenReturn(request); CollectionClientProxy proxy = new SetClientProxy(proxyHelper, name); ItemListener listener = new ItemListener() { public void itemAdded(ItemEvent itemEvent) { } public void itemRemoved(ItemEvent itemEvent) { } }; proxy.addItemListener(listener, includeValue); verify(itemListenerManager).registerListener(name, listener, includeValue); verify(proxyHelper).doCall(argThat(new CallMatcher())); }
public synchronized void addItemListener(ItemListener<E> listener, boolean includeValue) { check(listener); Call c = itemListenerManager().createNewAddListenerCall(proxyHelper, includeValue); itemListenerManager().registerListener(name, listener, includeValue); proxyHelper.doCall(c); }
CollectionClientProxy extends AbstractCollection<E> { public synchronized void addItemListener(ItemListener<E> listener, boolean includeValue) { check(listener); Call c = itemListenerManager().createNewAddListenerCall(proxyHelper, includeValue); itemListenerManager().registerListener(name, listener, includeValue); proxyHelper.doCall(c); } }
CollectionClientProxy extends AbstractCollection<E> { public synchronized void addItemListener(ItemListener<E> listener, boolean includeValue) { check(listener); Call c = itemListenerManager().createNewAddListenerCall(proxyHelper, includeValue); itemListenerManager().registerListener(name, listener, includeValue); proxyHelper.doCall(c); } CollectionClientProxy(HazelcastClient hazelcastClient, String name);  CollectionClientProxy(ProxyHelper proxyHelper, String name); }
CollectionClientProxy extends AbstractCollection<E> { public synchronized void addItemListener(ItemListener<E> listener, boolean includeValue) { check(listener); Call c = itemListenerManager().createNewAddListenerCall(proxyHelper, includeValue); itemListenerManager().registerListener(name, listener, includeValue); proxyHelper.doCall(c); } CollectionClientProxy(HazelcastClient hazelcastClient, String name);  CollectionClientProxy(ProxyHelper proxyHelper, String name); void destroy(); Object getId(); @Override Iterator<E> iterator(); @Override String toString(); synchronized void addItemListener(ItemListener<E> listener, boolean includeValue); synchronized void removeItemListener(ItemListener<E> listener); @Override int size(); @Override int hashCode(); }
CollectionClientProxy extends AbstractCollection<E> { public synchronized void addItemListener(ItemListener<E> listener, boolean includeValue) { check(listener); Call c = itemListenerManager().createNewAddListenerCall(proxyHelper, includeValue); itemListenerManager().registerListener(name, listener, includeValue); proxyHelper.doCall(c); } CollectionClientProxy(HazelcastClient hazelcastClient, String name);  CollectionClientProxy(ProxyHelper proxyHelper, String name); void destroy(); Object getId(); @Override Iterator<E> iterator(); @Override String toString(); synchronized void addItemListener(ItemListener<E> listener, boolean includeValue); synchronized void removeItemListener(ItemListener<E> listener); @Override int size(); @Override int hashCode();  }