Package org.springmodules.cache

Examples of org.springmodules.cache.CacheException


  protected void onFlushCache(FlushingModel model) throws CacheException {
    GigaSpacesFlushingModel flushingModel = (GigaSpacesFlushingModel) model;
    String[] cacheNames = flushingModel.getCacheNames();

    if (!ObjectUtils.isEmpty(cacheNames)) {
      CacheException cacheException = null;
      int nameCount = cacheNames.length;

      try {
        for (int i = 0; i < nameCount; i++) {
          IMap cache = getCache(cacheNames[i]);
View Full Code Here


  public void testCancelCacheUpdateWhenCacheAccessThrowsExceptionAndFailQuietlyIsFalse()
      throws Exception {
    cacheProviderFacade.setFailQuietlyEnabled(false);

    CacheException expected = expectOnCancelCacheUpdateToThrowException();

    cacheProviderFacadeControl.replay();

    try {
      cacheProviderFacade.cancelCacheUpdate(key);
View Full Code Here

  }

  public void testFlushCacheWhenAccessToCacheThrowsExceptionAndFailQuietlyIsFalse()
      throws Exception {
    cacheProviderFacade.setFailQuietlyEnabled(false);
    CacheException expected = expectOnFlushCacheToThrowException();
    cacheProviderFacadeControl.replay();

    try {
      cacheProviderFacade.flushCache(flushingModel);
      fail();
View Full Code Here

  }

  public void testGetFromCacheWhenAccessToCacheThrowsExceptionAndFailQuietlyIsFalse()
      throws Exception {
    cacheProviderFacade.setFailQuietlyEnabled(false);
    CacheException expectedException = expectOnGetFromCacheToThrowException();
    cacheProviderFacadeControl.replay();

    try {
      cacheProviderFacade.getFromCache(key, cachingModel);
      fail();
View Full Code Here

    cacheProviderFacadeControl.verify();
  }

  public void testHandleCacheAccessExceptionWhenFailedQuietlyIsFalse() {
    cacheProviderFacade.setFailQuietlyEnabled(false);
    CacheException expectedException = createCacheException();

    try {
      cacheProviderFacade.handleCatchedException(expectedException);
      fail();
View Full Code Here

    }
  }

  public void testHandleCacheAccessExceptionWhenFailedQuietlyIsTrue() {
    cacheProviderFacade.setFailQuietlyEnabled(true);
    CacheException cacheException = createCacheException();

    // should not throw exceptions.
    cacheProviderFacade.handleCatchedException(cacheException);
  }
View Full Code Here

    cacheProviderFacade.setFailQuietlyEnabled(false);
    Object objectToStore = new Object();

    cacheProviderFacadeControl.expectAndReturn(cacheProviderFacade
        .isSerializableCacheElementRequired(), false);
    CacheException expectedException = expectOnPutInCacheThrowsException(objectToStore);
    cacheProviderFacadeControl.replay();

    try {
      cacheProviderFacade.putInCache(key, cachingModel, objectToStore);
      fail();
View Full Code Here

  public void testRemoveFromCacheWhenAccessToCacheThrowsExceptionAndFailQuietlyIsFalse()
      throws Exception {
    cacheProviderFacade.setFailQuietlyEnabled(false);

    CacheException expectedException = expectOnRemoveFromCacheThrowsException();
    cacheProviderFacadeControl.replay();

    try {
      cacheProviderFacade.removeFromCache(key, cachingModel);
      fail();
View Full Code Here

  private CacheException createCacheException() {
    return new CacheNotFoundException("someCache");
  }

  private CacheException expectOnCancelCacheUpdateToThrowException() {
    CacheException expected = createCacheException();
    cacheProviderFacade.onCancelCacheUpdate(key);
    cacheProviderFacadeControl.setThrowable(expected);

    return expected;
  }
View Full Code Here

    return expected;
  }

  private CacheException expectOnFlushCacheToThrowException() {
    CacheException expected = createCacheException();
    cacheProviderFacade.onFlushCache(flushingModel);
    cacheProviderFacadeControl.setThrowable(expected);

    return expected;
  }
View Full Code Here

TOP

Related Classes of org.springmodules.cache.CacheException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.