Search in sources :

Example 1 with MockFeedReaderFactory

use of com.yahoo.vespaxmlparser.MockFeedReaderFactory in project vespa by vespa-engine.

the class V3CongestionTestCase method setup.

@Before
public void setup() {
    // Set up a request to be used from the tests.
    InputStream in = new MetaStream(new byte[] { 1 });
    request = HttpRequest.createTestRequest("http://foo.bar:19020/reserved-for-internal-use/feedapi", com.yahoo.jdisc.http.HttpRequest.Method.POST, in);
    request.getJDiscRequest().headers().add(Headers.VERSION, "3");
    request.getJDiscRequest().headers().add(Headers.CLIENT_ID, "clientId");
    // Create a mock that does not parse the message, only reads the rest of the line. Makes it easier
    // to write tests. It uses a mock for message bus.
    clientFeederV3 = new ClientFeederWithMocks(retainMockSession(new SourceSessionParams(), requests), new MockFeedReaderFactory(), null, /*DocTypeManager*/
    "clientID", null, /*metric*/
    new FeedReplyReader(null, /*metric*/
    new DocumentApiMetrics(MetricReceiver.nullImplementation, "tester")), threadsAvail);
}
Also used : MockFeedReaderFactory(com.yahoo.vespaxmlparser.MockFeedReaderFactory) DocumentApiMetrics(com.yahoo.documentapi.metrics.DocumentApiMetrics) InputStream(java.io.InputStream) SourceSessionParams(com.yahoo.messagebus.SourceSessionParams) Before(org.junit.Before)

Aggregations

DocumentApiMetrics (com.yahoo.documentapi.metrics.DocumentApiMetrics)1 SourceSessionParams (com.yahoo.messagebus.SourceSessionParams)1 MockFeedReaderFactory (com.yahoo.vespaxmlparser.MockFeedReaderFactory)1 InputStream (java.io.InputStream)1 Before (org.junit.Before)1