Examples of MadvocConfig


Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testMethodWithPrefix() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ResultMapper resultMapper = webapp.getComponent(ResultMapper.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.setResultPathPrefix("/WEB-INF");

    String path = "/boo.foo";

    ResultPath resultPath = resultMapper.resolveResultPath(path, "ok");
    assertEquals("/WEB-INF/boo.foo.ok", resultPath.getPathValue());
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  public void testInjection() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();

    PetiteContainer madpc = (PetiteContainer) webapp.getComponent(WebApplication.MADVOC_CONTAINER_NAME);
    MadvocConfig madvocConfig = new MadvocConfig();

    String baseName = FooBean.class.getName();

    madpc.defineParameter("foo", "1");
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testMethodWithPackage() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst.BooAction#foo");
    assertNotNull(cfg);
    assertEquals(BooAction.class, cfg.actionClass);
    assertEquals("/tst/boo.foo.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testClassesWithPackage() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst.Boo1Action#foo");
    assertNotNull(cfg);
    assertEquals(Boo1Action.class, cfg.actionClass);
    assertEquals("/tst/boo1.foo.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testClassesWithoutPackage() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst.Boo3Action#foo");
    assertNotNull(cfg);
    assertEquals(Boo3Action.class, cfg.actionClass);
    assertEquals("/bbb.foo.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testPackage() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst2.Boo4Action#foo");
    assertNotNull(cfg);
    assertEquals(Boo4Action.class, cfg.actionClass);
    assertEquals("/ttt/www.foo.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testNoPackage() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst2.Boo5Action#foo");
    assertNotNull(cfg);
    assertEquals(Boo5Action.class, cfg.actionClass);
    assertEquals("/www.foo.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testEndSlashClassName() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionMethodParser actionMethodParser = webapp.getComponent(ActionMethodParser.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    ActionConfig cfg = parse(actionMethodParser, "tst2.ReAction#hello");
    assertNotNull(cfg);
    assertEquals(ReAction.class, cfg.actionClass);
    assertEquals("/re/hello.html", cfg.actionPath);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testMacros() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    actionsManager.register(ReAction.class, "macro");
    ActionConfig cfg = actionsManager.lookup("/re/user/173/macro.html", "GET");

    assertNotNull(cfg);
View Full Code Here

Examples of jodd.madvoc.component.MadvocConfig

  @Test
  public void testMacrosWildcards() {
    WebApplication webapp = new WebApplication(true);
    webapp.registerMadvocComponents();
    ActionsManager actionsManager = webapp.getComponent(ActionsManager.class);
    MadvocConfig madvocConfig = webapp.getComponent(MadvocConfig.class);
    madvocConfig.getRootPackages().addRootPackageOf(this.getClass());

    actionsManager.register(ReAction.class, "wild1");
    actionsManager.register(ReAction.class, "wild2");

    ActionConfig cfg = actionsManager.lookup("/re/ild123cat", "GET");
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.