Package org.jibeframework.core.ui

Source Code of org.jibeframework.core.ui.WrapperTest

package org.jibeframework.core.ui;

import java.util.Locale;

import org.jibeframework.core.Context;
import org.jibeframework.core.ui.wrapper.UIConfig;
import org.jibeframework.core.util.JacksonUtil;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WrapperTest {
  protected static Context context;
  private static MockHttpServletRequest request = new MockHttpServletRequest();

  @BeforeClass
  public static void setUp() {
    request.getSession().setAttribute("locale", Locale.ENGLISH);
    request.setParameter("_conversationID", "ttt");
    context = new Context();
    context.setServletRequest(request);
    context.setHttpSession(request.getSession());
    context.getParams().put("_conversationID", "ttt");
    RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
  }

  @Test
  public void test() {
    UIConfig c = new UIConfig("coreViewPort");
    System.out.println(JacksonUtil.toJson(c));
  }
}
TOP

Related Classes of org.jibeframework.core.ui.WrapperTest

TOP
Copyright © 2018 www.massapi.com. 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.