Package net.sourceforge.urlrewriter4j.core

Examples of net.sourceforge.urlrewriter4j.core.RewriterEngine


    RewriterConfiguration oConfig = getConfig();
    oConfig.getRules().add(new AddHeaderAction("MyHeader", "header"));

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfig);
    oEngine.rewrite(oMockFacade);

    oMockFacade.expectStatusCode(200);
    oMockFacade.expectHeaderSet("MyHeader", "header");
    oMockFacade.expectLocation("/test.aspx");
  }
View Full Code Here


    RewriterConfiguration oConfig = getConfig();
    oConfig.getRules().add(new ForbiddenAction());

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfig);
    try {
      oEngine.rewrite(oMockFacade);
      fail();
    } catch (RewriteException pRE) {

    }
View Full Code Here

    oConfiguration.getRules().add(new GoneAction());

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    try {
      oEngine.rewrite(oMockFacade);
      fail();
    } catch (RewriteException e) {
    }

    oMockFacade.expectStatusCode(410);
View Full Code Here

    oConfiguration.getRules().add(new MethodNotAllowedAction());

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    try {
      oEngine.rewrite(oMockFacade);
      fail();
    } catch (RewriteException e) {
    }

    oMockFacade.expectStatusCode(405);
View Full Code Here

    oConfiguration.getRules().add(new NotFoundAction());

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    try {
      oEngine.rewrite(oMockFacade);
      fail();
    } catch (RewriteException e) {
    }

    oMockFacade.expectStatusCode(404);
View Full Code Here

    oConfiguration.getRules().add(new NotImplementedAction());

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    try {
      oEngine.rewrite(oMockFacade);
      fail();
    } catch (RewriteException e) {
    }

    oMockFacade.expectStatusCode(501);
View Full Code Here

    oConfiguration.getRules().add(new RedirectAction("/foo.aspx", true));

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    oEngine.rewrite(oMockFacade);

    oMockFacade.expectStatusCode(301);
    oMockFacade.expectRedirectLocation("/foo.aspx");
  }
View Full Code Here

    oConfiguration.getRules().add(new RedirectAction("/foo.aspx", false));

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    oEngine.rewrite(oMockFacade);

    oMockFacade.expectStatusCode(302);
    oMockFacade.expectRedirectLocation("/foo.aspx");
  }
View Full Code Here

    oConfiguration.getRules().add(
        new RewriteAction("/foo2.aspx", RewriteProcessing.StopProcessing));

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    oEngine.rewrite(oMockFacade);

    oMockFacade.expectStatusCode(200);
    oMockFacade.expectLocation("/foo.aspx");
  }
View Full Code Here

            new RewriteAction("/foo.aspx",
                RewriteProcessing.ContinueProcessing));

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
        "GET", new URL("http://localhost/test.aspx"));
    RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    oEngine.rewrite(oMockFacade);

    oMockFacade.expectStatusCode(200);
    oMockFacade.expectLocation("/foo.aspx");
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.urlrewriter4j.core.RewriterEngine

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.