use of com.yahoo.vespa.config.server.TestConfigDefinitionRepo in project vespa by vespa-engine.
the class TenantRequestHandlerTest method reloadConfig.
private ApplicationSet reloadConfig(long id, String application, Clock clock) {
SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, configCurator, Tenants.getSessionsPath(tenant).append(String.valueOf(id)), new TestConfigDefinitionRepo(), "", Optional.empty());
zkc.writeApplicationId(new ApplicationId.Builder().tenant(tenant).applicationName(application).build());
RemoteSession session = new RemoteSession(tenant, id, componentRegistry, zkc, clock);
return session.ensureApplicationLoaded();
}
use of com.yahoo.vespa.config.server.TestConfigDefinitionRepo in project vespa by vespa-engine.
the class TenantRequestHandlerTest method feedApp.
private void feedApp(File appDir, long sessionId, ApplicationId appId) throws IOException {
SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, configCurator, Tenants.getSessionsPath(tenant).append(String.valueOf(sessionId)), new TestConfigDefinitionRepo(), "", Optional.empty());
zkc.writeApplicationId(appId);
File app = tempFolder.newFolder();
IOUtils.copyDirectory(appDir, app);
ZooKeeperDeployer deployer = zkc.createDeployer(new BaseDeployLogger());
deployer.deploy(FilesApplicationPackage.fromFile(appDir), Collections.singletonMap(vespaVersion, new MockFileRegistry()), AllocatedHosts.withHosts(Collections.emptySet()));
}
use of com.yahoo.vespa.config.server.TestConfigDefinitionRepo in project vespa by vespa-engine.
the class TenantRequestHandlerTest method testResolveForAppId.
@Test
public void testResolveForAppId() {
long id = 1l;
SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, configCurator, Tenants.getSessionsPath(tenant).append(String.valueOf(id)), new TestConfigDefinitionRepo(), "", Optional.empty());
ApplicationId appId = new ApplicationId.Builder().tenant(tenant).applicationName("myapp").instanceName("myinst").build();
zkc.writeApplicationId(appId);
RemoteSession session = new RemoteSession(appId.tenant(), id, componentRegistry, zkc, Clock.systemUTC());
server.reloadConfig(session.ensureApplicationLoaded());
SimpletypesConfig config = resolve(SimpletypesConfig.class, server, appId, vespaVersion, "");
assertThat(config.intval(), is(1337));
}
Aggregations