Search in sources :

Example 1 with LockMixinAdvisor

use of test.mixin.LockMixinAdvisor in project spring-framework by spring-projects.

the class UnsupportedInterceptor method getIntroductionAdvisorProxy.

private ITestBean getIntroductionAdvisorProxy(TestBean target) {
    ProxyFactory pf = new ProxyFactory(ITestBean.class);
    pf.setProxyTargetClass(true);
    pf.addAdvisor(new LockMixinAdvisor());
    pf.setTarget(target);
    pf.setFrozen(true);
    pf.setExposeProxy(false);
    return (ITestBean) pf.getProxy();
}
Also used : ITestBean(org.springframework.beans.testfixture.beans.ITestBean) LockMixinAdvisor(test.mixin.LockMixinAdvisor)

Example 2 with LockMixinAdvisor

use of test.mixin.LockMixinAdvisor in project spring-framework by spring-projects.

the class AbstractAopProxyTests method testMixinWithIntroductionAdvisor.

/**
 * Test stateful interceptor
 */
@Test
public void testMixinWithIntroductionAdvisor() throws Throwable {
    TestBean tb = new TestBean();
    ProxyFactory pc = new ProxyFactory();
    pc.addInterface(ITestBean.class);
    pc.addAdvisor(new LockMixinAdvisor());
    pc.setTarget(tb);
    testTestBeanIntroduction(pc);
}
Also used : TestBean(org.springframework.beans.testfixture.beans.TestBean) ITestBean(org.springframework.beans.testfixture.beans.ITestBean) LockMixinAdvisor(test.mixin.LockMixinAdvisor) Test(org.junit.jupiter.api.Test)

Aggregations

ITestBean (org.springframework.beans.testfixture.beans.ITestBean)2 LockMixinAdvisor (test.mixin.LockMixinAdvisor)2 Test (org.junit.jupiter.api.Test)1 TestBean (org.springframework.beans.testfixture.beans.TestBean)1