Search in sources :

Example 6 with Application

use of com.yahoo.vespa.config.server.application.Application in project vespa by vespa-engine.

the class RpcServerTest method testEnabled.

private void testEnabled() throws IOException, SAXException {
    generationCounter.increment();
    Application app = new Application(new VespaModel(MockApplicationPackage.createEmpty()), new ServerCache(), 2l, Version.fromIntValues(1, 2, 3), MetricUpdater.createTestUpdater(), ApplicationId.defaultId());
    ApplicationSet appSet = ApplicationSet.fromSingle(app);
    rpcServer.configActivated(TenantName.defaultName(), appSet);
    ConfigKey<?> key = new ConfigKey<>(LbServicesConfig.class, "*");
    JRTClientConfigRequest clientReq = JRTClientConfigRequestV3.createFromRaw(new RawConfig(key, LbServicesConfig.CONFIG_DEF_MD5), 120_000, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty());
    assertTrue(clientReq.validateParameters());
    performRequest(clientReq.getRequest());
    assertFalse(clientReq.validateResponse());
    assertThat(clientReq.errorCode(), is(ErrorCode.APPLICATION_NOT_LOADED));
    rpcServer.onTenantsLoaded();
    clientReq = JRTClientConfigRequestV3.createFromRaw(new RawConfig(key, LbServicesConfig.CONFIG_DEF_MD5), 120_000, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty());
    assertTrue(clientReq.validateParameters());
    performRequest(clientReq.getRequest());
    boolean validResponse = clientReq.validateResponse();
    assertTrue(clientReq.errorMessage(), validResponse);
    assertThat(clientReq.errorCode(), is(0));
}
Also used : ServerCache(com.yahoo.vespa.config.server.ServerCache) VespaModel(com.yahoo.vespa.model.VespaModel) ApplicationSet(com.yahoo.vespa.config.server.application.ApplicationSet) Application(com.yahoo.vespa.config.server.application.Application)

Aggregations

Application (com.yahoo.vespa.config.server.application.Application)6 ServerCache (com.yahoo.vespa.config.server.ServerCache)4 ApplicationSet (com.yahoo.vespa.config.server.application.ApplicationSet)2 VespaModel (com.yahoo.vespa.model.VespaModel)2 Test (org.junit.Test)2 Files (com.google.common.io.Files)1 Inject (com.google.inject.Inject)1 ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)1 Version (com.yahoo.component.Version)1 Vtag (com.yahoo.component.Vtag)1 DaemonThreadFactory (com.yahoo.concurrent.DaemonThreadFactory)1 ApplicationFile (com.yahoo.config.application.api.ApplicationFile)1 ApplicationMetaData (com.yahoo.config.application.api.ApplicationMetaData)1 DeployLogger (com.yahoo.config.application.api.DeployLogger)1 ModelContext (com.yahoo.config.model.api.ModelContext)1 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 Environment (com.yahoo.config.provision.Environment)1 HostFilter (com.yahoo.config.provision.HostFilter)1 Provisioner (com.yahoo.config.provision.Provisioner)1