Examples of PrefixingPathContext


Examples of com.foreach.across.modules.web.context.PrefixingPathContext

{
  private MenuItemBuilderProcessor processor;

  @Before
  public void createProcessor() {
    processor = new PrefixContextMenuItemBuilderProcessor( new PrefixingPathContext( "/test" ) );
  }
View Full Code Here

Examples of com.foreach.across.modules.web.context.PrefixingPathContext

public class TestPrefixingPathContext
{
  @Test
  public void cleanedPathPrefix() {
    assertEquals( "/boe", new PrefixingPathContext( "/boe" ).getPathPrefix() );
    assertEquals( "/boe", new PrefixingPathContext( "/boe/" ).getPathPrefix() );
    assertEquals( "/sub/section/page", new PrefixingPathContext( "/sub/section/page" ).getPathPrefix() );
    assertEquals( "/sub/section/page", new PrefixingPathContext( "/sub/section/page/" ).getPathPrefix() );
  }
View Full Code Here

Examples of com.foreach.across.modules.web.context.PrefixingPathContext

    assertEquals( "/sub/section/page", new PrefixingPathContext( "/sub/section/page/" ).getPathPrefix() );
  }

  @Test
  public void rootProperty() {
    assertEquals( "/boe/", new PrefixingPathContext( "/boe" ).getRoot() );
    assertEquals( "/sub/section/page/", new PrefixingPathContext( "/sub/section/page" ).getRoot() );
  }
View Full Code Here

Examples of com.foreach.across.modules.web.context.PrefixingPathContext

    assertEquals( "/sub/section/page/", new PrefixingPathContext( "/sub/section/page" ).getRoot() );
  }

  @Test
  public void pathMethod() {
    PrefixingPathContext ctx = new PrefixingPathContext( "/boe" );

    assertEquals( "/boe/test/path", ctx.path( "test/path" ) );
    assertEquals( "/boe/test/path", ctx.path( "/test/path" ) );
    assertEquals( "http://www.google.be", ctx.path( "http://www.google.be" ) );
    assertEquals( "~/test/path", ctx.path( "~/test/path" ) );
    assertEquals( "redirect:/boe/test/path", ctx.path( "redirect:test/path" ) );
    assertEquals( "redirect:/boe/test/path", ctx.path( "redirect:/test/path" ) );
    assertEquals( "redirect:http://www.google.be", ctx.path( "redirect:http://www.google.be" ) );
    assertEquals( "redirect:~/test/path", ctx.path( "redirect:~/test/path" ) );
    assertEquals( "forward:/boe/test/path", ctx.path( "forward:test/path" ) );
    assertEquals( "forward:/boe/test/path", ctx.path( "forward:/test/path" ) );
    assertEquals( "forward:http://www.google.be", ctx.path( "forward:http://www.google.be" ) );
    assertEquals( "forward:~/test/path", ctx.path( "forward:~/test/path" ) );
  }
View Full Code Here

Examples of com.foreach.across.modules.web.context.PrefixingPathContext

    assertEquals( "forward:~/test/path", ctx.path( "forward:~/test/path" ) );
  }

  @Test
  public void redirectMethod() {
    PrefixingPathContext ctx = new PrefixingPathContext( "/boe" );

    assertEquals( "redirect:/boe/test/path", ctx.redirect( "test/path" ) );
    assertEquals( "redirect:/boe/test/path", ctx.redirect( "/test/path" ) );
    assertEquals( "redirect:http://www.google.be", ctx.redirect( "http://www.google.be" ) );
    assertEquals( "redirect:~/test/path", ctx.redirect( "~/test/path" ) );
    assertEquals( "redirect:/boe/test/path", ctx.redirect( "redirect:test/path" ) );
    assertEquals( "redirect:/boe/test/path", ctx.redirect( "redirect:/test/path" ) );
    assertEquals( "redirect:http://www.google.be", ctx.redirect( "redirect:http://www.google.be" ) );
    assertEquals( "redirect:~/test/path", ctx.redirect( "redirect:~/test/path" ) );

    // Instead of modifying the forward, assume it's what the user want
    assertEquals( "redirect:forward:/boe/test/path", ctx.redirect( "forward:test/path" ) );
    assertEquals( "redirect:forward:/boe/test/path", ctx.redirect( "forward:/test/path" ) );
    assertEquals( "redirect:forward:http://www.google.be", ctx.redirect( "forward:http://www.google.be" ) );
    assertEquals( "redirect:forward:~/test/path", ctx.redirect( "forward:~/test/path" ) );
  }
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.