Browse Source

SPR-7308

+ update AJ caching test
pull/7/head
Costin Leau 14 years ago
parent
commit
58633e4a89
  1. 6
      org.springframework.aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java
  2. 8
      org.springframework.aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java

6
org.springframework.aspects/src/test/java/org/springframework/cache/config/AnnotatedClassCacheableService.java vendored

@ -24,7 +24,7 @@ import org.springframework.cache.annotation.Cacheable; @@ -24,7 +24,7 @@ import org.springframework.cache.annotation.Cacheable;
/**
* @author Costin Leau
*/
@Cacheable
@Cacheable("default")
public class AnnotatedClassCacheableService implements CacheableService {
private AtomicLong counter = new AtomicLong();
@ -37,11 +37,11 @@ public class AnnotatedClassCacheableService implements CacheableService { @@ -37,11 +37,11 @@ public class AnnotatedClassCacheableService implements CacheableService {
return null;
}
@CacheEvict
@CacheEvict("default")
public void invalidate(Object arg1) {
}
@Cacheable(key = "#p0")
@Cacheable(value = "default", key = "#p0")
public Object key(Object arg1, Object arg2) {
return counter.getAndIncrement();
}

8
org.springframework.aspects/src/test/java/org/springframework/cache/config/DefaultCacheableService.java vendored

@ -31,21 +31,21 @@ public class DefaultCacheableService implements CacheableService<Long> { @@ -31,21 +31,21 @@ public class DefaultCacheableService implements CacheableService<Long> {
private AtomicLong counter = new AtomicLong();
@Cacheable
@Cacheable("default")
public Long cache(Object arg1) {
return counter.getAndIncrement();
}
@CacheEvict
@CacheEvict("default")
public void invalidate(Object arg1) {
}
@Cacheable(condition = "#classField == 3")
@Cacheable(value = "default", condition = "#classField == 3")
public Long conditional(int classField) {
return counter.getAndIncrement();
}
@Cacheable(key = "#p0")
@Cacheable(value = "default", key = "#p0")
public Long key(Object arg1, Object arg2) {
return counter.getAndIncrement();
}

Loading…
Cancel
Save