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.
This commit is contained in:
Stephane Nicoll 2014-02-27 15:21:07 +01:00
parent 7b5e9e8c8e
commit a198026469
2 changed files with 11 additions and 7 deletions

View File

@ -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();

View File

@ -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 {
@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 {
}
}
static class InvalidCases {
@CacheRemove
@CacheRemoveAll
public void multiAnnotations() {
}
}
}