Class RewriteITBase

java.lang.Object
org.ocpsoft.rewrite.test.RewriteITBase
Direct Known Subclasses:
RewriteIT

public abstract class RewriteITBase extends Object
Base utility class for Rewrite Tests.
Author:
Lincoln Baxter, III
  • Field Details

    • client

      protected final okhttp3.OkHttpClient client
  • Constructor Details

    • RewriteITBase

      protected RewriteITBase()
  • Method Details

    • resolveDependencies

      protected static File[] resolveDependencies(String coords)
      Resolve an Archive from Maven coordinates.
    • resolveDependency

      protected static File resolveDependency(String coords)
      Resolve an Archive from Maven coordinates.
    • get

      protected HttpAction get(String path) throws Exception
      Request a resource from the deployed test-application. The HttpServletRequest.getContextPath() will be automatically prepended to the given path.

      E.g: A path of '/example' will be sent as '/rewrite-test/example'

      Throws:
      Exception
    • get

      protected HttpAction get(okhttp3.OkHttpClient client, String path) throws Exception
      Request a resource from the deployed test-application. The HttpServletRequest.getContextPath() will be automatically prepended to the given path.

      E.g: A path of '/example' will be sent as '/rewrite-test/example'

      Throws:
      Exception
    • get

      protected HttpAction get(okhttp3.OkHttpClient client, String path, okhttp3.Headers headers) throws Exception
      Request a resource from the deployed test-application. The HttpServletRequest.getContextPath() will be automatically prepended to the given path.

      E.g: A path of '/example' will be sent as '/rewrite-test/example'

      Throws:
      Exception
    • head

      protected HttpAction head(String path)
      Request a resource from the deployed test-application. The HttpServletRequest.getContextPath() will be automatically prepended to the given path.

      E.g: A path of '/example' will be sent as '/rewrite-test/example'

    • getBaseURL

      protected String getBaseURL()
    • getContextPath

      protected String getContextPath()
    • getWebClient

      protected HtmlAction getWebClient(String path) throws com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException, IOException
      Throws:
      com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException
      IOException
    • assertContains

      protected static void assertContains(String text, String s)
      Verifies that the given text contains the given string.