Search in sources :

Example 1 with ApplicationStatusHandler

use of com.yahoo.container.handler.observability.ApplicationStatusHandler in project vespa by vespa-engine.

the class ContainerModelBuilderTest method verify_bindings_for_builtin_handlers.

@Test
public void verify_bindings_for_builtin_handlers() throws Exception {
    Element clusterElem = DomBuilderTest.parse("<jdisc id='default' version='1.0' />");
    createModel(root, clusterElem);
    JdiscBindingsConfig config = root.getConfig(JdiscBindingsConfig.class, "default/container.0");
    JdiscBindingsConfig.Handlers defaultRootHandler = config.handlers(BindingsOverviewHandler.class.getName());
    assertThat(defaultRootHandler.serverBindings(), contains("*://*/"));
    JdiscBindingsConfig.Handlers applicationStatusHandler = config.handlers(ApplicationStatusHandler.class.getName());
    assertThat(applicationStatusHandler.serverBindings(), contains("http://*/ApplicationStatus", "https://*/ApplicationStatus"));
    JdiscBindingsConfig.Handlers statisticsRequestHandler = config.handlers(StatisticsRequestHandler.class.getName());
    assertTrue(statisticsRequestHandler.serverBindings(0).startsWith("http://*/statistics"));
    assertTrue(statisticsRequestHandler.serverBindings(1).startsWith("https://*/statistics"));
    JdiscBindingsConfig.Handlers fileRequestHandler = config.handlers(VipStatusHandler.class.getName());
    assertThat(fileRequestHandler.serverBindings(), contains("http://*/status.html", "https://*/status.html"));
}
Also used : Element(org.w3c.dom.Element) BindingsOverviewHandler(com.yahoo.container.usability.BindingsOverviewHandler) VipStatusHandler(com.yahoo.container.handler.VipStatusHandler) ApplicationStatusHandler(com.yahoo.container.handler.observability.ApplicationStatusHandler) JdiscBindingsConfig(com.yahoo.container.jdisc.JdiscBindingsConfig) StatisticsRequestHandler(com.yahoo.container.config.StatisticsRequestHandler) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest) Test(org.junit.Test)

Aggregations

DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 StatisticsRequestHandler (com.yahoo.container.config.StatisticsRequestHandler)1 VipStatusHandler (com.yahoo.container.handler.VipStatusHandler)1 ApplicationStatusHandler (com.yahoo.container.handler.observability.ApplicationStatusHandler)1 JdiscBindingsConfig (com.yahoo.container.jdisc.JdiscBindingsConfig)1 BindingsOverviewHandler (com.yahoo.container.usability.BindingsOverviewHandler)1 Test (org.junit.Test)1 Element (org.w3c.dom.Element)1