use of com.twitter.heron.common.testhelpers.HeronServerTester in project incubator-heron by apache.
the class CheckpointManagerServerTest method runTest.
private void runTest(TestRequestHandler.RequestType requestType, HeronServerTester.TestResponseHandler responseHandler) throws IOException, InterruptedException {
serverTester = new HeronServerTester(checkpointManagerServer, new TestRequestHandler(requestType), responseHandler, RESPONSE_RECEIVED_TIMEOUT);
serverTester.start();
}
use of com.twitter.heron.common.testhelpers.HeronServerTester in project incubator-heron by apache.
the class HeronServerTest method before.
@Before
public void before() throws IOException {
// Get an available port
int serverPort = SysUtils.getFreePort();
serverOnConnectSignal = new CountDownLatch(1);
serverOnMessageSignal = new CountDownLatch(TOTAL_MESSAGES);
serverOnRequestSignal = new CountDownLatch(1);
clientOnConnectSignal = new CountDownLatch(1);
clientOnResponseSignal = new CountDownLatch(1);
heronServer = new SimpleHeronServer(new NIOLooper(), HeronServerTester.SERVER_HOST, serverPort, serverOnConnectSignal, serverOnMessageSignal, serverOnRequestSignal);
heronClient = new SimpleHeronClient(new NIOLooper(), HeronServerTester.SERVER_HOST, serverPort, clientOnConnectSignal, clientOnResponseSignal);
heronServerTester = new HeronServerTester(heronServer, heronClient);
}
use of com.twitter.heron.common.testhelpers.HeronServerTester in project incubator-heron by apache.
the class EchoTest method before.
@Before
public void before() throws IOException {
int serverPort = SysUtils.getFreePort();
serverRequestsReceivedLatch = new CountDownLatch(MAX_REQUESTS);
server = new EchoServer(new NIOLooper(), serverPort, MAX_REQUESTS, serverRequestsReceivedLatch);
client = new EchoClient(new NIOLooper(), serverPort, MAX_REQUESTS);
heronServerTester = new HeronServerTester(server, client);
heronServerTester.start();
}
use of com.twitter.heron.common.testhelpers.HeronServerTester in project incubator-heron by apache.
the class HandleTMasterLocationTest method before.
@Before
public void before() throws IOException {
// MetricsManagerServer increments this counter every time a location refresh message is
// received, so we can await this counter getting to 4 before proceeding with the test
serverMetrics = new LatchedMultiCountMetric("tmaster-location-received", 4L);
// Spy it for unit test
metricsManagerServer = spy(new MetricsManagerServer(new NIOLooper(), HeronServerTester.SERVER_HOST, SysUtils.getFreePort(), HeronServerTester.TEST_SOCKET_OPTIONS, serverMetrics));
heronServerTester = new HeronServerTester(metricsManagerServer, new TestRequestHandler(), new HeronServerTester.SuccessResponseHandler(Metrics.MetricPublisherRegisterResponse.class, new TestResponseHandler()), RESPONSE_RECEIVED_TIMEOUT);
heronServerTester.start();
}
use of com.twitter.heron.common.testhelpers.HeronServerTester in project incubator-heron by apache.
the class MetricsManagerServerTest method before.
@Before
public void before() throws IOException {
metricsManagerServer = new MetricsManagerServer(new NIOLooper(), HeronServerTester.SERVER_HOST, SysUtils.getFreePort(), HeronServerTester.TEST_SOCKET_OPTIONS, new MultiCountMetric());
serverTester = new HeronServerTester(metricsManagerServer, new MetricsManagerClientRequestHandler(), new HeronServerTester.SuccessResponseHandler(Metrics.MetricPublisherRegisterResponse.class, new MetricsManagerClientResponseHandler(MESSAGE_SIZE)), RESPONSE_RECEIVED_TIMEOUT);
}
Aggregations