use of com.yahoo.vespa.config.server.ServerCache in project vespa by vespa-engine.
the class TenantsTestCase method testListenersAdded.
@Test
public void testListenersAdded() throws IOException, SAXException {
tenants.getTenant(tenant1).getReloadHandler().reloadConfig(ApplicationSet.fromSingle(new Application(new VespaModel(MockApplicationPackage.createEmpty()), new ServerCache(), 4l, Version.fromIntValues(1, 2, 3), MetricUpdater.createTestUpdater(), ApplicationId.defaultId())));
assertThat(listener.reloaded.get(), is(1));
}
use of com.yahoo.vespa.config.server.ServerCache 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));
}
use of com.yahoo.vespa.config.server.ServerCache in project vespa by vespa-engine.
the class ApplicationConvergenceCheckerTest method setup.
@Before
public void setup() throws IOException, SAXException, InterruptedException {
Model mockModel = MockModel.createContainer("localhost", 1337);
application = new Application(mockModel, new ServerCache(), 3, Version.fromIntValues(0, 0, 0), MetricUpdater.createTestUpdater(), appId);
}
use of com.yahoo.vespa.config.server.ServerCache in project vespa by vespa-engine.
the class ApplicationTest method createCacheAndAddContent.
private static ServerCache createCacheAndAddContent() {
ServerCache cache = new ServerCache();
final ConfigDefinitionKey key = new ConfigDefinitionKey(SimpletypesConfig.CONFIG_DEF_NAME, SimpletypesConfig.CONFIG_DEF_NAMESPACE);
com.yahoo.vespa.config.buildergen.ConfigDefinition def = getDef(key, SimpletypesConfig.CONFIG_DEF_SCHEMA);
// TODO Why do we have to use empty def md5 here?
cache.addDef(key, def);
final ConfigDefinitionKey key2 = new ConfigDefinitionKey(SlobroksConfig.CONFIG_DEF_NAME, SlobroksConfig.CONFIG_DEF_NAMESPACE);
com.yahoo.vespa.config.buildergen.ConfigDefinition def2 = getDef(key2, SlobroksConfig.CONFIG_DEF_SCHEMA);
cache.addDef(key2, def2);
final ConfigDefinitionKey key3 = new ConfigDefinitionKey(LogdConfig.CONFIG_DEF_NAME, LogdConfig.CONFIG_DEF_NAMESPACE);
com.yahoo.vespa.config.buildergen.ConfigDefinition def3 = getDef(key3, LogdConfig.CONFIG_DEF_SCHEMA);
cache.addDef(key3, def3);
return cache;
}
Aggregations