Пример #1
0
  /** Test que l'inject dependencies renvoit bien l'object envoyé. si celui-ci est déjé advised */
  public void testInjectDependenciesWithAnAdvised() {

    Project basicProject1 = CoreObjectFactory.getProject();

    Project basicProject2 = basicProjectProxyUtil.injectDependencies(basicProject1);

    assertSame(basicProject1, basicProject2);
  }
Пример #2
0
  /** Test que le getTarget renvoit bien la target du proxy quand on envoit un proxy */
  public void testGetTargetWithAnAdvised() {

    Project basicProject = CoreObjectFactory.getProject();

    Project basicProjectTargetReturned = basicProjectProxyUtil.getTarget(basicProject);

    // Project est un proxy, il faut r�cup�rer la target
    TargetSource targetSource = ((Advised) basicProject).getTargetSource();
    Object target = ((SingletonTargetSource) targetSource).getTarget();

    assertEquals(basicProjectTargetReturned, target);
  }