use of com.yahoo.vespa.config.server.rpc.UncompressedConfigResponseFactory in project vespa by vespa-engine.
the class SuperModelControllerTest method test_lb_config_multiple_apps.
@Test
public void test_lb_config_multiple_apps() throws IOException, SAXException {
Map<TenantName, Map<ApplicationId, ApplicationInfo>> models = new LinkedHashMap<>();
models.put(TenantName.from("t1"), new LinkedHashMap<>());
models.put(TenantName.from("t2"), new LinkedHashMap<>());
File testApp1 = new File("src/test/resources/deploy/app");
File testApp2 = new File("src/test/resources/deploy/advancedapp");
File testApp3 = new File("src/test/resources/deploy/advancedapp");
// TODO must fix equals, hashCode on Tenant
Version vespaVersion = Version.fromIntValues(1, 2, 3);
models.get(TenantName.from("t1")).put(applicationId("mysimpleapp"), new ApplicationInfo(applicationId("mysimpleapp"), 4l, new VespaModel(FilesApplicationPackage.fromFile(testApp1))));
models.get(TenantName.from("t1")).put(applicationId("myadvancedapp"), new ApplicationInfo(applicationId("myadvancedapp"), 4l, new VespaModel(FilesApplicationPackage.fromFile(testApp2))));
models.get(TenantName.from("t2")).put(applicationId("minetooadvancedapp"), new ApplicationInfo(applicationId("minetooadvancedapp"), 4l, new VespaModel(FilesApplicationPackage.fromFile(testApp3))));
SuperModel superModel = new SuperModel(models);
SuperModelController han = new SuperModelController(new SuperModelConfigProvider(superModel, Zone.defaultZone()), new TestConfigDefinitionRepo(), 2, new UncompressedConfigResponseFactory());
LbServicesConfig.Builder lb = new LbServicesConfig.Builder();
han.getSuperModel().getConfig(lb);
LbServicesConfig lbc = new LbServicesConfig(lb);
assertThat(lbc.tenants().size(), is(2));
assertThat(lbc.tenants("t1").applications().size(), is(2));
assertThat(lbc.tenants("t2").applications().size(), is(1));
assertThat(lbc.tenants("t2").applications("minetooadvancedapp:prod:default:default").hosts().size(), is(1));
assertQrServer(lbc.tenants("t2").applications("minetooadvancedapp:prod:default:default"));
}
use of com.yahoo.vespa.config.server.rpc.UncompressedConfigResponseFactory in project vespa by vespa-engine.
the class SuperModelControllerTest method setupHandler.
@Before
public void setupHandler() throws IOException, SAXException {
Map<TenantName, Map<ApplicationId, ApplicationInfo>> models = new LinkedHashMap<>();
models.put(TenantName.from("a"), new LinkedHashMap<>());
File testApp = new File("src/test/resources/deploy/app");
ApplicationId app = ApplicationId.from(TenantName.from("a"), ApplicationName.from("foo"), InstanceName.defaultName());
models.get(app.tenant()).put(app, new ApplicationInfo(app, 4l, new VespaModel(FilesApplicationPackage.fromFile(testApp))));
SuperModel superModel = new SuperModel(models);
handler = new SuperModelController(new SuperModelConfigProvider(superModel, Zone.defaultZone()), new TestConfigDefinitionRepo(), 2, new UncompressedConfigResponseFactory());
}
use of com.yahoo.vespa.config.server.rpc.UncompressedConfigResponseFactory in project vespa by vespa-engine.
the class TenantRequestHandlerTest method setUp.
@Before
public void setUp() throws IOException, SAXException {
feedApp(app1, 1);
Metrics sh = Metrics.createTestMetrics();
List<ReloadListener> listeners = new ArrayList<>();
listeners.add(listener);
server = new TenantRequestHandler(sh, tenant, listeners, new UncompressedConfigResponseFactory(), new HostRegistries());
componentRegistry = new TestComponentRegistry.Builder().curator(curator).modelFactoryRegistry(createRegistry()).build();
}
Aggregations