Package org.springframework.web.context.support

Examples of org.springframework.web.context.support.StaticWebApplicationContext


public class JsfFlowHandlerAdapterTests extends TestCase {

  private JsfFlowHandlerAdapter handlerAdapter;

  protected void setUp() throws Exception {
    StaticWebApplicationContext context = new StaticWebApplicationContext();
    context.setServletContext(new MockServletContext());
    this.handlerAdapter = new JsfFlowHandlerAdapter();
    this.handlerAdapter.setApplicationContext(context);
    this.handlerAdapter.setFlowExecutor(new StubFlowExecutor());
  }
View Full Code Here


  private RequestContext requestContext;
  private FlowExecutionContext flowExecutionContext;

  protected void setUp() throws Exception {
    this.jsfMock.setUp();
    StaticWebApplicationContext webappContext = new StaticWebApplicationContext();
    webappContext.setServletContext(this.jsfMock.servletContext());

    this.requestContext = EasyMock.createMock(RequestContext.class);
    RequestContextHolder.setRequestContext(this.requestContext);
    this.flowExecutionContext = EasyMock.createMock(FlowExecutionContext.class);
View Full Code Here

    ajaxTilesView = new AjaxTilesView();
  }

  private void setupStaticWebApplicationContext() {
    StaticWebApplicationContext wac = new StaticWebApplicationContext();
    wac.setServletContext(servletContext);
    wac.refresh();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
    ajaxTilesView.setApplicationContext(wac);
  }
View Full Code Here

  private final JSFMockHelper jsfMock = new JSFMockHelper();
  private JsfAjaxHandler ajaxHandler;

  protected void setUp() throws Exception {
    this.jsfMock.setUp();
    StaticWebApplicationContext webappContext = new StaticWebApplicationContext();
    webappContext.setServletContext(this.jsfMock.servletContext());
    this.ajaxHandler = new JsfAjaxHandler();
    this.ajaxHandler.setApplicationContext(webappContext);
  }
View Full Code Here

    }
  }

  public void testGetValue_BaseVariable() {
    MockRequestContext requestContext = new MockRequestContext();
    ((Flow) requestContext.getActiveFlow()).setApplicationContext(new StaticWebApplicationContext());
    RequestContextHolder.setRequestContext(requestContext);
    assertTrue(getBaseVariable() + " should resolve to an instance of MessageSource", context.getELResolver()
        .getValue(context, null, getBaseVariable()) instanceof MessageSource);

  }
View Full Code Here

    assertNotNull(actual);
    assertSame(this.requestContext.getFlowScope(), actual);
  }

  public void testFlowResourceResolve() throws Exception {
    ApplicationContext applicationContext = new StaticWebApplicationContext();
    ((Flow) this.requestContext.getActiveFlow()).setApplicationContext(applicationContext);
    Object actual = this.resolver.getValue(this.elContext, null, "resourceBundle");
    assertTrue(this.elContext.isPropertyResolved());
    assertNotNull(actual);
    assertSame(applicationContext, actual);
View Full Code Here

    assertTrue(this.elContext.isPropertyResolved());
    assertEquals("test", actual);
  }

  public void testBeanResolveWithRequestContext() throws Exception {
    StaticWebApplicationContext applicationContext = new StaticWebApplicationContext();
    ((Flow) this.requestContext.getActiveFlow()).setApplicationContext(applicationContext);
    applicationContext.registerSingleton("test", Bean.class);
    Object actual = this.resolver.getValue(this.elContext, null, "test");
    assertTrue(this.elContext.isPropertyResolved());
    assertNotNull(actual);
    assertTrue(actual instanceof Bean);
  }
View Full Code Here

    ajaxTilesView = new AjaxTilesView();
  }

  private void setupStaticWebApplicationContext() {
    StaticWebApplicationContext wac = new StaticWebApplicationContext();
    wac.setServletContext(servletContext);
    wac.refresh();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
    ajaxTilesView.setApplicationContext(wac);
  }
View Full Code Here

  @Test
  public void constructorTest() throws Exception{
    BoostedFlowController controller = new BoostedFlowController();

    StaticWebApplicationContext appContext = new StaticWebApplicationContext();
    String adapterKey = "BoostedFlowHandlerAdapter";
    appContext.registerSingleton(adapterKey, BoostedFlowHandlerAdapter.class);

    /*
    //BoostedFlowHandlerAdapter adapter = new BoostedFlowHandlerAdapter();
 
    
View Full Code Here

* @author Simon Stewart
*/
public class ActionAutowiringInterceptorTest extends XWorkTestCase {

    public void testShouldAutowireAction() throws Exception {
        StaticWebApplicationContext context = new StaticWebApplicationContext();
        context.getBeanFactory().registerSingleton("bean", new TestBean());
        TestBean bean = (TestBean) context.getBean("bean");

        loadSpringApplicationContextIntoApplication(context);

        SimpleAction action = new SimpleAction();
        ActionInvocation invocation = new TestActionInvocation(action);
View Full Code Here

TOP

Related Classes of org.springframework.web.context.support.StaticWebApplicationContext

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.