code:     private void doTestRewrite(String config, String request, String expectedURI) throws Exception {
          Tomcat tomcat = getTomcatInstance();
  
          // No file system docBase required
          Context ctx = tomcat.addContext("", null);
  
          RewriteValve rewriteValve = new RewriteValve();
          ctx.getPipeline().addValve(rewriteValve);
  
          rewriteValve.setConfiguration(config);
  
          // Note: URLPatterns should be URL encoded
          //       (http://svn.apache.org/r285186)
          Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
          ctx.addServletMapping("/a/%255A", "snoop");
          ctx.addServletMapping("/c/*", "snoop");
          Tomcat.addServlet(ctx, "default", new DefaultServlet());
          ctx.addServletMapping("/", "default");
  
          tomcat.start();
  
          ByteChunk res = getUrl("http://localhost:" + getPort() + request);
  
          String body = res.toString();
          RequestDescriptor requestDesc = SnoopResult.parse(body);
          String requestURI = requestDesc.getRequestInfo("REQUEST-URI");
          Assert.assertEquals(expectedURI, requestURI);
      }
  