Search in sources :

Example 11 with SimpletypesConfig

use of com.yahoo.config.SimpletypesConfig in project vespa by vespa-engine.

the class TenantRequestHandlerTest method testResolveMultipleApps.

@Test
public void testResolveMultipleApps() throws IOException, SAXException {
    ApplicationId appId1 = new ApplicationId.Builder().tenant(tenant).applicationName("myapp1").instanceName("myinst1").build();
    ApplicationId appId2 = new ApplicationId.Builder().tenant(tenant).applicationName("myapp2").instanceName("myinst2").build();
    feedAndReloadApp(app1, 1, appId1);
    SimpletypesConfig config = resolve(SimpletypesConfig.class, server, appId1, vespaVersion, "");
    assertThat(config.intval(), is(1337));
    feedAndReloadApp(app2, 2, appId2);
    config = resolve(SimpletypesConfig.class, server, appId2, vespaVersion, "");
    assertThat(config.intval(), is(1330));
}
Also used : SimpletypesConfig(com.yahoo.config.SimpletypesConfig) ApplicationId(com.yahoo.config.provision.ApplicationId) Test(org.junit.Test)

Example 12 with SimpletypesConfig

use of com.yahoo.config.SimpletypesConfig 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

SimpletypesConfig (com.yahoo.config.SimpletypesConfig)12 Test (org.junit.Test)10 InnerCNode (com.yahoo.config.codegen.InnerCNode)7 ConfigPayload (com.yahoo.vespa.config.ConfigPayload)6 ApplicationId (com.yahoo.config.provision.ApplicationId)5 HttpResponse (com.yahoo.container.jdisc.HttpResponse)5 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)3 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)3 DefParser (com.yahoo.config.codegen.DefParser)2 HttpRequest (com.yahoo.container.jdisc.HttpRequest)2 StringReader (java.io.StringReader)2 ConfigResponse (com.yahoo.vespa.config.protocol.ConfigResponse)1 SlimeConfigResponse (com.yahoo.vespa.config.protocol.SlimeConfigResponse)1 TestConfigDefinitionRepo (com.yahoo.vespa.config.server.TestConfigDefinitionRepo)1 RemoteSession (com.yahoo.vespa.config.server.session.RemoteSession)1 SessionZooKeeperClient (com.yahoo.vespa.config.server.session.SessionZooKeeperClient)1 Clock (java.time.Clock)1