Package de.odysseus.calyxo.control.impl

Examples of de.odysseus.calyxo.control.impl.DefaultModule


    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


    params.put(
      "config",
      "/de/odysseus/calyxo/control/calyxo-control-config-empty.xml"
    );
    ServletContext context = new TestServletContext();
    DefaultModule module = createModule(context, "module1", "/module1/*", params);
   
    assertNotNull(I18nSupport.getInstance(module.getContext()));
    assertNotNull(AccessSupport.getInstance(module.getContext()));
    module.destroy();
    assertNull(I18nSupport.getInstance(module.getContext()));
    assertNull(AccessSupport.getInstance(module.getContext()));
  }
View Full Code Here

      "config",
      "/de/odysseus/calyxo/control/calyxo-control-config.xml"
    );
    ServletContext context = new TestServletContext();
    ControlModuleGroup group = ControlModuleGroup.getInstance(context);
    DefaultModule module1 = createModule(context, "module1", "/module1/*", params);
    DefaultModule module2 = createModule(context, "module2", "/module2/*", params);
    group.add((ControlModuleContext)module1.getContext());
    group.add((ControlModuleContext)module2.getContext());
    TestRequest request = new TestRequest(new TestSession(context));
    TestResponse response = new TestResponse();

    module1.process(request, response, "/index");
    assertEquals("/module1/index.jsp", request.getRecentRequestDispatchPath());

    module2.process(request, response, "/index");
    assertEquals("/module2/index.jsp", request.getRecentRequestDispatchPath());

    module1.process(request, response, "/module2");
    assertEquals("/module2/index", request.getRecentRequestDispatchPath());

View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.control.impl.DefaultModule

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.