Browse Source

closing context at end of test methods

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1313 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Mark Fisher 17 years ago
parent
commit
fc3f49ff40
  1. 7
      org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java

7
org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java

@ -45,6 +45,7 @@ public class AsyncAnnotationBeanPostProcessorTests { @@ -45,6 +45,7 @@ public class AsyncAnnotationBeanPostProcessorTests {
context.refresh();
Object target = context.getBean("target");
assertTrue(AopUtils.isAopProxy(target));
context.close();
}
@Test
@ -58,9 +59,10 @@ public class AsyncAnnotationBeanPostProcessorTests { @@ -58,9 +59,10 @@ public class AsyncAnnotationBeanPostProcessorTests {
ITestBean testBean = (ITestBean) context.getBean("target");
testBean.test();
Thread mainThread = Thread.currentThread();
testBean.await(1000);
testBean.await(3000);
Thread asyncThread = testBean.getThread();
assertNotSame(mainThread, asyncThread);
context.close();
}
@Test
@ -77,9 +79,10 @@ public class AsyncAnnotationBeanPostProcessorTests { @@ -77,9 +79,10 @@ public class AsyncAnnotationBeanPostProcessorTests {
context.refresh();
ITestBean testBean = (ITestBean) context.getBean("target");
testBean.test();
testBean.await(1000);
testBean.await(3000);
Thread asyncThread = testBean.getThread();
assertTrue(asyncThread.getName().startsWith("testExecutor"));
context.close();
}

Loading…
Cancel
Save