use of ClientServerCommunication.ClientRequestHandler in project SmartCity-Market by TechnionYP5777.
the class ClientRequestHandlerTest method ClientRequestHandlerUnknownHostTest.
@Test
public void ClientRequestHandlerUnknownHostTest() {
try {
ClientRequestHandler clientRequestHandler = new ClientRequestHandler();
clientRequestHandler.createSocket(portTest, SERVER_UKNOWN_HOST_NAME, TIMEOUT);
clientRequestHandler.finishRequest();
} catch (UnknownHostException e) {
/* success */
} catch (RuntimeException e) {
fail();
}
}
use of ClientServerCommunication.ClientRequestHandler in project SmartCity-Market by TechnionYP5777.
the class ClientRequestHandlerTest method ClientRequestHandlerLegalTimeoutTest.
@Test
public void ClientRequestHandlerLegalTimeoutTest() {
new Thread(new ServerTest()).start();
try {
Thread.sleep(100);
} catch (InterruptedException e1) {
fail();
}
try {
ClientRequestHandler clientRequestHandler = new ClientRequestHandler();
clientRequestHandler.createSocket(portTest, SERVER_HOST_NAME, TIMEOUT);
clientRequestHandler.finishRequest();
} catch (UnknownHostException | RuntimeException e) {
fail();
}
}
Aggregations