Search in sources :

Example 1 with ApplicationConvergenceChecker

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

the class ApplicationHandlerTest method testFailingProvisioner.

@Test
@Ignore
public void testFailingProvisioner() throws Exception {
    provisioner = new SessionHandlerTest.FailingMockProvisioner();
    mockHandler = createMockApplicationHandler(provisioner, new ApplicationConvergenceChecker(stateApiFactory), new HttpProxy(new SimpleHttpFetcher()), new LogServerLogGrabber());
    final ApplicationId applicationId = ApplicationId.defaultId();
    addMockApplication(tenants.getTenant(mytenantName), applicationId, 1, Clock.systemUTC());
    assertApplicationExists(mytenantName, applicationId, Zone.defaultZone());
    provisioner.activated = true;
    String url = "http://myhost:14000/application/v2/tenant/" + mytenantName + "/application/" + applicationId.application();
    deleteAndAssertResponse(mockHandler, url, 500, null, "{\"message\":\"Cannot remove application\"}", com.yahoo.jdisc.http.HttpRequest.Method.DELETE);
    assertApplicationExists(mytenantName, applicationId, Zone.defaultZone());
    Assert.assertTrue(provisioner.activated);
}
Also used : HttpProxy(com.yahoo.vespa.config.server.application.HttpProxy) ApplicationConvergenceChecker(com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) SimpleHttpFetcher(com.yahoo.vespa.config.server.http.SimpleHttpFetcher) ApplicationId(com.yahoo.config.provision.ApplicationId) LogServerLogGrabber(com.yahoo.vespa.config.server.application.LogServerLogGrabber) Ignore(org.junit.Ignore) HandlerTest(com.yahoo.vespa.config.server.http.HandlerTest) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) Test(org.junit.Test)

Example 2 with ApplicationConvergenceChecker

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

the class ApplicationHandlerTest method setup.

@Before
public void setup() {
    TestTenantBuilder testBuilder = new TestTenantBuilder();
    testBuilder.createTenant(mytenantName).withReloadHandler(new MockReloadHandler());
    testBuilder.createTenant(foobar).withReloadHandler(new MockReloadHandler());
    tenants = testBuilder.createTenants();
    provisioner = new SessionHandlerTest.MockProvisioner();
    mockHandler = createMockApplicationHandler(provisioner, new ApplicationConvergenceChecker(stateApiFactory), mockHttpProxy, new MockLogServerLogGrabber());
    listApplicationsHandler = new ListApplicationsHandler(ListApplicationsHandler.testOnlyContext(), tenants, Zone.defaultZone());
}
Also used : ApplicationConvergenceChecker(com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest) MockReloadHandler(com.yahoo.vespa.config.server.MockReloadHandler) Before(org.junit.Before)

Aggregations

ApplicationConvergenceChecker (com.yahoo.vespa.config.server.application.ApplicationConvergenceChecker)2 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)2 ApplicationId (com.yahoo.config.provision.ApplicationId)1 MockReloadHandler (com.yahoo.vespa.config.server.MockReloadHandler)1 HttpProxy (com.yahoo.vespa.config.server.application.HttpProxy)1 LogServerLogGrabber (com.yahoo.vespa.config.server.application.LogServerLogGrabber)1 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)1 SimpleHttpFetcher (com.yahoo.vespa.config.server.http.SimpleHttpFetcher)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1