Skip to content

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

@jfialli

Description

@jfialli

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();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions