Search in sources :

Example 1 with F

use of io.vertigo.core.component.aop.data.components.F in project vertigo by KleeGroup.

the class AspectTest method testOneMoreOnClass.

@Test
public final void testOneMoreOnClass() {
    final F f = getApp().getComponentSpace().resolve(F.class);
    // On vérifie que l'intercepteur ajoute bien 1 à la somme de 2+3
    assertEquals(11, f.getValue(10));
    assertEquals(12, f.getValue2(10));
    assertEquals(22, f.getValue3(10));
}
Also used : F(io.vertigo.core.component.aop.data.components.F) Test(org.junit.jupiter.api.Test)

Example 2 with F

use of io.vertigo.core.component.aop.data.components.F in project vertigo by KleeGroup.

the class AspectTest method testUnwrapp.

@Test
public final void testUnwrapp() {
    final AopPlugin aopPlugin = getApp().getConfig().getBootConfig().getAopPlugin();
    final F f = getApp().getComponentSpace().resolve(F.class);
    // Il y a des aspects sur la classe donc elle doit être dewrappable
    assertNotEquals(F.class.getName(), f.getClass().getName());
    assertEquals(F.class.getName(), aopPlugin.unwrap(f).getClass().getName());
    // Il y a pas d'aspect
    final A myA = getApp().getComponentSpace().resolve(A.class);
    assertEquals(A.class.getName(), myA.getClass().getName());
    assertEquals(A.class.getName(), aopPlugin.unwrap(myA).getClass().getName());
}
Also used : A(io.vertigo.core.component.aop.data.components.A) F(io.vertigo.core.component.aop.data.components.F) AopPlugin(io.vertigo.core.component.AopPlugin) Test(org.junit.jupiter.api.Test)

Aggregations

F (io.vertigo.core.component.aop.data.components.F)2 Test (org.junit.jupiter.api.Test)2 AopPlugin (io.vertigo.core.component.AopPlugin)1 A (io.vertigo.core.component.aop.data.components.A)1