@Test public void testCglibProxy() { CglibProxyFactory cglibProxyFactory = new CglibProxyFactory(); UserService service = (UserService) cglibProxyFactory.getInstance(new UserServiceImpl()); service.saveUser(); }
@Test public void testJDKProxy() { JDKProxyFactory jdkProxyFactory = JDKProxyFactory.JDKProxy.getInstance(); UserService service = (UserService) jdkProxyFactory.bind(new UserServiceImpl()); service.saveUser(); }