assertEquals(etag2.toString(), "W/\"foo\"");
}
public static void testRegexTargetResolver() throws Exception {
RegexTargetResolver r = new RegexTargetResolver();
r.setPattern("", TargetType.TYPE_SERVICE);
r.setPattern("/([^/?#]+)", TargetType.TYPE_COLLECTION);
DummyRequestContext drc = null;
Target target = null;
drc = new DummyRequestContext("/test","http://example.org/");
target = r.resolve(drc);
assertNotNull(target);
assertEquals(target.getType(), TargetType.TYPE_SERVICE);
drc = new DummyRequestContext("/test/foo","http://example.org/");
target = r.resolve(drc);
assertNotNull(target);
assertEquals(target.getType(), TargetType.TYPE_COLLECTION);
drc = new DummyRequestContext("/test/foo/","http://example.org/");
target = r.resolve(drc);
assertNull(target);
}