Examples of ConditionalAction


Examples of net.sourceforge.urlrewriter4j.core.actions.ConditionalAction

    mEngine.rewrite(oMockFacade);
    oMockFacade.expectLocation("/rewritten-1234.html");
  }
 
  public void testReduceWithQueryStringAndNonEmptyDefaultValue() throws Exception {
    ConditionalAction oAction = createUrlConditionAndRewirteAction("/rewritten-$(myLocation:1111).html", "/test.aspx.*");
    mConfiguration.getRules().add(oAction);
   
    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx?location=1234"));
    mEngine.rewrite(oMockFacade);
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.actions.ConditionalAction

    mEngine.rewrite(oMockFacade);
    oMockFacade.expectLocation("/rewritten-1111.html");
  }
 
  public void testReduceWithQueryStringAndEmptyDefaultValue() throws Exception {
    ConditionalAction oAction = createUrlConditionAndRewirteAction("/rewritten-$(myLocation).html", "/test.aspx.*");
    mConfiguration.getRules().add(oAction);
   
    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx?location=1234"));
    mEngine.rewrite(oMockFacade);
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.actions.ConditionalAction

 
  public void testReduceMapAndQueryStringParam() throws Exception {
    StaticMappingTransform oMapTx = createCategoryTransformation();
    mConfiguration.getTransformFactory().addTransform(oMapTx);
   
    ConditionalAction oAction = createUrlConditionAndRewirteAction("/rewritten-${catMap:$(category)}.html", "/test.aspx.*");
    mConfiguration.getRules().add(oAction);
   
    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx?category=electronics"));
    mEngine.rewrite(oMockFacade);
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.actions.ConditionalAction

 
  public void testReduceMapWithDefaultAndQueryStringParam() throws Exception {
    StaticMappingTransform oMapTx = createCategoryTransformation();
    mConfiguration.getTransformFactory().addTransform(oMapTx);
   
    ConditionalAction oAction = createUrlConditionAndRewirteAction("/rewritten-${catMap:$(category)|DVD}.html", "/test.aspx.*");
    mConfiguration.getRules().add(oAction);
   
    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    mEngine.rewrite(oMockFacade);
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.actions.ConditionalAction

    oMockFacade.expectLocation("/rewritten-DVD.html");
  }

  private ConditionalAction createUrlConditionAndRewirteAction(String pRewriteLocation, String pUrlPattern) {
    RewriteAction oRewriteAction = new RewriteAction(pRewriteLocation, RewriteProcessing.StopProcessing);
    ConditionalAction oAction = new ConditionalAction();
    oAction.getConditions().add(new UrlMatchCondition(pUrlPattern));
    oAction.getActions().add(oRewriteAction);
    return oAction;
  }
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.