17
17
package org .springframework .aop .aspectj .autoproxy ;
18
18
19
19
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
+
20
25
import java .lang .reflect .Method ;
21
26
22
27
import org .apache .commons .logging .Log ;
27
32
import org .aspectj .lang .annotation .Aspect ;
28
33
import org .aspectj .lang .annotation .Before ;
29
34
import org .aspectj .lang .annotation .Pointcut ;
30
- import static org .junit .Assert .*;
31
35
import org .junit .Test ;
32
-
33
36
import org .springframework .aop .MethodBeforeAdvice ;
34
37
import org .springframework .aop .aspectj .annotation .AnnotationAwareAspectJAutoProxyCreator ;
35
38
import org .springframework .aop .aspectj .annotation .AspectMetadata ;
@@ -124,9 +127,9 @@ public void testAspectsAndAdvisorAppliedToPrototypeIsFastEnough() {
124
127
}
125
128
sw .stop ();
126
129
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 );
130
133
}
131
134
132
135
@ Test
@@ -146,8 +149,8 @@ public void testAspectsAndAdvisorNotAppliedToPrototypeIsFastEnough() {
146
149
}
147
150
sw .stop ();
148
151
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?
151
154
assertStopWatchTimeLimit (sw , 3000 );
152
155
}
153
156
@@ -168,19 +171,19 @@ public void testAspectsAndAdvisorNotAppliedToManySingletonsIsFastEnough() {
168
171
ac .refresh ();
169
172
sw .stop ();
170
173
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 );
174
177
}
175
178
176
179
@ Test
177
180
public void testAspectsAndAdvisorAreAppliedEvenIfComingFromParentFactory () {
178
181
ClassPathXmlApplicationContext ac = newContext ("aspectsPlusAdvisor.xml" );
179
182
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
181
184
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 )));
184
187
childAc .registerBeanDefinition ("adrian2" , bd );
185
188
// Register the advisor auto proxy creator with subclass
186
189
childAc .registerBeanDefinition (AnnotationAwareAspectJAutoProxyCreator .class .getName (), new RootBeanDefinition (
0 commit comments