Search in sources :

Example 6 with SessionZooKeeperClient

use of com.yahoo.vespa.config.server.session.SessionZooKeeperClient 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

SessionZooKeeperClient (com.yahoo.vespa.config.server.session.SessionZooKeeperClient)6 RemoteSession (com.yahoo.vespa.config.server.session.RemoteSession)5 TestConfigDefinitionRepo (com.yahoo.vespa.config.server.TestConfigDefinitionRepo)3 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)2 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)2 File (java.io.File)2 SimpletypesConfig (com.yahoo.config.SimpletypesConfig)1 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 NullConfigModelRegistry (com.yahoo.config.model.NullConfigModelRegistry)1 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 TenantName (com.yahoo.config.provision.TenantName)1 Path (com.yahoo.path.Path)1 GlobalComponentRegistry (com.yahoo.vespa.config.server.GlobalComponentRegistry)1 SuperModelGenerationCounter (com.yahoo.vespa.config.server.SuperModelGenerationCounter)1 TestComponentRegistry (com.yahoo.vespa.config.server.TestComponentRegistry)1 ZooKeeperClient (com.yahoo.vespa.config.server.deploy.ZooKeeperClient)1 ZooKeeperDeployer (com.yahoo.vespa.config.server.deploy.ZooKeeperDeployer)1 ModelFactoryRegistry (com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry)1 LocalSession (com.yahoo.vespa.config.server.session.LocalSession)1