Package java.util

Examples of java.util.HashMap$EntrySet


    ServletActionContext actionContext = getActionContext();
    ActionConfig actionConfig = newMock(ActionConfig.class);
    ModuleConfig moduleConfig = newMock(ModuleConfig.class);
    ActionServlet servlet = newMock(ActionServlet.class);
    Map applicationScope = newMock(Map.class);
    Map actions = new HashMap();
    Action action = new Action();
   
    expect(actionConfig.getModuleConfig()).andReturn(moduleConfig);
    expect(moduleConfig.getPrefix()).andReturn("prefix");
    expect(actionContext.getApplicationScope()).andReturn(applicationScope);
    expect(applicationScope.get("actionsprefix")).andReturn(actions);
    expect(actionCreator.createAction(String.class)).andReturn(action);
    expect(actionContext.getActionServlet()).andReturn(servlet);

    replayMocks();
    createAction.getAction(actionContext, "java.lang.String", actionConfig);
    verifyMocks();
   
    assertEquals(1, actions.size());
  }
View Full Code Here


  @BeforeMethod
  public void setUp()
  {

    model = new HashMap();
    view = newMock(View.class);
    context = newMock(ActionContext.class);
    request = newMock(HttpServletRequest.class);
    servletContext = newMock(ServletContext.class);
    wac = newMock(WebApplicationContext.class);
View Full Code Here

    {
      result = ((MutableEndpoint)epr).toMap();
    }
    else
    {
      result = new HashMap();
      // todo map access to xml tree
      log.debug("Map access not implemented");
    }
    return result;
  }
View Full Code Here

   *
   * @param expected document count
   */
  public WebRobot(int expectedDocumentCount) {
    log = Category.getInstance(getClass().getName());
    content2UrlMap = new HashMap(expectedDocumentCount);
    registerVisitedList(new HashedMemoryTaskList(false,
          expectedDocumentCount));
    registerToDoList(new HashedMemoryTaskList(true,
          expectedDocumentCount));
    this.expectedDocumentCount = expectedDocumentCount;
View Full Code Here

  @Test
  public void testEmptyMapBindOutwards()
  {

    BindableBean form = new BindableBean();
    Map map = handler.getPropertyAsMap(new HashMap());
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
    targetBean.setDomainClass(new DomainClass(4));
View Full Code Here

  @Test
  public void testEmptyMapBindInwards()
  {

    BindableBean form = new BindableBean();
    form.setLookupMap(new HashMap());

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    form.setSelectedId("1");
View Full Code Here

  @Test
  public void testGetPropertyAsMap()
  {

    BindSelectHandler handler = new BindSelectHandler();
    HashMap hashMap = new HashMap();
    assert hashMap == handler.getPropertyAsMap(hashMap);
  }
View Full Code Here

    if (manager == null) {
      manager = new ServiceManager();
    }

    if (manager.trackers == null) {
      manager.trackers = new HashMap();
    }
    save();
  }
View Full Code Here

        public String getSearchKey() {
          return searchKey;
        }
        public HashMap getConditions() {
          if (site != null) {
            HashMap conds = new HashMap();
            conds.put("site.id", new Integer(site.getId()));
            return conds;
          }
          return null;
        }
 
View Full Code Here

  /**
   * @param bean The instance that has properties named according to JavaBean standard.
   * @return Map<String, Object> that should be considered immutable
   */
  protected Map getBeanProperties(Object bean) {
    HashMap values = new HashMap();
    if (bean == null) return values;
    Method[] m = bean.getClass().getMethods();
   
    Pattern p = Pattern.compile("get([A-Z]\\w+)");
   
    for (int i = 0; i < m.length; i++) {
      if (m[i].getName().equals("getClass")) continue;
      if (m[i].getParameterTypes().length > 0) continue;
      Matcher r = p.matcher(m[i].getName());
      if (r.matches()) {
        try {
          values.put(r.group(1).toLowerCase(), m[i].invoke(bean, new Object[0]));
        } catch (IllegalArgumentException e) {
          throw e;
        } catch (IllegalAccessException e) {
          throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
View Full Code Here

TOP

Related Classes of java.util.HashMap$EntrySet

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.