예제 #1
0
  /**
   * {@link PostConstruct} test.
   *
   * @throws ManagerException
   */
  @Test
  public void postConstructTest() throws ManagerException {
    // saving initial state
    final int currentValue = SampleServiceImpl.getPostConstructedAcount();

    Manager.register(SampleService.class, SampleServiceFactory.class);
    Manager.warmUp();
    Assert.assertEquals(currentValue + 2, SampleServiceImpl.getPostConstructedAcount());
  }
예제 #2
0
 /**
  * Test {@link Manager} warm up if there services with relations to each other in post-construct.
  *
  * @throws ManagerException
  */
 @Test
 public void twoWayRelationsTest() throws ManagerException {
   Manager.register(ServiceOne.class, ServiceOneFactory.class);
   Manager.register(ServiceTwo.class, ServiceTwoFactory.class);
   Manager.warmUp();
 }