Skip to content

Commit f3f2941

Browse files
committed
Increased timeout in calls to assertStopWatchTimeLimit() to increase stability of the build.
1 parent 0d4469d commit f3f2941

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

org.springframework.context/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJAutoProxyCreatorTests.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
package org.springframework.aop.aspectj.autoproxy;
1818

1919
import static java.lang.String.format;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertFalse;
22+
import static org.junit.Assert.assertNotSame;
23+
import static org.junit.Assert.assertTrue;
24+
2025
import java.lang.reflect.Method;
2126

2227
import org.apache.commons.logging.Log;
@@ -27,9 +32,7 @@
2732
import org.aspectj.lang.annotation.Aspect;
2833
import org.aspectj.lang.annotation.Before;
2934
import org.aspectj.lang.annotation.Pointcut;
30-
import static org.junit.Assert.*;
3135
import org.junit.Test;
32-
3336
import org.springframework.aop.MethodBeforeAdvice;
3437
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
3538
import org.springframework.aop.aspectj.annotation.AspectMetadata;
@@ -124,9 +127,9 @@ public void testAspectsAndAdvisorAppliedToPrototypeIsFastEnough() {
124127
}
125128
sw.stop();
126129

127-
// What's a reasonable expectation for _any_ server load?
128-
// 4 seconds? 7 seconds?
129-
assertStopWatchTimeLimit(sw, 7000);
130+
// What's a reasonable expectation for _any_ server or developer machine load?
131+
// 9 seconds?
132+
assertStopWatchTimeLimit(sw, 9000);
130133
}
131134

132135
@Test
@@ -146,8 +149,8 @@ public void testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough() {
146149
}
147150
sw.stop();
148151

149-
// What's a reasonable expectation for _any_ server load?
150-
// 3 seconds? 7 seconds?
152+
// What's a reasonable expectation for _any_ server or developer machine load?
153+
// 3 seconds?
151154
assertStopWatchTimeLimit(sw, 3000);
152155
}
153156

@@ -168,19 +171,19 @@ public void testAspectsAndAdvisorNotAppliedToManySingletonsIsFastEnough() {
168171
ac.refresh();
169172
sw.stop();
170173

171-
// What's a reasonable expectation for _any_ server load?
172-
// 4 seconds? 7 seconds?
173-
assertStopWatchTimeLimit(sw, 7000);
174+
// What's a reasonable expectation for _any_ server or developer machine load?
175+
// 8 seconds?
176+
assertStopWatchTimeLimit(sw, 8000);
174177
}
175178

176179
@Test
177180
public void testAspectsAndAdvisorAreAppliedEvenIfComingFromParentFactory() {
178181
ClassPathXmlApplicationContext ac = newContext("aspectsPlusAdvisor.xml");
179182
GenericApplicationContext childAc = new GenericApplicationContext(ac);
180-
// Create a child factory with a bean that should be weaved
183+
// Create a child factory with a bean that should be woven
181184
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
182-
bd.getPropertyValues().addPropertyValue(new PropertyValue("name", "Adrian")).addPropertyValue(
183-
new PropertyValue("age", new Integer(34)));
185+
bd.getPropertyValues().addPropertyValue(new PropertyValue("name", "Adrian"))
186+
.addPropertyValue(new PropertyValue("age", new Integer(34)));
184187
childAc.registerBeanDefinition("adrian2", bd);
185188
// Register the advisor auto proxy creator with subclass
186189
childAc.registerBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class.getName(), new RootBeanDefinition(

0 commit comments

Comments
 (0)