Increased timeout in calls to assertStopWatchTimeLimit() to increase stability of the build.
This commit is contained in:
parent
0d4469d8e3
commit
f3f29412d4
|
|
@ -17,6 +17,11 @@
|
||||||
package org.springframework.aop.aspectj.autoproxy;
|
package org.springframework.aop.aspectj.autoproxy;
|
||||||
|
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotSame;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
@ -27,9 +32,7 @@ import org.aspectj.lang.annotation.Around;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.aop.MethodBeforeAdvice;
|
import org.springframework.aop.MethodBeforeAdvice;
|
||||||
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
|
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
|
||||||
import org.springframework.aop.aspectj.annotation.AspectMetadata;
|
import org.springframework.aop.aspectj.annotation.AspectMetadata;
|
||||||
|
|
@ -124,9 +127,9 @@ public final class AspectJAutoProxyCreatorTests {
|
||||||
}
|
}
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
|
||||||
// What's a reasonable expectation for _any_ server load?
|
// What's a reasonable expectation for _any_ server or developer machine load?
|
||||||
// 4 seconds? 7 seconds?
|
// 9 seconds?
|
||||||
assertStopWatchTimeLimit(sw, 7000);
|
assertStopWatchTimeLimit(sw, 9000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -146,8 +149,8 @@ public final class AspectJAutoProxyCreatorTests {
|
||||||
}
|
}
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
|
||||||
// What's a reasonable expectation for _any_ server load?
|
// What's a reasonable expectation for _any_ server or developer machine load?
|
||||||
// 3 seconds? 7 seconds?
|
// 3 seconds?
|
||||||
assertStopWatchTimeLimit(sw, 3000);
|
assertStopWatchTimeLimit(sw, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,19 +171,19 @@ public final class AspectJAutoProxyCreatorTests {
|
||||||
ac.refresh();
|
ac.refresh();
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
|
||||||
// What's a reasonable expectation for _any_ server load?
|
// What's a reasonable expectation for _any_ server or developer machine load?
|
||||||
// 4 seconds? 7 seconds?
|
// 8 seconds?
|
||||||
assertStopWatchTimeLimit(sw, 7000);
|
assertStopWatchTimeLimit(sw, 8000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAspectsAndAdvisorAreAppliedEvenIfComingFromParentFactory() {
|
public void testAspectsAndAdvisorAreAppliedEvenIfComingFromParentFactory() {
|
||||||
ClassPathXmlApplicationContext ac = newContext("aspectsPlusAdvisor.xml");
|
ClassPathXmlApplicationContext ac = newContext("aspectsPlusAdvisor.xml");
|
||||||
GenericApplicationContext childAc = new GenericApplicationContext(ac);
|
GenericApplicationContext childAc = new GenericApplicationContext(ac);
|
||||||
// Create a child factory with a bean that should be weaved
|
// Create a child factory with a bean that should be woven
|
||||||
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
|
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
|
||||||
bd.getPropertyValues().addPropertyValue(new PropertyValue("name", "Adrian")).addPropertyValue(
|
bd.getPropertyValues().addPropertyValue(new PropertyValue("name", "Adrian"))
|
||||||
new PropertyValue("age", new Integer(34)));
|
.addPropertyValue(new PropertyValue("age", new Integer(34)));
|
||||||
childAc.registerBeanDefinition("adrian2", bd);
|
childAc.registerBeanDefinition("adrian2", bd);
|
||||||
// Register the advisor auto proxy creator with subclass
|
// Register the advisor auto proxy creator with subclass
|
||||||
childAc.registerBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class.getName(), new RootBeanDefinition(
|
childAc.registerBeanDefinition(AnnotationAwareAspectJAutoProxyCreator.class.getName(), new RootBeanDefinition(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue