jsr107 / jsr107spec

JSR107 Cache Specification
Apache License 2.0
413 stars 164 forks source link

TCK calls getCacheNames() on a closed CacheManager #342

Closed christian-esken closed 8 years ago

christian-esken commented 8 years ago

The test org.jsr107.tck.CacheManagerTest.close_cachesEmpty() closes a CacheManager and then calls getCacheNames() on the closed CacheManager. This is not allowed according to the JSR107 specification:

Once closed any attempt to use an operational method on a closed CacheManager or any of the Caches it was managing will throw an IllegalStateException. The operational methods on CacheManager are: createCache ... getCacheNames

As I interpret this, a compliant implementation MUST throw IllegalStateException. In that case either the test or the specification should be amended.

@Test public void close_cachesEmpty() { [...] cacheManager.close(); assertFalse(cacheManager.getCacheNames().iterator().hasNext()); // ^^^^^^^ getCacheNames() after close() ^^^^^^^^ }

cruftex commented 8 years ago

Yes. This duplicates: https://github.com/jsr107/jsr107tck/issues/87

There is already a TCK pull request for it.

christian-esken commented 8 years ago

Thanks for the quick reply. My search didn't yield that, as I only searched in jsr107spec and not jsr107tck. :-) If there is a pull request already, I will not create another from https://github.com/trivago/jsr107tck/commit/cb34de9ce079eb747a0a7a8034acb09b168c3772

Should I close this duplicate bug?

cruftex commented 8 years ago

Yes, please close. I don't think that we should really alter the Spec here.

The only reason to alter the Spec would be to comply with all the existing implementations ;)

christian-esken commented 8 years ago

Closing as duplicate. Further comments should go to https://github.com/jsr107/jsr107tck/issues/87