use of com.yahoo.vespa.model.container.Container in project vespa by vespa-engine.
the class QrserverAndGatewayPortAllocationTest method testPorts.
@Test
public void testPorts() throws IOException, SAXException {
String appDir = "src/test/cfg/application/app_qrserverandgw/";
VespaModelCreatorWithFilePkg creator = new VespaModelCreatorWithFilePkg(appDir);
VespaModel vespaModel = creator.create();
List<Container> qrservers = vespaModel.getContainerClusters().get("container").getContainers();
assertThat(qrservers.size(), is(1));
assertThat(qrservers.get(0).getSearchPort(), is(Container.BASEPORT));
}
use of com.yahoo.vespa.model.container.Container in project vespa by vespa-engine.
the class ModelProvisioningTest method checkThatTldAndContainerRunningOnSameHostHaveSameId.
private void checkThatTldAndContainerRunningOnSameHostHaveSameId(Collection<ContainerCluster> containerClusters, Collection<ContentCluster> contentClusters, int startIndexForContainerIds) {
for (ContentCluster contentCluster : contentClusters) {
String contentClusterName = contentCluster.getName();
int i = 0;
for (ContainerCluster containerCluster : containerClusters) {
String containerClusterName = containerCluster.getName();
for (int j = 0; j < 2; j++) {
Dispatch tld = contentCluster.getSearch().getIndexed().getTLDs().get(2 * i + j);
Container container = containerCluster.getContainers().get(j);
int containerConfigIdIndex = j + startIndexForContainerIds;
assertEquals(container.getHostName(), tld.getHostname());
assertEquals(contentClusterName + "/search/cluster." + contentClusterName + "/tlds/" + containerClusterName + "." + containerConfigIdIndex + ".tld." + containerConfigIdIndex, tld.getConfigId());
assertEquals(containerClusterName + "/" + "container." + containerConfigIdIndex, container.getConfigId());
}
i++;
}
}
}
use of com.yahoo.vespa.model.container.Container in project vespa by vespa-engine.
the class DocprocBuilderTest method testDocprocCluster.
// TODO: re-enable assertions when the appropriate attributes are handled by the builder
@Test
public void testDocprocCluster() {
assertThat(cluster.getName(), is("banan"));
assertThat(cluster.getDocproc().isCompressDocuments(), is(true));
// assertThat(cluster.getContainerDocproc().isPreferLocalNode(), is(true));
// assertThat(cluster.getContainerDocproc().getNumNodesPerClient(), is(2));
List<Container> services = cluster.getContainers();
assertThat(services.size(), is(1));
Container service = services.get(0);
assertThat(service, notNullValue());
Map<String, DocprocChain> chains = new HashMap<>();
for (DocprocChain chain : cluster.getDocprocChains().allChains().allComponents()) {
chains.put(chain.getId().stringValue(), chain);
}
assertThat(chains.size(), is(1));
DocprocChain chain = chains.get("chein");
assertThat(chain.getId().stringValue(), is("chein"));
assertThat(chain.getInnerComponents().size(), is(1));
DocumentProcessor processor = chain.getInnerComponents().iterator().next();
assertThat(processor.getComponentId().stringValue(), is("docproc2"));
}
use of com.yahoo.vespa.model.container.Container in project vespa by vespa-engine.
the class StandaloneContainerActivatorTest method requireThatPortsCanBeFoundHttpThreeServers.
@Test
public void requireThatPortsCanBeFoundHttpThreeServers() throws IOException, ParserConfigurationException, SAXException {
final Path applicationDir = Files.createTempDirectory("application");
try {
final String contents = "<http>\n" + " <server id=\"a\" port=\"123\"/>\n" + " <server id=\"b\" port=\"456\"/>\n" + " <server id=\"c\" port=\"789\"/>\n" + "</http>\n";
writeApplicationPackage(getJdiscXml(contents), applicationDir);
StandaloneContainerActivator activator = new StandaloneContainerActivator();
Container container = StandaloneContainerActivator.getContainer(newAppDirBinding(applicationDir));
List<Integer> ports = getPorts(activator, container);
assertThat(ports, is(asList(123, 456, 789)));
} finally {
IOUtils.recursiveDeleteDir(applicationDir.toFile());
}
}
use of com.yahoo.vespa.model.container.Container in project vespa by vespa-engine.
the class StandaloneContainerActivatorTest method requireThatPortsCanBeFoundBasic.
@Test
public void requireThatPortsCanBeFoundBasic() throws IOException, ParserConfigurationException, SAXException {
final Path applicationDir = Files.createTempDirectory("application");
try {
writeApplicationPackage(getJdiscXml(""), applicationDir);
StandaloneContainerActivator activator = new StandaloneContainerActivator();
Container container = StandaloneContainerActivator.getContainer(newAppDirBinding(applicationDir));
List<Integer> ports = getPorts(activator, container);
assertThat(ports, is(singletonList(Defaults.getDefaults().vespaWebServicePort())));
} finally {
IOUtils.recursiveDeleteDir(applicationDir.toFile());
}
}
Aggregations