use of jodd.proxetta.ProxyAspect in project jodd by oblac.
the class GenericsInDefaultTest method testClassesWithGenericsAsReturnValueProxyDefault.
@Test
public void testClassesWithGenericsAsReturnValueProxyDefault() {
try {
ProxyAspect aspect = new ProxyAspect(DelegateAdvice.class);
ProxyProxetta proxetta = ProxyProxetta.withAspects(aspect);
ProxyProxettaBuilder builder = proxetta.builder(Foo.class);
builder.newInstance();
} catch (Exception ex) {
ex.printStackTrace();
fail(ex.toString());
}
}
use of jodd.proxetta.ProxyAspect in project jodd by oblac.
the class PetiteHelper method createProxyProxetta.
public static ProxyProxetta createProxyProxetta() {
ProxyPointcut pointcut_logged = new MethodAnnotationPointcut(Logged.class);
ProxyAspect aspect_logged = new ProxyAspect(LogProxyAdvice.class, pointcut_logged);
return ProxyProxetta.withAspects(aspect_logged);
}
use of jodd.proxetta.ProxyAspect in project jodd by oblac.
the class PetiteHelper method createProxyProxetta.
public static ProxyProxetta createProxyProxetta() {
ProxyPointcut pointcut_logged = new MethodAnnotationPointcut(Logged.class);
ProxyAspect aspect_logged = new ProxyAspect(LogProxyAdvice.class, pointcut_logged);
ProxyProxetta proxetta = ProxyProxetta.withAspects(aspect_logged);
return proxetta;
}
use of jodd.proxetta.ProxyAspect in project jodd by oblac.
the class GenericsInDefaultTest method testClassesWithGenericsAsReturnValueWrapperDefault.
@Test
public void testClassesWithGenericsAsReturnValueWrapperDefault() {
try {
ProxyAspect aspect = new ProxyAspect(DelegateAdvice.class);
WrapperProxetta proxetta = WrapperProxetta.withAspects(aspect);
WrapperProxettaBuilder builder = proxetta.builder(Foo.class, IFoo.class);
builder.newInstance();
} catch (Exception ex) {
ex.printStackTrace();
fail(ex.toString());
}
}
use of jodd.proxetta.ProxyAspect in project jodd by oblac.
the class MethrefTest method testMethRefOnProxifiedClass.
@Test
public void testMethRefOnProxifiedClass() {
Methref<? extends Oink> m = Methref.on(Oink.class);
m.to().woink();
assertEquals("woink", m.ref());
ProxyAspect a1 = new ProxyAspect(DummyAdvice.class, new AllTopMethodsPointcut());
ProxyProxetta pp = ProxyProxetta.withAspects(a1);
Oink oink = (Oink) pp.builder(Oink.class).newInstance();
assertFalse(oink.getClass().equals(Oink.class));
m = Methref.on(oink.getClass());
m.to().woink();
assertEquals("woink", m.ref());
}
Aggregations