use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.
the class SessionActiveHandlerTest method addLocalSession.
private LocalSessionRepo addLocalSession(long sessionId, DeployData deployData, SessionZooKeeperClient zkc) {
writeApplicationId(zkc, deployData.getApplicationName());
TenantFileSystemDirs tenantFileSystemDirs = TenantFileSystemDirs.createTestDirs(tenant);
ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(testApp, deployData);
localRepo.addSession(new LocalSession(tenant, sessionId, new SessionTest.MockSessionPreparer(), new SessionContext(app, zkc, new File(tenantFileSystemDirs.sessionsPath(), String.valueOf(sessionId)), applicationRepo, new HostRegistry<>(), new SuperModelGenerationCounter(curator))));
return localRepo;
}
use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.
the class StaticProvisionerTest method sameHostsAreProvisioned.
@Test
public void sameHostsAreProvisioned() throws IOException, SAXException {
ApplicationPackage app = FilesApplicationPackage.fromFile(new File("src/test/apps/hosted"));
InMemoryProvisioner inMemoryHostProvisioner = new InMemoryProvisioner(false, "host1.yahoo.com", "host2.yahoo.com", "host3.yahoo.com", "host4.yahoo.com");
VespaModel firstModel = createModel(app, inMemoryHostProvisioner);
StaticProvisioner staticProvisioner = new StaticProvisioner(firstModel.allocatedHosts());
VespaModel secondModel = createModel(app, staticProvisioner);
assertModelConfig(firstModel, secondModel);
}
use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.
the class ModelProvisioningTest method createNonProvisionedMultitenantModel.
private VespaModel createNonProvisionedMultitenantModel(String services) {
VespaModelCreatorWithMockPkg modelCreatorWithMockPkg = new VespaModelCreatorWithMockPkg(null, services, ApplicationPackageUtils.generateSearchDefinition("type1"));
ApplicationPackage appPkg = modelCreatorWithMockPkg.appPkg;
DeployState deployState = new DeployState.Builder().applicationPackage(appPkg).properties((new DeployProperties.Builder()).multitenant(true).build()).build(true);
return modelCreatorWithMockPkg.create(false, deployState);
}
use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.
the class ContainerModelBuilderTest method fail_if_http_port_is_not_4080_in_hosted_vespa.
@Test
public void fail_if_http_port_is_not_4080_in_hosted_vespa() throws Exception {
String servicesXml = "<services>" + "<admin version='3.0'>" + " <nodes count='1'/>" + "</admin>" + "<jdisc version='1.0'>" + " <http>" + " <server port='9000' id='foo' />" + " </http>" + nodesXml + "</jdisc>" + "</services>";
ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices(servicesXml).build();
// Need to create VespaModel to make deploy properties have effect
final MyLogger logger = new MyLogger();
new VespaModel(new NullConfigModelRegistry(), new DeployState.Builder().applicationPackage(applicationPackage).deployLogger(logger).properties(new DeployProperties.Builder().hostedVespa(true).build()).build(true));
assertFalse(logger.msgs.isEmpty());
assertThat(logger.msgs.get(0).getSecond(), containsString(String.format("You cannot set port to anything else than %d", Container.BASEPORT)));
}
use of com.yahoo.config.application.api.ApplicationPackage in project vespa by vespa-engine.
the class ContainerModelBuilderTest method vip_status_handler_uses_file_for_hosted_vespa.
@Test
public void vip_status_handler_uses_file_for_hosted_vespa() throws Exception {
String servicesXml = "<services>" + "<jdisc version='1.0'>" + nodesXml + "</jdisc>" + "</services>";
ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices(servicesXml).build();
VespaModel model = new VespaModel(new NullConfigModelRegistry(), new DeployState.Builder().applicationPackage(applicationPackage).properties(new DeployProperties.Builder().hostedVespa(true).build()).build(true));
AbstractConfigProducerRoot modelRoot = model.getRoot();
VipStatusConfig vipStatusConfig = modelRoot.getConfig(VipStatusConfig.class, "jdisc/component/status.html-status-handler");
assertTrue(vipStatusConfig.accessdisk());
assertEquals(ContainerModelBuilder.HOSTED_VESPA_STATUS_FILE, vipStatusConfig.statusfile());
}
Aggregations