Package de.odysseus.calyxo.control.base

Examples of de.odysseus.calyxo.control.base.ControlModuleMapping


    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());

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


    }
  }

  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"));
    context.setFilterClass("foo", CancelFilter.class);
View Full Code Here

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

  public void testPattern() throws ConfigException {
    ControlModuleMapping mapping = null;

    mapping = new ControlModuleMapping("/test/*");
    assertEquals("/test", mapping.getPrefix());
    assertNull(mapping.getExtension());

    mapping = new ControlModuleMapping("*.test");
    assertEquals(".test", mapping.getExtension());
    assertNull(mapping.getPrefix());

    mapping = new ControlModuleMapping("/");
    assertEquals("", mapping.getPrefix());
    assertNull(mapping.getExtension());   

    mapping = new ControlModuleMapping("/*");
    assertEquals("", mapping.getPrefix());
    assertNull(mapping.getExtension());       
  }
View Full Code Here

    assertEquals("", mapping.getPrefix());
    assertNull(mapping.getExtension());       
  }

  public void testEmptyPrefixPath() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping("", null);
    assertEquals("/action", mapping.getPath("/action"));
  }
View Full Code Here

    ControlModuleMapping mapping = new ControlModuleMapping("", null);
    assertEquals("/action", mapping.getPath("/action"));
  }

  public void testPrefixPath() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping("/test", null);
    assertEquals("/test/action", mapping.getPath("/action"));
    assertEquals("/test/action", mapping.getPath("action"));
    assertEquals("/test/action?foo=bar", mapping.getPath("/action?foo=bar"));
  }
View Full Code Here

    assertEquals("/test/action", mapping.getPath("action"));
    assertEquals("/test/action?foo=bar", mapping.getPath("/action?foo=bar"));
  }

  public void testPrefixAction() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping("/test", null);
    TestRequest request = new TestRequest();
    request.setAttribute(INCLUDE_SERVLET_PATH, "/test");
    request.setAttribute(INCLUDE_PATH_INFO, "/action");
    assertEquals("/action", mapping.getAction(request));
  }
View Full Code Here

    request.setAttribute(INCLUDE_PATH_INFO, "/action");
    assertEquals("/action", mapping.getAction(request));
  }

  public void testExtensionPath() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping(null, ".test");
    assertEquals("/action.test", mapping.getPath("/action"));
    assertEquals("/action.test", mapping.getPath("action"));
    assertEquals("/action.test?foo=bar", mapping.getPath("/action?foo=bar"));
  }
View Full Code Here

    assertEquals("/action.test", mapping.getPath("action"));
    assertEquals("/action.test?foo=bar", mapping.getPath("/action?foo=bar"));
  }

  public void testExtensionAction() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping(null, ".test");
    TestRequest request = new TestRequest();
    request.setAttribute(INCLUDE_SERVLET_PATH, "/action.test");
    request.removeAttribute(INCLUDE_PATH_INFO);
    assertEquals("/action", mapping.getAction(request));
  }
View Full Code Here

    request.removeAttribute(INCLUDE_PATH_INFO);
    assertEquals("/action", mapping.getAction(request));
  }

  public void testPrefixExtensionAction() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping("/test", ".do");
    TestRequest request = new TestRequest();
    request.setAttribute(INCLUDE_SERVLET_PATH, "/test/action.do");
    request.removeAttribute(INCLUDE_PATH_INFO);
    assertEquals("/action", mapping.getAction(request));
  }
View Full Code Here

    request.removeAttribute(INCLUDE_PATH_INFO);
    assertEquals("/action", mapping.getAction(request));
  }

  public void testPrefixExtensionPath() throws ConfigException {
    ControlModuleMapping mapping = new ControlModuleMapping("/test", ".do");
    assertEquals("/test/action.do", mapping.getPath("/action"));
    assertEquals("/test/action.do", mapping.getPath("action"));
    assertEquals("/test/action.do?foo=bar", mapping.getPath("/action?foo=bar"));
  }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.control.base.ControlModuleMapping

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.