? ? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
13 Aug 2016

Summary of Changes

Create subclasses of RuntimeException to be used for more specific fail conditions in the cache API and implement them:

  • JCacheExceptionConnecting when an adapter tries to connect to an external service and fails
  • JCacheExceptionUnsupported when the requested cache adapter is unsupported (either a class cannot be found or the isSupported() method checks return false

Removes the over-eager connection check in the Memcached adapter's isSupported() method. The reasoning for this has been explained elsewhere.

Marks in the Redis adapter that it will throw Exceptions as of 4.0.

Makes the unit tests catch a connecting exception and skip the test if the platform can't be reached correctly.

In the Memcache(d) adapters null out the connection when throwing a connection exception; this will force the constructor to attempt the connection again if the class is instantiated after the first failure.

Testing Instructions

The cache API still functions as expected

On a connection failure for Memcache(d) and Redis a JCacheExceptionConnecting object (subclass of RuntimeException so no B/C break with existing try/catch code) is thrown

When a cache adapter is not supported a JCacheExceptionUnsupported object (subclass of RuntimeException so no B/C break with existing try/catch code) is thrown

Documentation Changes Required

N/A

avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2016
Category Libraries Unit Tests
avatar mbabker mbabker - open - 13 Aug 2016
avatar mbabker mbabker - change - 13 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2016
Labels Added: ? ?
avatar andrepereiradasilva andrepereiradasilva - test_item - 15 Aug 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Aug 2016

I have tested this item successfully on 267f477

Works as described.
tested with code review + changing the configuration.php cache_handler to redis memcached (not supported) and blabla (doesn't exist)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11583.

avatar photodude
photodude - comment - 18 Aug 2016

I'm guessing this needs to be rebased to get the unit test changes, since all of the unit tests are erroring in this PR.

avatar wilsonge wilsonge - change - 6 Sep 2016
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-09-06 12:15:44
Closed_By wilsonge

Add a Comment

Login with GitHub to post a comment