Examples of Small


Examples of jodd.petite.mix.Small

    pc.registerPetiteBean(Big.class, "big", SingletonScope.class, null, false);
    pc.registerPetiteBean(Small.class, "small", ProtoScope.class, null, false);

    Big big = (Big) pc.getBean("big");

    Small small1 = big.getSmall();
    Small small2 = big.getSmall();

    assertSame(small1, small2);        // factory !!!

    assertEquals(1, Small.instanceCounter);

    assertEquals("small 2", small1.name())// calling any method of small will create a new (target) instance of 'small'

    assertEquals("small 3", small2.name());

    assertEquals(3, Small.instanceCounter);

    assertFalse(small1.toString().equals(small2.toString()));

    assertEquals(5, Small.instanceCounter);
  }
View Full Code Here

Examples of jodd.petite.mix.Small

    pc.registerPetiteBean(Big2.class, "big", SingletonScope.class, null, false);
    pc.registerPetiteBean(Small.class, "small", ProtoScope.class, null, false);

    Big2 big = (Big2) pc.getBean("big");

    Small small1 = big.getSmall();
    Small small2 = big.getSmall();

    assertSame(small1, small2);        // factory !!!

    assertEquals(1, Small.instanceCounter);

    assertEquals("small 2", small1.name())// calling any method of small will create a new (target) instance of 'small'

    assertEquals("small 3", small2.name());

    assertEquals(3, Small.instanceCounter);

    assertFalse(small1.toString().equals(small2.toString()));

    assertEquals(5, Small.instanceCounter);
  }
View Full Code Here

Examples of jodd.petite.mix.Small

    pc.registerPetiteBean(Big.class, "big2", SingletonScope.class, null, false);
    pc.registerPetiteBean(Small.class, "small", ProtoScope.class, null, false);

    Big big = (Big) pc.getBean("big");

    Small small1 = big.getSmall();
    Small small2 = big.getSmall();

    assertSame(small1, small2);        // factory !!!

    assertEquals(1, Small.instanceCounter);

    Big big2 = (Big) pc.getBean("big2");

    Small small3 = big2.getSmall();
    Small small4 = big2.getSmall();

    assertSame(small3, small4);        // factory !!!

    assertSame(small1, small4);
  }
View Full Code Here

Examples of jodd.petite.mix.Small

    pc.registerPetiteBean(Big.class, "big", SingletonScope.class, null, false);
    pc.registerPetiteBean(Small.class, "small", ThreadLocalScope.class, null, false);

    final Big big = (Big) pc.getBean("big");

    Small small1 = big.getSmall();
    Small small2 = big.getSmall();

    assertSame(small1, small2);

    // one 'small' instance is created for the factory wrapper.
    assertEquals(1, Small.instanceCounter);

    // on next small method call, new 'small' instance will be created,
    // from the  ThreadLocal scope factory
    assertEquals("small 2", small1.name());

    // no 'small' instance will be created, the same instance from above will be used
    assertEquals("small 2", small2.name());

    // create new thread
    Thread thread = new Thread() {
      @Override
      public void run() {
        Small small3 = big.getSmall();

        assertEquals(2, Small.instanceCounter);

        assertEquals("small 3", small3.name());
        assertEquals("small 3", small3.name());

        assertEquals(3, Small.instanceCounter);

      }
    };
View Full Code Here

Examples of org.boris.expr.function.excel.SMALL

        SLOPE s = new SLOPE();
        fail("SLOPE not implemented");
    }

    public void testSMALL() throws Exception {
        SMALL s = new SMALL();
        fail("SMALL not implemented");
    }
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.