Package tests.jfun.yan.benchmark.models

Examples of tests.jfun.yan.benchmark.models.Soo


   
    Noop bar = (Noop)yan.getInstance("complex_proxy");
    assertNotNull(bar);
  }
  public void testBenchInjectionOnly() throws Exception{
    final Soo soo = new Soo();
    new Benchmark("Nuts: <injection>", LOOP){
      public void run() throws Exception {
        Injection inj = (Injection)yan.getInstance("injection");
        inj.inject(soo);
      }
View Full Code Here


    new Benchmark("Nuts: Create bean with Setter Dependency Injection", LOOP){
      public void run() throws Exception {
        yan.getInstance("soo");
      }
    }.start(true);
    Soo soo = (Soo)yan.getInstance("soo");
    assertNotNull(soo.getBar());
  }
View Full Code Here

    new Benchmark("Nuts: Create bean with bytype autowiring and Setter Dependency Injection", LOOP){
      public void run() throws Exception {
        yan.getInstance("auto_soo");
      }
    }.start(true);
    Soo soo = (Soo)yan.getInstance("auto_soo");
    assertNotNull(soo.getBar());
  }
View Full Code Here

    new Benchmark("Nuts: Create singleton bean with Setter Dependency Injection", LOOP*10){
      public void run() throws Exception {
        yan.getInstance("ssoo");
      }
    }.start(true);
    Soo soo = (Soo)yan.getInstance("ssoo");
    assertNotNull(soo.getBar());
  }
View Full Code Here

  public void testBenchSingletonFactory() throws Exception{
    final jfun.yan.factory.Factory factory = yan.getFactory("ssoo");
     Benchmark bench = new Benchmark("Nuts: Singleton Bean with Factory", LOOP*10){
     
      public void run() throws Exception {
        final Soo foo = (Soo)factory.create();
        foo.noop();
      }
    };
    bench.start(true);
  }
View Full Code Here

    final Component ssoo = yan.getComponent("ssoo").factory(MyFactory.class);
    final MyFactory factory = (MyFactory)yan.instantiateComponent(ssoo);
     Benchmark bench = new Benchmark("Nuts: Singleton Bean with custom factory", LOOP*10){
     
      public void run() throws Exception {
        final Soo foo = (Soo)factory.create();
        foo.noop();
      }
    };
    bench.start(true);
  }
View Full Code Here

  public void testSetterFactory() throws Exception{
    final jfun.yan.factory.Factory factory = yan.getFactory("soo");
     Benchmark bench = new Benchmark("Nuts: Setter Injection with Factory", LOOP){
     
      public void run() throws Exception {
        final Soo foo = (Soo)factory.create();
        foo.noop();
      }
    };
    bench.start(true);
  }
View Full Code Here

  public void testBenchCreateAsectizedBean() throws Exception{
    if(!spring_involved) return;
    new Benchmark("Nuts: Create aspectized bean", LOOP/10 ){
      private Object old = null;
      public void run() throws Exception {
        final Soo nw = (Soo)yan.getInstance("sooProxy");
        if(old!=null){
          assertNotSame(old, nw);
        }
        old = nw;
      }
View Full Code Here

      public void run() throws Exception {
        factory.getBean("bar");
      }
    }.start(true);
   
    Soo soo = (Soo)factory.getBean("soo");
    assertNotNull(soo.getBar());
  }
View Full Code Here

    new Benchmark("Spring: Create bean with Setter Dependency Injection", LOOP){
      public void run() throws Exception {
        factory.getBean("soo");
      }
    }.start(true);
    Soo soo = (Soo)factory.getBean("soo");
    assertNotNull(soo.getBar());
  }
View Full Code Here

TOP

Related Classes of tests.jfun.yan.benchmark.models.Soo

Copyright © 2018 www.massapicom. 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.