コード例 #1
0
  @Test
  public void test_aspectOnAspect() throws Exception {
    JoinPoint joinPoint = new JoinPoint(CALL_AFTER, HANDLER_JOIN_POINT, "a-handler-id", true);

    aspectManager.addAspect("myaspect", new JoinPoint[] {joinPoint}, MyAspect.class);
    aspectManager.addAspect(
        "aspectOnAspect",
        joinPoint(CALL_AFTER, JoinPoint.ON_ASPECT, "myaspect", true),
        MyAspect.class);

    launcher.run(
        createAspectContext("a-handler-id"),
        new AspectBranchId(joinPoint, "myaspect"),
        new ConnectionPoolMock(new LogString("pool", log)),
        new UserMock());

    log.assertContent(
        "pool.getConnection(), "
            + "myaspect.setUp(), "
            + "transaction.begin(), "
            + "transaction.flush(), "
            + "myaspect.run(), "
            + "transaction.commit(), "
            + "transaction.end(), "
            + "myaspect.cleanUp(), "
            + "trigger-forked-mode-for(aspectOnAspect)");
  }
コード例 #2
0
  @Test
  public void test_initAds() throws Exception {
    adsSecurityManager.init(new SecurityServiceConfig(createDefaultMasterConfigWithAdsValues()));

    log.assertContent(
        "setSecuritServiceClass(AdsSecurityService)",
        "SessionManager.addListener(AdsServiceWrapper)",
        "addGlobalComponent(AdsServiceWrapper)");

    assertEquals(AdsTest.ADSBV_JNLP_URL, adsSecurityManager.getAdsBvJnlpUrl());
  }
コード例 #3
0
  public void test_crossTableListener() throws Exception {
    crossTablePanel.setNotEditableColumns(new String[] {"Scenario"});

    crossTablePanel.addCrossTableListener(new CrossTableListenerMock(log));

    crossTable.editCell(0, 1, "0.25", true);

    assertTrue(
        crossTable.contentEquals(
            new Object[][] {
              {"Scénario 1", "0.25", "0.50"},
              {"Scénario 2", "0.75", "0.75"},
              {"Scénario 3", "1.50", ""}
            }));

    log.assertContent("cellContentsChanged(0, John)");
  }