Package jodd.proxetta.impl

Examples of jodd.proxetta.impl.ProxyProxetta.builder()


      ProxyProxetta proxetta = ProxyProxetta.withAspects(aspect);

      proxetta.setClassNameSuffix("$ScopedProxy");
      proxetta.setVariableClassName(true);

      ProxyProxettaBuilder builder = proxetta.builder(beanType);

      proxyClass = builder.define();

      proxyClasses.put(beanType, proxyClass);
    }
View Full Code Here


    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();
View Full Code Here

      fail("Default class loader should not load java.*");
    } catch (RuntimeException rex) {
      // ignore
    }

    builder = proxyProxetta.builder();
    builder.setTarget(Object.class);
    builder.setTargetProxyClassName("foo.");
    Object object = builder.newInstance();

    assertNotNull(object);
View Full Code Here

    System.out.println("----------list");

    StatCounter.counter = 0;

    builder = proxyProxetta.builder(ArrayList.class, "foo.");
    List list = (List) builder.newInstance();
    assertNotNull(list);
    assertEquals("foo.ArrayList$$Proxetta", list.getClass().getName());

    assertEquals(1, StatCounter.counter);
View Full Code Here

    list.add(new Integer(1));
    assertTrue(StatCounter.counter == 3 || StatCounter.counter == 2);

    System.out.println("----------set");

    builder = proxyProxetta.builder(HashSet.class, "foo.");
    Set set = (Set) builder.newInstance();

    assertNotNull(set);
    assertEquals("foo.HashSet$$Proxetta", set.getClass().getName());
View Full Code Here

                }
              }))
        //.setDebugFolder("/Users/igor/")
        ;

    ProxettaBuilder proxettaBuilder = proxetta.builder();
    proxettaBuilder.setTarget(Hero.class);
    proxetta.setVariableClassName(true);
    Hero hero = (Hero) proxettaBuilder.newInstance();

    assertEquals("BatmanHero37W88.3CatWoman99speeeeedXRAYnull", hero.name());
View Full Code Here

                }
              }))
        //.setDebugFolder("/Users/igor/")
        ;

    ProxettaBuilder proxettaBuilder = proxetta.builder();
    proxettaBuilder.setTarget(Hero.class);
    proxetta.setVariableClassName(true);
    Hero hero = (Hero) proxettaBuilder.newInstance();

    assertEquals("SilverHero89W99.222None1000speeeeedXRAYnull", hero.name());
View Full Code Here

        new ProxyAspect(CollectorAdvice.class, new AllTopMethodsPointcut())
    );

//    proxetta.setDebugFolder("d:\\");

    Foo foo = (Foo) proxetta.builder(Foo.class).newInstance();

    Field field = foo.getClass().getDeclaredField("$__methods$0");

    field.setAccessible(true);
View Full Code Here

  @Test
  public void testWrapperWithProxyReturns() throws Exception {
    ProxyProxetta proxetta = ProxyProxetta.withAspects(
        new ProxyAspect(ReflectionReplacementAdvice.class, new AllMethodsPointcut()));

    ProxyProxettaBuilder builder = proxetta.builder(Retro.class, ".Retro2");

//    proxetta.setDebugFolder("d:\\");

    Class proxyClass = builder.define();
View Full Code Here

  @Test
  public void testNullReturns() throws Exception {
    ProxyProxetta proxetta = ProxyProxetta.withAspects(
        new ProxyAspect(ReturnNullAdvice.class, new AllMethodsPointcut()));

    ProxyProxettaBuilder builder = proxetta.builder(Retro.class, ".Retro3");

//    proxetta.setDebugFolder("d:\\");

    Class proxyClass = builder.define();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.