@Test
  public void containsKey() {
    assertTrue(context.containsKey("pull1"));
    assertTrue(context.containsKey("pull2"));
    assertTrue(context.containsKey("parent"));
    assertTrue(context.containsKey("child"));

    assertFalse(context.containsKey("other"));
  }
  @Test
  public void create_no_pullContext() {
    context = new PullableMappedContext(null);

    context.put("aaa", 111);

    assertTrue(context.containsKey("aaa"));
    assertEquals(111, context.get("aaa"));

    assertFalse(context.containsKey("bbb"));
    assertNull(context.get("bbb"));
  }
Exemple #3
0
  public void execute(HttpSession session, Context context, CookieParser parser) {

    User user = (User) session.getAttribute(WebConstants.CURRENT_USER_KEY);
    if (user != null) context.put("operator", user.getUsername());

    RootContextPath rootContextPath = new RootContextPath(request.getContextPath());
    context.put("rootContextPath", rootContextPath);
    if (!context.containsKey("bucLogoutAddress")) {
      context.put("bucLogoutAddress", rootContextPath.getURI("logout"));
    }
    if (!context.containsKey("helpUrl")) {
      context.put("helpUrl", "http://code.alibabatech.com/wiki/display/dubbo");
    }
    context.put(WebConstants.CURRENT_USER_KEY, user);
    context.put("language", parser.getString("locale"));
    context.put("registryServerSync", registryServerSync);
  }