Browse Source

fix CI build

Prior to this commit, AnnotatedJCacheableService contained an annotated
method demonstrating a failure scenario. This could break depending on
the order of the methods array as AopUtils creates the proxy if the
pointcut matches by checking each method.

On the CI server, the first method was this invalid use case so
checking if the proxy has to be created lead to an unexpected
exception. This scenario has been moved to its own private class now.
pull/512/head
Stephane Nicoll 11 years ago
parent
commit
a198026469
  1. 6
      spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java
  2. 12
      spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java

6
spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotatedJCacheableService.java vendored

@ -177,12 +177,6 @@ public class AnnotatedJCacheableService implements JCacheableService<Long> { @@ -177,12 +177,6 @@ public class AnnotatedJCacheableService implements JCacheableService<Long> {
public void noAnnotation() {
}
@CacheRemove
@CacheRemoveAll
public void multiAnnotations() {
}
@Override
public long exceptionInvocations() {
return exceptionCounter.get();

12
spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/AnnotationCacheOperationSourceTests.java vendored

@ -25,6 +25,8 @@ import java.util.Comparator; @@ -25,6 +25,8 @@ import java.util.Comparator;
import javax.cache.annotation.CacheDefaults;
import javax.cache.annotation.CacheKeyGenerator;
import javax.cache.annotation.CacheRemove;
import javax.cache.annotation.CacheRemoveAll;
import javax.cache.annotation.CacheResult;
import org.junit.Before;
@ -105,7 +107,7 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests { @@ -105,7 +107,7 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests {
@Test
public void multiAnnotations() {
thrown.expect(IllegalStateException.class);
getCacheOperation(AnnotatedJCacheableService.class, name.getMethodName());
getCacheOperation(InvalidCases.class, name.getMethodName());
}
@Test
@ -259,4 +261,12 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests { @@ -259,4 +261,12 @@ public class AnnotationCacheOperationSourceTests extends AbstractJCacheTests {
}
}
static class InvalidCases {
@CacheRemove
@CacheRemoveAll
public void multiAnnotations() {
}
}
}

Loading…
Cancel
Save