Examples of MockServletConfig


Examples of org.apache.tapestry.test.mock.MockServletConfig

        String className = servlet.getAttributeValue("class");
        _servletName = servlet.getAttributeValue("name");

        _servlet = createServlet(className);

        MockServletConfig config = new MockServletConfig(_servletName, _context);

        setInitParameters(servlet, config);

        _servlet.init(config);
    }
View Full Code Here

Examples of org.apache.tapestry.test.mock.MockServletConfig

    {
        ServletDescriptor sd = _scriptDescriptor.getServletDescriptor(name);

        HttpServlet result = instantiateServlet(sd);

        MockServletConfig config = new MockServletConfig(name, _context);

        loadInitParameters(config, sd.getInitParameters());

        try
        {
View Full Code Here

Examples of org.apache.tuscany.binding.jsonrpc.mocks.servlet.MockServletConfig

import org.apache.tuscany.model.assembly.impl.EntryPointImpl;

public class MockConfigUtils {

    public static ServletConfig createMockServletConfig(String entryPointName, Object instance) {
        ServletConfig servletConfig = new MockServletConfig();
        ServletContext context = servletConfig.getServletContext();
        context.setAttribute(TuscanyServletListener.MODULE_COMPONENT_NAME, createModuleWithJSONRPCEntryPoint(entryPointName, instance));
        return servletConfig;
    }
View Full Code Here

Examples of org.eclipse.jgit.http.test.util.MockServletConfig

  }

  public void testDefaultConstructor_NoBasePath() throws Exception {
    GitServlet s = new GitServlet();
    try {
      s.init(new MockServletConfig());
      fail("Init did not crash due to missing parameter");
    } catch (ServletException e) {
      assertTrue(e.getMessage().contains("base-path"));
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.junit.http.MockServletConfig

  @Test
  public void testDefaultConstructor_NoBasePath() throws Exception {
    GitServlet s = new GitServlet();
    try {
      s.init(new MockServletConfig());
      fail("Init did not crash due to missing parameter");
    } catch (ServletException e) {
      assertTrue(e.getMessage().contains("base-path"));
    }
  }
View Full Code Here

Examples of org.nutz.mock.servlet.MockServletConfig

    public static MockServletContext context() {
      return new MockServletContext();
    }

    public static MockServletConfig config(String s) {
      return new MockServletConfig(context(), s);
    }
View Full Code Here

Examples of org.nutz.mock.servlet.MockServletConfig

  protected MockServletConfig servletConfig;

  @Before
  public void init() throws Throwable {
    servletContext = new MockServletContext();
    servletConfig = new MockServletConfig(servletContext, "nutz");
    initServletConfig();
    servlet = new NutServlet();
    servlet.init(servletConfig);

    session = Mock.servlet.session(servletContext);
View Full Code Here

Examples of org.picketlink.test.identity.federation.web.mock.MockServletConfig

        ServletContext servletContext = new MockServletContext();
        session.setServletContext(servletContext);

        IdentityServer server = this.getIdentityServer(session);
        servletContext.setAttribute("IDENTITY_SERVER", server);
        MockServletConfig servletConfig = new MockServletConfig(servletContext);

        IDPServlet idp = new IDPServlet();
        // No signing outgoing messages
        servletConfig.addInitParameter(GeneralConstants.SIGN_OUTGOING_MESSAGES, "false");

        // Initialize the servlet
        idp.init(servletConfig);

        // Assume that we already have the principal and roles set in the session
View Full Code Here

Examples of org.springframework.mock.web.MockServletConfig

    ServletServiceAdapterComponent comp =
      (ServletServiceAdapterComponent)initedAdapters.get(configFile);
   
    if (comp == null) {
      servlet.setConfFile(configFile);
      servlet.init(new MockServletConfig(new MockServletContext()));
     
      initedAdapters.put(configFile, comp);
     
      return servlet.getBuiltComponent();
    }
View Full Code Here

Examples of org.springframework.mock.web.MockServletConfig

        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:org/springmodules/web/tapestry/applicationContext.xml");
        ContextLoader contextLoader = new ContextLoader();
        contextLoader.initWebApplicationContext(servletContext);

        MockServletConfig servletConfig = new MockServletConfig(servletContext, "servlet");
        ApplicationServlet servlet = new ApplicationServlet();
        servlet.init(servletConfig);

        Registry hiveMindRegistry = (Registry) servletContext.getAttribute("org.apache.tapestry.Registry:servlet");
        assertNotNull("HiveMind registry is not available in servlet context", hiveMindRegistry);
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.