From 044cc965c448d9f0b3f0ca76b367c73d1346885a Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sat, 6 Jun 2009 01:25:10 +0000 Subject: [PATCH] closing context at end of test methods --- .../annotation/AsyncAnnotationBeanPostProcessorTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java b/org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java index 532b8328ce..7991015c5d 100644 --- a/org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java +++ b/org.springframework.context/src/test/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessorTests.java @@ -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 { 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 { 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(); }