Package de.odysseus.calyxo.base.test

Examples of de.odysseus.calyxo.base.test.TestServletConfig


  public PluginContextTest(String arg0) {
    super(arg0);
  }

  public void testDispatcher() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);
    PluginContext context = new PluginContext(module, DefaultAction.class, new DefaultDispatcher(module));
    DefaultDispatcher dispatcher = new DefaultDispatcher(context.getModuleContext());

View Full Code Here


    } catch (Exception e) {
    }
  }

  public void testFilterClass() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);
    PluginContext context = new PluginContext(module, DefaultAction.class, new DefaultDispatcher(module));

    assertNull(context.getFilterClass("foo"));
View Full Code Here

    HashMap params = new HashMap();
    params.put(
      "config",
      "/de/odysseus/calyxo/control/calyxo-control-config-empty.xml"
    );
    TestServletConfig config = new TestServletConfig("test", params);
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");

    ServletContext context = config.getServletContext();
    ControlModuleGroup group = ControlModuleGroup.getInstance(context);
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);
    assertTrue(group.isEmpty());
    group.add(module);
    assertFalse(group.isEmpty());
View Full Code Here

  public ControlModuleContextTest(String arg0) {
    super(arg0);
  }

  public void testBasics() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext context = new ControlModuleContext(config, mapping, null);
   
    assertSame("test", context.getName());
    assertSame(config.getServletContext(), context.getServletContext());
    assertEquals("/test/action", context.getPath("/action"));
  }
View Full Code Here

    assertSame(config.getServletContext(), context.getServletContext());
    assertEquals("/test/action", context.getPath("/action"));
  }

  public void testModuleAttributes() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext context = new ControlModuleContext(config, mapping, null);

    assertNull(context.getAttribute("foo"));
    context.setAttribute("foo", "bar");
View Full Code Here

  }

  public void testInitParams() throws ConfigException {
    HashMap params = new HashMap();
    params.put("foo", "bar");
    TestServletConfig config = new TestServletConfig("test", params);
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);

    assertNull(module.getInitParameter("bar"));
    assertSame("bar", module.getInitParameter("foo"));
View Full Code Here

  public DefaultModuleTest(String arg0) {
    super(arg0);
  }

  private DefaultModule createModule(ServletContext context, String name, String pattern, Map params) throws ConfigException, ServletException {
    TestServletConfig config = new TestServletConfig(name, context, params);
    DefaultModule module = new DefaultModule();
    module.init(new ControlModuleContext(config, new ControlModuleMapping(pattern), null));
    return module;
  }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.test.TestServletConfig

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.