Search in sources :

Example 1 with AccessLog

use of com.yahoo.container.logging.AccessLog in project vespa by vespa-engine.

the class ServletAccessLoggingTest method accessLogIsInvokedForJDiscServlet.

@Test
public void accessLogIsInvokedForJDiscServlet() throws Exception {
    final AccessLog accessLog = mock(AccessLog.class);
    final TestDriver testDriver = newTestDriver(accessLog);
    testDriver.client().newGet("/status.html").execute();
    verifyCallsLog(accessLog, timeout(MAX_LOG_WAIT_TIME_MILLIS).times(1));
}
Also used : AccessLog(com.yahoo.container.logging.AccessLog) TestDriver(com.yahoo.jdisc.http.server.jetty.TestDriver) Test(org.testng.annotations.Test)

Example 2 with AccessLog

use of com.yahoo.container.logging.AccessLog in project vespa by vespa-engine.

the class LoggingRequestHandlerTestCase method setUp.

@Before
public void setUp() throws Exception {
    accessLogging = new StartTimePusher();
    ComponentRegistry<AccessLogInterface> implementers = new ComponentRegistry<>();
    implementers.register(new ComponentId("nalle"), accessLogging);
    implementers.freeze();
    executor = Executors.newCachedThreadPool();
    handler = new AccessLogTestHandler(executor, new AccessLog(implementers));
}
Also used : AccessLog(com.yahoo.container.logging.AccessLog) AccessLogInterface(com.yahoo.container.logging.AccessLogInterface) ComponentRegistry(com.yahoo.component.provider.ComponentRegistry) ComponentId(com.yahoo.component.ComponentId) Before(org.junit.Before)

Example 3 with AccessLog

use of com.yahoo.container.logging.AccessLog in project vespa by vespa-engine.

the class ServletAccessLoggingTest method accessLogIsInvokedForNonJDiscServlet.

@Test
public void accessLogIsInvokedForNonJDiscServlet() throws Exception {
    final AccessLog accessLog = mock(AccessLog.class);
    final TestDriver testDriver = newTestDriver(accessLog);
    httpGet(testDriver, TestServlet.PATH).execute();
    verifyCallsLog(accessLog, timeout(MAX_LOG_WAIT_TIME_MILLIS).times(1));
}
Also used : AccessLog(com.yahoo.container.logging.AccessLog) TestDriver(com.yahoo.jdisc.http.server.jetty.TestDriver) Test(org.testng.annotations.Test)

Aggregations

AccessLog (com.yahoo.container.logging.AccessLog)3 TestDriver (com.yahoo.jdisc.http.server.jetty.TestDriver)2 Test (org.testng.annotations.Test)2 ComponentId (com.yahoo.component.ComponentId)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 AccessLogInterface (com.yahoo.container.logging.AccessLogInterface)1 Before (org.junit.Before)1