Bug 745843 (EDG-73)

Summary: org.infinispan.client.hotrod.RemoteCache methods size(), isEmpty() and containsValue() return UnsupportedOperationExeception
Product: [JBoss] JBoss Data Grid 5 Reporter: Richard Achmatowicz <rachmato>
Component: InfinispanAssignee: Default User <jbpapp-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: galder.zamarreno, rachmato
Target Milestone: ---   
Target Release: EAP 5.1.0 EDG TP   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/EDG-73
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-27 10:28:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Richard Achmatowicz 2011-01-13 15:55:37 UTC
Complexity: Low
project_key: EDG

The test case org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase shows these test failures:

  <testcase classname="org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase" name="testSize" time="0.0060">
    <error type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException
	at org.infinispan.client.hotrod.impl.RemoteCacheSupport.size(RemoteCacheSupport.java:71)
	at org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase.testSize(HotRodClientRemoteCacheTestCase.java:283)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
</error>
  </testcase>
  <testcase classname="org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase" name="testIsEmpty" time="0.0050">
    <error type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException
	at org.infinispan.client.hotrod.impl.RemoteCacheSupport.isEmpty(RemoteCacheSupport.java:76)
	at org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase.testIsEmpty(HotRodClientRemoteCacheTestCase.java:307)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
</error>
  </testcase>
  <testcase classname="org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase" name="testContains" time="0.0080">
    <error type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException
	at org.infinispan.client.hotrod.impl.RemoteCacheSupport.containsValue(RemoteCacheSupport.java:81)
	at org.jboss.test.cluster.datagrid.test.HotRodClientRemoteCacheTestCase.testContains(HotRodClientRemoteCacheTestCase.java:327)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
</error>
 
These tests perform simple examples of the operation on a default cache instance.

Comment 1 Richard Achmatowicz 2011-01-13 15:58:58 UTC
The version of the test which exhibits the failures have just been committed to https://svn.jboss.org/repos/jbossas/branches/JBPAPP_5_1_datagrid
I'll kick off a Hudson run of the revised testsuite immediately.


Comment 2 Galder Zamarreño 2011-01-27 09:09:37 UTC
containsValue() is not supported in embedded Infinispan and we have no intention of supporting it in the time being.

size() and isEmpty() can easily be implemented by checking the stats returned, I'm creating a JIRA for this - it's pretty straightforward.

Comment 3 Galder Zamarreño 2011-01-27 09:12:06 UTC
Link: Added: This issue depends ISPN-900


Comment 4 Richard Achmatowicz 2011-03-22 19:41:39 UTC
I've set up a test to catch an Unsupported from containsValue().

size() and isEmpty() are still throwing them - any progress with the JIRA?



Comment 5 Galder Zamarreño 2011-03-28 10:08:10 UTC
Richard, the JIRA is fixed. Here's the code:
https://github.com/infinispan/infinispan/blob/4.2.1.CR2/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/RemoteCacheImpl.java

Richard, remember to update the Hot Rod client version in the testsuite. From what I remember there's a separate file somewhere that needs updating when you want to use a different Hot Rod client version.