use of com.yahoo.container.ComponentsConfig in project vespa by vespa-engine.
the class MultipleRestApisTest method jersey_bundles_component_for_each_rest_api_is_included_in_components_config.
@Test
public void jersey_bundles_component_for_each_rest_api_is_included_in_components_config() {
ComponentsConfig config = root.getConfig(ComponentsConfig.class, CLUSTER_ID);
assertThat(config.toString(), containsString(".id \"" + REST_API_CONTEXT_ID_1 + "\""));
assertThat(config.toString(), containsString(".id \"" + REST_API_CONTEXT_ID_2 + "\""));
}
use of com.yahoo.container.ComponentsConfig in project vespa by vespa-engine.
the class ContainerModelBuilderTest method default_root_handler_is_disabled_when_user_adds_a_handler_with_same_binding.
@Test
public void default_root_handler_is_disabled_when_user_adds_a_handler_with_same_binding() throws Exception {
Element clusterElem = DomBuilderTest.parse("<jdisc id='default' version='1.0'>" + " <handler id='userRootHandler'>" + " <binding>" + ContainerCluster.ROOT_HANDLER_BINDING + "</binding>" + " </handler>" + "</jdisc>");
createModel(root, clusterElem);
ComponentsConfig.Components userRootHandler = getComponent(componentsConfig(), BindingsOverviewHandler.class.getName());
assertThat(userRootHandler, nullValue());
}
use of com.yahoo.container.ComponentsConfig in project vespa by vespa-engine.
the class RestApiTest method restApiContext_is_included_in_components_config.
@Test
public void restApiContext_is_included_in_components_config() throws Exception {
setup();
ComponentsConfig config = root.getConfig(ComponentsConfig.class, ClusterId);
assertThat(config.toString(), containsString(".id \"" + RestApiContextId + "\""));
}
use of com.yahoo.container.ComponentsConfig in project vespa by vespa-engine.
the class DocprocBuilderTest method setupCluster.
@Before
public void setupCluster() {
ContainerModel model = new ContainerModelBuilder(false, Networking.disable).build(DeployState.createTestState(), null, root, servicesXml());
cluster = model.getCluster();
cluster.getDocproc().getChains().addServersAndClientsForChains();
root.freezeModelTopology();
containerMbusConfig = root.getConfig(ContainerMbusConfig.class, cluster.getContainers().get(0).getConfigId());
componentsConfig = root.getConfig(ComponentsConfig.class, cluster.getConfigId());
chainsConfig = root.getConfig(ChainsConfig.class, cluster.getConfigId() + "/component/com.yahoo.docproc.jdisc.DocumentProcessingHandler");
documentmanagerConfig = root.getConfig(DocumentmanagerConfig.class, cluster.getConfigId());
bundlesConfig = root.getConfig(BundlesConfig.class, cluster.getConfigId());
schemamappingConfig = root.getConfig(SchemamappingConfig.class, cluster.getContainers().get(0).getConfigId());
qrStartConfig = root.getConfig(QrStartConfig.class, cluster.getConfigId());
docprocConfig = root.getConfig(DocprocConfig.class, cluster.getConfigId());
}
use of com.yahoo.container.ComponentsConfig in project vespa by vespa-engine.
the class RestApiTest method all_non_restApi_components_are_injected_to_RestApiContext.
@Test
public void all_non_restApi_components_are_injected_to_RestApiContext() throws Exception {
setup();
ComponentsConfig componentsConfig = root.getConfig(ComponentsConfig.class, ClusterId);
Set<ComponentId> clusterChildrenComponentIds = getContainerCluster(ClusterId).getAllComponents().stream().map(Component::getComponentId).collect(Collectors.toSet());
Set<ComponentId> restApiChildrenComponentIds = restApi.getChildren().values().stream().map(child -> ((Component<?, ?>) child).getComponentId()).collect(Collectors.toSet());
// TODO: Review: replace with filtering against RestApiContext.isCycleGeneratingComponent
ComponentId cycleInducingComponents = ComponentId.fromString("com.yahoo.container.handler.observability.ApplicationStatusHandler");
Set<ComponentId> expectedInjectedConfigIds = new HashSet<>(clusterChildrenComponentIds);
expectedInjectedConfigIds.removeAll(restApiChildrenComponentIds);
expectedInjectedConfigIds.remove(cycleInducingComponents);
Set<ComponentId> injectedConfigIds = restApiContextConfig(componentsConfig).inject().stream().map(inject -> ComponentId.fromString(inject.id())).collect(Collectors.toSet());
// Verify that the two sets are equal. Split in two asserts to get decent failure messages.
assertThat("Not all required components are injected", injectedConfigIds, containsInAnyOrder(expectedInjectedConfigIds.toArray()));
assertThat("We inject some components that should not be injected", expectedInjectedConfigIds, containsInAnyOrder(injectedConfigIds.toArray()));
}
Aggregations