RequestContext request = new MockRequestContext("/");
Set principals = new PrincipalsSet();
principals.add(new RoleImpl("role"));
request.setSubject(JetspeedSubjectFactory.createSubject(new UserImpl("user"), null, null, principals));
request.setLocale(new Locale("en", "US"));
MockHttpServletRequest servletRequest = new MockHttpServletRequest();
servletRequest.setServerName("www.domain.com");
request.setRequest(servletRequest);
try
{
ProfilingRule rule = profiler.getRule("subsite-by-hostname");
assertNotNull(rule);