@ -21,10 +21,7 @@ import org.junit.Test;
@@ -21,10 +21,7 @@ import org.junit.Test;
import test.mixin.Lockable ;
import org.springframework.aop.support.AopUtils ;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.support.ClassPathXmlApplicationContext ;
import org.springframework.tests.Assume ;
import org.springframework.tests.TestGroup ;
import org.springframework.tests.sample.beans.ITestBean ;
import static org.junit.Assert.* ;
@ -37,18 +34,22 @@ public class DeclareParentsTests {
@@ -37,18 +34,22 @@ public class DeclareParentsTests {
private ITestBean testBeanProxy ;
private ApplicationContext ctx ;
private Object introductionObject ;
@Before
public void setUp ( ) throws Exception {
ctx = new ClassPathXmlApplicationContext ( getClass ( ) . getSimpleName ( ) + ".xml" , getClass ( ) ) ;
@Before
public void setup ( ) {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext ( getClass ( ) . getSimpleName ( ) + ".xml" , getClass ( ) ) ;
testBeanProxy = ( ITestBean ) ctx . getBean ( "testBean" ) ;
assertTrue ( AopUtils . isAopProxy ( testBeanProxy ) ) ;
introductionObject = ctx . getBean ( "introduction" ) ;
}
@Test
public void testIntroductionWasMade ( ) {
assertTrue ( AopUtils . isAopProxy ( testBeanProxy ) ) ;
assertFalse ( "Introduction should not be proxied" , AopUtils . isAopProxy ( introductionObject ) ) ;
assertTrue ( "Introduction must have been made" , testBeanProxy instanceof Lockable ) ;
}
@ -58,11 +59,6 @@ public class DeclareParentsTests {
@@ -58,11 +59,6 @@ public class DeclareParentsTests {
// on the introduction, in which case this would not be a problem.
@Test
public void testLockingWorks ( ) {
Assume . group ( TestGroup . LONG_RUNNING ) ;
Object introductionObject = ctx . getBean ( "introduction" ) ;
assertFalse ( "Introduction should not be proxied" , AopUtils . isAopProxy ( introductionObject ) ) ;
Lockable lockable = ( Lockable ) testBeanProxy ;
assertFalse ( lockable . locked ( ) ) ;
@ -90,5 +86,4 @@ class NonAnnotatedMakeLockable {
@@ -90,5 +86,4 @@ class NonAnnotatedMakeLockable {
throw new IllegalStateException ( "locked" ) ;
}
}
}