Examples of registerSingleton()


Examples of org.springframework.web.context.support.StaticWebApplicationContext.registerSingleton()

    public void testHandler()
            throws Exception
    {
        StaticWebApplicationContext appContext = new StaticWebApplicationContext();
        appContext.registerSingleton("echo", EchoImpl.class, new MutablePropertyValues());

        webAnnotations.hasWebServiceAnnotation(EchoImpl.class);
        control.setReturnValue(true);
        webAnnotations.hasHandlerChainAnnotation(EchoImpl.class);
        control.setReturnValue(false);
View Full Code Here

Examples of org.springframework.web.context.support.StaticWebApplicationContext.registerSingleton()

    public void testNoAnnotation()
            throws Exception
    {
        StaticWebApplicationContext appContext = new StaticWebApplicationContext();
        appContext.registerSingleton("echo", EchoImpl.class, new MutablePropertyValues());

        webAnnotations.hasWebServiceAnnotation(EchoImpl.class);
        control.setReturnValue(false);

        control.replay();
View Full Code Here

Examples of org.springframework.web.context.support.StaticWebApplicationContext.registerSingleton()

    @Before
    public void setUp() throws Exception {
        SecurityContextHolder.getContext().setAuthentication(currentUser);
        StaticWebApplicationContext ctx = new StaticWebApplicationContext();
        ctx.registerSingleton("expressionHandler", DefaultWebSecurityExpressionHandler.class);
        ctx.registerSingleton("wipe", MockWebInvocationPrivilegeEvaluator.class);
        MockServletContext servletCtx = new MockServletContext();
        servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);
        authorizeTag = new JspAuthorizeTag();
        authorizeTag.setPageContext(new MockPageContext(servletCtx, request, new MockHttpServletResponse()));
View Full Code Here

Examples of org.springframework.web.context.support.StaticWebApplicationContext.registerSingleton()

    @Before
    public void setUp() throws Exception {
        SecurityContextHolder.getContext().setAuthentication(currentUser);
        StaticWebApplicationContext ctx = new StaticWebApplicationContext();
        ctx.registerSingleton("expressionHandler", DefaultWebSecurityExpressionHandler.class);
        ctx.registerSingleton("wipe", MockWebInvocationPrivilegeEvaluator.class);
        MockServletContext servletCtx = new MockServletContext();
        servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);
        authorizeTag = new JspAuthorizeTag();
        authorizeTag.setPageContext(new MockPageContext(servletCtx, request, new MockHttpServletResponse()));
    }
View Full Code Here

Examples of org.springframework.web.context.support.StaticWebApplicationContext.registerSingleton()

        MockServletContext servletContext = new MockServletContext();
        servletContext.setAttribute(StaticWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);

        context.setServletContext(servletContext);
        context.registerSingleton("listener", MockApplicationListener.class, null);
        context.refresh();

        MockHttpSession session = new MockHttpSession(servletContext);
        MockApplicationListener listener = (MockApplicationListener) context.getBean("listener");
View Full Code Here

Examples of org.springframework.web.portlet.context.StaticPortletApplicationContext.registerSingleton()

      @Override
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        // The order of handler registration is important to get
        // the collection with [Render,Action,Render] predicates
        wac.registerSingleton("firstController", FirstController.class);
        wac.registerSingleton("secondController", SecondController.class);
        wac.registerSingleton("thirdController", ThirdController.class);
        wac.registerSingleton("handlerMapping", DefaultAnnotationHandlerMapping.class);
        wac.registerSingleton("handlerAdapter", AnnotationMethodHandlerAdapter.class);
        wac.setPortletContext(new MockPortletContext());
View Full Code Here
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.