public void assertRuleMatches(String ruleName,String requestUrl){
  Rule rule=getRule(ruleName);
  MockResponse response=new MockResponse();
  MockRequest request=new MockRequest(requestUrl);
  NormalRewrittenUrl rewrittenUrl=null;
  try {
    rewrittenUrl=(NormalRewrittenUrl)rule.matches(request.getRequestURI(),request,response);
  }
 catch (  IOException e) {
    assertNull("IOException during rule matching " + e.toString(),e);
  }
catch (  ServletException e) {
    assertNull("ServletException during rule matching " + e.toString(),e);
  }
catch (  InvocationTargetException e) {
    assertNull("InvocationTargetException during rule matching " + e.toString(),e);
  }
  assertNotNull("Rule " + ruleName + " does not match",rewrittenUrl);
}

public void assertRuleMatches ( String ruleName , String requestUrl ) { Rule rule = getRule ( ruleName ) ; MockResponse response = new MockResponse ( ) ; MockRequest request = new MockRequest ( requestUrl ) ; NormalRewrittenUrl rewrittenUrl = null ; try { rewrittenUrl = ( NormalRewrittenUrl ) rule . matches ( request . getRequestURI ( ) , request , response ) ; } catch ( IOException e ) { assertNull ( "IOException during rule matching " + e . toString ( ) , e ) ; } catch ( ServletException e ) { assertNull ( "ServletException during rule matching " + e . toString ( ) , e ) ; } catch ( InvocationTargetException e ) { assertNull ( "InvocationTargetException during rule matching " + e . toString ( ) , e ) ; } assertNotNull ( "Rule " + ruleName + " does not match" , rewrittenUrl ) ; }
checks to see if the specified rule name matches the url specified .
