Package jodd.petite.tst

Examples of jodd.petite.tst.Foo


    assertEquals(3, pc.getTotalBeans());
    assertEquals(2, pc.getTotalScopes());

    final Boo boo = (Boo) pc.getBean("boo");
    final Foo foo = (Foo) pc.getBean("foo");
    assertSame(boo.getFoo(), foo);


    final Semaphore sem = new Semaphore(1);
    sem.acquire();

    Thread thread = new Thread() {
      @Override
      public void run() {
        Boo boo2 = (Boo) pc.getBean("boo");
        Foo foo2 = (Foo) pc.getBean("foo");
        assertSame(foo2, foo);
        assertNotSame(boo2, boo);
        assertSame(foo2, boo2.getFoo());
        sem.release();
      }
View Full Code Here


    PetiteContainer pc = new PetiteContainer();
    pc.registerPetiteBean(Foo.class, null, null, null, false);

    pc.defineParameter("foo.name", "FOONAME");

    Foo foo = (Foo) pc.getBean("foo");
    assertNotNull(foo);
    assertEquals("FOONAME", foo.getName());
  }
View Full Code Here

    pc.defineParameter("foo.name", "$${name}");
    pc.defineParameter("name", "${name${num}}");
    pc.defineParameter("num", "2");
    pc.defineParameter("name2", "FOONAME");

    Foo foo = (Foo) pc.getBean("foo");
    assertNotNull(foo);
    assertEquals("$FOONAME", foo.getName());
  }
View Full Code Here

    PetiteContainer pc = new PetiteContainer();
    pc.registerPetiteBean(Foo.class, null, null, null, false);

    pc.defineParameter("foo.name", "\\${name}");

    Foo foo = (Foo) pc.getBean("foo");
    assertNotNull(foo);
    assertEquals("${name}", foo.getName());
  }
View Full Code Here

    pc.defineParameter("foo.name", "${name}");
    pc.defineParameter("name", "${name2}");
    pc.defineParameter("name2", "FOONAME");

    Foo foo = (Foo) pc.getBean("foo");
    assertNotNull(foo);
    assertEquals("${name}", foo.getName());
  }
View Full Code Here

    p.setProperty("foo.name", "${name}");
    p.setProperty("name", "${name2}");
    p.setProperty("name2", "FOONAME");
    pc.defineParameters(p);

    Foo foo = (Foo) pc.getBean("foo");
    assertNotNull(foo);
    assertEquals("FOONAME", foo.getName());
  }
View Full Code Here


  @Test
  public void testAdd() {
    PetiteContainer pc = new PetiteContainer();
    Foo foo = new Foo();
    pc.addBean("foo", foo);
    Foo foo2 = (Foo) pc.getBean("foo");
    assertNotNull(foo2);
    assertSame(foo, foo2);
  }
View Full Code Here

    Foo.instanceCounter = 0;
    PetiteContainer pc = new PetiteContainer();
    pc.registerPetiteBean(Foo.class, null, null, null, false);
    pc.registerPetiteBean(Zoo.class, null, null, null, false);

    Foo foo = (Foo) pc.getBean("foo");
    Boo boo = new Boo();
    assertNull(boo.getFoo());

    pc.addBean("boo", boo, null);
    assertNotNull(boo.getFoo());
View Full Code Here

    pc.registerPetiteBean(Foo.class, null, null, null, false);
    pc.registerPetiteBean(Zoo.class, null, null, null, false);
    pc.registerPetiteBean(Boo.class, null, null, null, false);

    Boo boo = (Boo) pc.getBean("boo");
    Foo foo = (Foo) pc.getBean("foo");
    Zoo zoo = (Zoo) pc.getBean("zoo");

    assertNotNull(boo.getFoo());
    assertSame(foo, boo.getFoo());
View Full Code Here

TOP

Related Classes of jodd.petite.tst.Foo

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.