Search in sources :

Example 1 with TestConfigDefinitionRepo

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();
}
Also used : TestConfigDefinitionRepo(com.yahoo.vespa.config.server.TestConfigDefinitionRepo) RemoteSession(com.yahoo.vespa.config.server.session.RemoteSession) SessionZooKeeperClient(com.yahoo.vespa.config.server.session.SessionZooKeeperClient)

Example 2 with TestConfigDefinitionRepo

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()));
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) ZooKeeperDeployer(com.yahoo.vespa.config.server.deploy.ZooKeeperDeployer) TestConfigDefinitionRepo(com.yahoo.vespa.config.server.TestConfigDefinitionRepo) File(java.io.File) MockFileRegistry(com.yahoo.config.model.application.provider.MockFileRegistry) SessionZooKeeperClient(com.yahoo.vespa.config.server.session.SessionZooKeeperClient)

Example 3 with TestConfigDefinitionRepo

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));
}
Also used : SimpletypesConfig(com.yahoo.config.SimpletypesConfig) TestConfigDefinitionRepo(com.yahoo.vespa.config.server.TestConfigDefinitionRepo) RemoteSession(com.yahoo.vespa.config.server.session.RemoteSession) ApplicationId(com.yahoo.config.provision.ApplicationId) SessionZooKeeperClient(com.yahoo.vespa.config.server.session.SessionZooKeeperClient) Test(org.junit.Test)

Aggregations

TestConfigDefinitionRepo (com.yahoo.vespa.config.server.TestConfigDefinitionRepo)3 SessionZooKeeperClient (com.yahoo.vespa.config.server.session.SessionZooKeeperClient)3 RemoteSession (com.yahoo.vespa.config.server.session.RemoteSession)2 SimpletypesConfig (com.yahoo.config.SimpletypesConfig)1 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)1 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 ZooKeeperDeployer (com.yahoo.vespa.config.server.deploy.ZooKeeperDeployer)1 File (java.io.File)1 Test (org.junit.Test)1