test_class.declarator: cut
test_class.modifier: private static
test_class.original_string: private static UpdateMultiCacheAdvice cut;
test_class.type: UpdateMultiCacheAdvice
test_class.var_name: cut
test_class.file: simple-spring-memcached/src/test/java/com/google/code/ssm/aop/UpdateMultiCacheAdviceTest.java
test_class.identifier: UpdateMultiCacheAdviceTest
test_case.body: @Test
      public void testUpdateCache() throws Exception {
          final Method method = AnnotationTest.class.getMethod("cacheMe01", List.class);
          final UpdateMultiCache annotation = method.getAnnotation(UpdateMultiCache.class);
          final AnnotationData data = AnnotationDataBuilder.buildAnnotationData(annotation, UpdateMultiCache.class, method);
  
          final List<String> keys = new ArrayList<String>();
          final List<Object> objs = new ArrayList<Object>();
          keys.add("Key1-" + System.currentTimeMillis());
          keys.add("Key2-" + System.currentTimeMillis());
  
          try {
              cut.updateCache(keys, objs, method, data, null);
              fail("Expected Exception.");
          } catch (InvalidAnnotationException ex) {
              assertTrue(ex.getMessage().contains("do not match in size"));
          }
  
          final Cache cache = EasyMock.createMock(Cache.class);
          EasyMock.expect(cache.getName()).andReturn(AnnotationConstants.DEFAULT_CACHE_NAME);
          EasyMock.expect(cache.getAliases()).andReturn(Collections.<String> emptyList()).anyTimes();
          EasyMock.expect(cache.getProperties()).andReturn(new CacheProperties()).anyTimes();
          for (final String key : keys) {
              final String value = "ValueFor-" + key;
              objs.add(value);
              cache.setSilently(key, data.getExpiration(), value, null);
              EasyMock.expectLastCall();
          }
          keys.add("BigFatNull");
          objs.add(null);
          cache.setSilently(keys.get(2), data.getExpiration(), new PertinentNegativeNull(), null);
          EasyMock.expectLastCall();
  
          EasyMock.replay(cache);
  
          cut.getCacheBase().addCache(cache);
          cut.updateCache(keys, objs, method, data, null);
  
          EasyMock.verify(cache);
      }
test_case.class_method_signature: UpdateMultiCacheAdviceTest.testUpdateCache()
test_case.full_signature: @Test public void testUpdateCache()
test_case.identifier: testUpdateCache
test_case.invocations: getMethod getAnnotation buildAnnotationData add currentTimeMillis add currentTimeMillis updateCache fail assertTrue contains getMessage createMock andReturn expect getName anyTimes andReturn expect getAliases emptyList anyTimes andReturn expect getProperties add setSilently getExpiration expectLastCall add add setSilently get getExpiration expectLastCall replay addCache getCacheBase updateCache verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateCache()
focal_class.declarator: LOG = LoggerFactory.getLogger(UpdateMultiCacheAdvice.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(UpdateMultiCacheAdvice.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: simple-spring-memcached/src/main/java/com/google/code/ssm/aop/UpdateMultiCacheAdvice.java
focal_class.identifier: UpdateMultiCacheAdvice
focal_class.class_method_signature: UpdateMultiCacheAdvice.updateMulti()
focal_class.full_signature: @Pointcut("@annotation(com.google.code.ssm.api.UpdateMultiCache)") public void updateMulti()
focal_class.identifier: updateMulti
focal_class.modifiers: @Pointcut("@annotation(com.google.code.ssm.api.UpdateMultiCache)") public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateMulti()
focal_class.class_method_signature: UpdateMultiCacheAdvice.cacheUpdateMulti(final JoinPoint jp, final Object retVal)
focal_class.full_signature: @AfterReturning(pointcut = "updateMulti()", returning = "retVal") public void cacheUpdateMulti(final JoinPoint jp, final Object retVal)
focal_class.identifier: cacheUpdateMulti
focal_class.modifiers: @AfterReturning(pointcut = "updateMulti()", returning = "retVal") public
focal_class.parameters: (final JoinPoint jp, final Object retVal)
focal_class.return: void
focal_class.signature: void cacheUpdateMulti(final JoinPoint jp, final Object retVal)
focal_class.class_method_signature: UpdateMultiCacheAdvice.convertIdObjectsToKeyMap(final List<Object> idObjects, final AnnotationData data)
focal_class.full_signature:  MapHolder convertIdObjectsToKeyMap(final List<Object> idObjects, final AnnotationData data)
focal_class.identifier: convertIdObjectsToKeyMap
focal_class.parameters: (final List<Object> idObjects, final AnnotationData data)
focal_class.return: MapHolder
focal_class.signature: MapHolder convertIdObjectsToKeyMap(final List<Object> idObjects, final AnnotationData data)
focal_class.class_method_signature: UpdateMultiCacheAdvice.updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_class.full_signature:  void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_class.identifier: updateCache
focal_class.parameters: (final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_class.return: void
focal_class.signature: void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_class.class_method_signature: UpdateMultiCacheAdvice.updateCacheWithMissed(final List<Object> dataUpdateContents, final MultiCacheCoordinator coord,
              final UpdateMultiCacheOption option, final SerializationType serializationType)
focal_class.full_signature: private void updateCacheWithMissed(final List<Object> dataUpdateContents, final MultiCacheCoordinator coord,
              final UpdateMultiCacheOption option, final SerializationType serializationType)
focal_class.identifier: updateCacheWithMissed
focal_class.modifiers: private
focal_class.parameters: (final List<Object> dataUpdateContents, final MultiCacheCoordinator coord,
              final UpdateMultiCacheOption option, final SerializationType serializationType)
focal_class.return: void
focal_class.signature: void updateCacheWithMissed(final List<Object> dataUpdateContents, final MultiCacheCoordinator coord,
              final UpdateMultiCacheOption option, final SerializationType serializationType)
focal_class.class_method_signature: UpdateMultiCacheAdvice.getLogger()
focal_class.full_signature: @Override protected Logger getLogger()
focal_class.identifier: getLogger
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: Logger
focal_class.signature: Logger getLogger()
focal_class.superclass: extends MultiCacheAdvice
focal_method.body: void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType) {
          if (returnList.size() != cacheKeys.size()) {
              throw new InvalidAnnotationException(String.format(
                      "The key generation objects, and the resulting objects do not match in size for [%s].", methodToCache.toString()));
          }
  
          Iterator<Object> returnListIter = returnList.iterator();
          Iterator<String> cacheKeyIter = cacheKeys.iterator();
          String cacheKey;
          Object result, cacheObject;
          while (returnListIter.hasNext()) {
              result = returnListIter.next();
              cacheKey = cacheKeyIter.next();
              cacheObject = getCacheBase().getSubmission(result);
              getCacheBase().getCache(data).setSilently(cacheKey, data.getExpiration(), cacheObject, serializationType);
          }
      }
focal_method.class_method_signature: UpdateMultiCacheAdvice.updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_method.full_signature:  void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_method.identifier: updateCache
focal_method.invocations: size size format toString iterator iterator hasNext next next getSubmission getCacheBase setSilently getCache getCacheBase getExpiration
focal_method.parameters: (final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)
focal_method.return: void
focal_method.signature: void updateCache(final List<String> cacheKeys, final List<Object> returnList, final Method methodToCache, final AnnotationData data,
              final SerializationType serializationType)