Search in sources :

Example 1 with ApplicationRepository

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());
}
Also used : ApplicationRepository(com.yahoo.vespa.config.server.ApplicationRepository)

Example 2 with ApplicationRepository

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;
}
Also used : ApplicationRepository(com.yahoo.vespa.config.server.ApplicationRepository) File(java.io.File) Before(org.junit.Before)

Example 3 with ApplicationRepository

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);
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) ApplicationRepository(com.yahoo.vespa.config.server.ApplicationRepository)

Example 4 with ApplicationRepository

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());
}
Also used : SessionFactory(com.yahoo.vespa.config.server.session.SessionFactory) ApplicationRepository(com.yahoo.vespa.config.server.ApplicationRepository)

Aggregations

ApplicationRepository (com.yahoo.vespa.config.server.ApplicationRepository)4 ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)1 SessionFactory (com.yahoo.vespa.config.server.session.SessionFactory)1 File (java.io.File)1 Before (org.junit.Before)1