use of com.yahoo.jdisc.test.NonWorkingRequestHandler in project vespa by vespa-engine.
the class BindingSetTestCase method requireThatTreeSplitCanBeBoundForSchemes.
@Test
public void requireThatTreeSplitCanBeBoundForSchemes() {
Map<UriPattern, RequestHandler> handlers = new LinkedHashMap<>();
RequestHandler httpfoo = new NonWorkingRequestHandler();
RequestHandler httpsfoo = new NonWorkingRequestHandler();
RequestHandler ftpfoo = new NonWorkingRequestHandler();
handlers.put(new UriPattern("http://host/foo"), httpfoo);
handlers.put(new UriPattern("https://host/foo"), httpsfoo);
handlers.put(new UriPattern("ftp://host/foo"), ftpfoo);
BindingSet<RequestHandler> bindings = new BindingSet<>(handlers.entrySet());
assertNotNull(bindings);
}
use of com.yahoo.jdisc.test.NonWorkingRequestHandler in project vespa by vespa-engine.
the class BindingSetTestCase method requireThatTreeSplitCanBeBoundForHosts.
@Test
public void requireThatTreeSplitCanBeBoundForHosts() {
Map<UriPattern, RequestHandler> handlers = new LinkedHashMap<>();
RequestHandler foo = new NonWorkingRequestHandler();
RequestHandler foobar = new NonWorkingRequestHandler();
RequestHandler fooqux = new NonWorkingRequestHandler();
handlers.put(new UriPattern("http://hostabc/foo"), foobar);
handlers.put(new UriPattern("http://hostpqr/foo"), fooqux);
handlers.put(new UriPattern("http://host/foo"), foo);
BindingSet<RequestHandler> bindings = new BindingSet<>(handlers.entrySet());
assertNotNull(bindings);
}
use of com.yahoo.jdisc.test.NonWorkingRequestHandler in project vespa by vespa-engine.
the class BindingSetTestCase method requireThatPathOverPortWorks.
@Test
public void requireThatPathOverPortWorks() {
Map<UriPattern, RequestHandler> handlers = new LinkedHashMap<>();
RequestHandler applicationStatus = new NonWorkingRequestHandler();
RequestHandler search = new NonWorkingRequestHandler();
RequestHandler legacy = new NonWorkingRequestHandler();
handlers.put(new UriPattern("http://*/processing/*"), new NonWorkingRequestHandler());
handlers.put(new UriPattern("http://*/statistics/*"), new NonWorkingRequestHandler());
handlers.put(new UriPattern("http://*/state/v1/*"), new NonWorkingRequestHandler());
handlers.put(new UriPattern("http://*/search/*"), search);
handlers.put(new UriPattern("http://*/status.html"), new NonWorkingRequestHandler());
handlers.put(new UriPattern("http://*/ApplicationStatus"), applicationStatus);
handlers.put(new UriPattern("http://*:" + getDefaults().vespaWebServicePort() + "/*"), legacy);
BindingSet<RequestHandler> bindings = new BindingSet<>(handlers.entrySet());
assertNotNull(bindings);
assertSame(applicationStatus, bindings.resolve(URI.create("http://abcxyz.yahoo.com:" + getDefaults().vespaWebServicePort() + "/ApplicationStatus")));
assertSame(search, bindings.resolve(URI.create("http://abcxyz.yahoo.com:" + getDefaults().vespaWebServicePort() + "/search/?query=sddocname:music")));
assertSame(legacy, bindings.resolve(URI.create("http://abcxyz.yahoo.com:" + getDefaults().vespaWebServicePort() + "/stats/?query=stat:query")));
}
Aggregations