use of org.springframework.aop.aspectj.annotation.AspectJProxyFactory in project java-chassis by ServiceComb.
the class TestBeanUtils method test.
@Test
public void test() {
Intf target = new Impl();
AspectJProxyFactory factory = new AspectJProxyFactory(target);
MyAspect aspect = new MyAspect();
factory.addAspect(aspect);
Intf proxy = factory.getProxy();
Assert.assertEquals(Impl.class, BeanUtils.getImplClassFromBean(proxy));
Assert.assertEquals(Impl.class, BeanUtils.getImplClassFromBean(new Impl()));
}
use of org.springframework.aop.aspectj.annotation.AspectJProxyFactory in project incubator-servicecomb-java-chassis by apache.
the class TestBeanUtils method test.
@Test
public void test() {
Intf target = new Impl();
AspectJProxyFactory factory = new AspectJProxyFactory(target);
MyAspect aspect = new MyAspect();
factory.addAspect(aspect);
Intf proxy = factory.getProxy();
Assert.assertEquals(Impl.class, BeanUtils.getImplClassFromBean(proxy));
Assert.assertEquals(Impl.class, BeanUtils.getImplClassFromBean(new Impl()));
}
use of org.springframework.aop.aspectj.annotation.AspectJProxyFactory in project irida by phac-nml.
the class ProjectEventAspectTest method setup.
@Before
public void setup() {
eventHandler = mock(ProjectEventHandler.class);
projectEventAspect = new ProjectEventAspect(eventHandler);
annotatedClass = new AnnotatedClass();
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(annotatedClass);
proxyFactory.addAspect(projectEventAspect);
annotatedClass = proxyFactory.getProxy();
}
use of org.springframework.aop.aspectj.annotation.AspectJProxyFactory in project micrometer by micrometer-metrics.
the class TimedAspectTest method timeMethod.
@Test
void timeMethod() {
MeterRegistry registry = new SimpleMeterRegistry();
AspectJProxyFactory pf = new AspectJProxyFactory(new TimedService());
pf.addAspect(new TimedAspect(registry));
TimedService service = pf.getProxy();
service.call();
assertThat(registry.get("call").tag("class", "io.micrometer.core.aop.TimedAspectTest$TimedService").tag("method", "call").tag("extra", "tag").timer().count()).isEqualTo(1);
}
use of org.springframework.aop.aspectj.annotation.AspectJProxyFactory in project commons by craftercms.
the class HasPermissionAnnotationHandlerTest method createTestService.
private void createTestService() throws PermissionException {
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new MockSecuredServiceImpl());
proxyFactory.addAspect(annotationHandler);
service = proxyFactory.getProxy();
}
Aggregations