use of com.yahoo.vespa.config.server.ApplicationRepository in project vespa by vespa-engine.
the class SessionContentHandlerTest method createHandler.
private SessionContentHandler createHandler() throws Exception {
TestTenantBuilder testTenantBuilder = new TestTenantBuilder();
testTenantBuilder.createTenant(tenant).getLocalSessionRepo().addSession(new MockSession(1l, FilesApplicationPackage.fromFile(createTestApp())));
return new SessionContentHandler(SessionContentHandler.testOnlyContext(), new ApplicationRepository(testTenantBuilder.createTenants(), new SessionHandlerTest.MockProvisioner(), Clock.systemUTC()), testTenantBuilder.createTenants());
}
use of com.yahoo.vespa.config.server.ApplicationRepository in project vespa by vespa-engine.
the class ApplicationContentHandlerTest method setupHandler.
@Before
public void setupHandler() throws Exception {
TestTenantBuilder testTenantBuilder = new TestTenantBuilder();
testTenantBuilder.createTenant(tenant1);
testTenantBuilder.createTenant(tenant2);
session2 = new MockSession(2l, FilesApplicationPackage.fromFile(new File("src/test/apps/content")));
testTenantBuilder.tenants().get(tenant1).getLocalSessionRepo().addSession(session2);
testTenantBuilder.tenants().get(tenant2).getLocalSessionRepo().addSession(new MockSession(3l, FilesApplicationPackage.fromFile(new File("src/test/apps/content2"))));
testTenantBuilder.tenants().get(tenant1).getApplicationRepo().createPutApplicationTransaction(idTenant1, 2l).commit();
testTenantBuilder.tenants().get(tenant2).getApplicationRepo().createPutApplicationTransaction(idTenant2, 3l).commit();
handler = new ApplicationHandler(ApplicationHandler.testOnlyContext(), Zone.defaultZone(), new ApplicationRepository(testTenantBuilder.createTenants(), new MockProvisioner(), Clock.systemUTC()));
pathPrefix = createPath(idTenant1, Zone.defaultZone());
baseUrl = baseServer + pathPrefix;
}
use of com.yahoo.vespa.config.server.ApplicationRepository in project vespa by vespa-engine.
the class SessionCreateHandlerTest method createHandler.
private SessionCreateHandler createHandler(Tenants tenants) throws Exception {
TestTenantBuilder testTenantBuilder = new TestTenantBuilder();
final ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
return new SessionCreateHandler(SessionCreateHandler.testOnlyContext(), new ApplicationRepository(testTenantBuilder.createTenants(), new SessionHandlerTest.MockProvisioner(), Clock.systemUTC()), tenants, configserverConfig);
}
use of com.yahoo.vespa.config.server.ApplicationRepository in project vespa by vespa-engine.
the class SessionActiveHandlerTest method createHandler.
private SessionHandler createHandler() throws Exception {
final SessionFactory sessionFactory = new MockSessionFactory();
TestTenantBuilder testTenantBuilder = new TestTenantBuilder();
testTenantBuilder.createTenant(tenant).withSessionFactory(sessionFactory).withLocalSessionRepo(localRepo).withRemoteSessionRepo(remoteSessionRepo).withApplicationRepo(applicationRepo).build();
return new SessionActiveHandler(SessionActiveHandler.testOnlyContext(), new ApplicationRepository(testTenantBuilder.createTenants(), hostProvisioner, Clock.systemUTC()), testTenantBuilder.createTenants(), Zone.defaultZone());
}
Aggregations