in src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverWithVanityBloomFilterTest.java [825:853]
public void testResolveVirtualHostHttp8080() throws Exception {
HttpServletRequest request = new FakeSlingHttpServletRequest(null, "virtual.host.com", 8080, rootPath);
Node virtualhost80 = mapRoot.getNode("map/http").addNode("virtual.host.com.8080", "sling:Mapping");
virtualhost80.setProperty(PROP_REDIRECT_INTERNAL, "/content/virtual");
try {
saveMappings(session);
final Resource res0 = resResolver.resolve(request, "/playground.html");
assertNotNull(res0);
assertEquals("/content/virtual/playground.html", res0.getPath());
final Resource res1 = resResolver.resolve(request, "/playground/en.html");
assertNotNull(res1);
assertEquals("/content/virtual/playground/en.html", res1.getPath());
final String mapped00 = resResolver.map(res0.getPath());
assertEquals("http://virtual.host.com:8080/playground.html", mapped00);
final String mapped01 = resResolver.map(request, res0.getPath());
assertEquals("/playground.html", mapped01);
final String mapped10 = resResolver.map(res1.getPath());
assertEquals("http://virtual.host.com:8080/playground/en.html", mapped10);
final String mapped11 = resResolver.map(request, res1.getPath());
assertEquals("/playground/en.html", mapped11);
} finally {
virtualhost80.remove();
session.save();
}
}