New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid assertion on call to CacheManager.getCacheNames() when CacheManager isClosed. #87

Closed
jfialli opened this Issue Feb 3, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@jfialli
Contributor

jfialli commented Feb 3, 2016

TCK Challenge:

Call to CacheManager.getCacheNames() on a closed CacheManager should
assert IllegalStateException is thrown. Invalid test is asserting that the methods
returns an empty iterator.

Per page 39 of the specification and the javadoc for CacheManager.getCacheNames(), after a CacheManager has been closed, any operational method will throw an IllegalStateException.
The operational methods on CacheManager are: createCache, destroyCache, enableManagement, enableStatistics, getCache and getCacheNames.

Proposed resolution:

Add @test(expected = IllegalStateException.class) to CacheManagerTest.close_cachesEmpty()
and change the following line in the method

From:
assertFalse(cacheManager.getCacheNames().iterator().hasNext());
To:
cacheManager.getCacheNames();

@cruftex

This comment has been minimized.

Member

cruftex commented Mar 9, 2016

+1, existing implementations need to change their behavior

Will prep a PR.

cruftex added a commit to cruftex/jsr107tck that referenced this issue Mar 10, 2016

change semantic, CacheManager.getCacheNames() yields IllegalStateExce…
…ption if closed.

Fixes TCK challenge: jsr107#87
Fixes consequent change: jsr107/RI#48

cruftex added a commit to cruftex/RI that referenced this issue Mar 10, 2016

change semantic, CacheManager.getCacheNames() yields IllegalStateExce…
…ption if closed.

Fixes TCK challenge: jsr107/jsr107tck#87
Fixes consequent change: jsr107#48

christian-esken added a commit to trivago/jsr107tck that referenced this issue Apr 28, 2016

change semantic, Check IllegalStateException when calling getCacheNam…
…es() on a closed cache

Fixes TCK challenge: jsr107#87
Fixes consequent change: jsr107/RI#48

christian-esken added a commit to trivago/jsr107tck that referenced this issue Apr 28, 2016

change semantic, CacheManager.getCacheNames() yields IllegalStateExce…
…ption if closed.

Fixes TCK challenge: jsr107#87
Fixes consequent change: jsr107/RI#48

@gregrluck gregrluck self-assigned this May 15, 2016

@gregrluck gregrluck added this to the 1.1.0 milestone May 15, 2016

@gregrluck

This comment has been minimized.

Member

gregrluck commented May 15, 2016

Fixed. Also had to fix a failing test in CacheManagerManagementTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment