Fixed Failing EchoTest

This commit is contained in:
Nikhil Khatwani
2016-10-20 16:00:31 +05:30
parent 1657916676
commit 4d54080b3e
2 changed files with 24 additions and 9 deletions

View File

@@ -2,17 +2,20 @@ package com.baeldung.java.nio.selector;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.Test;
public class EchoTest {
@Test
public void givenClient_whenServerEchosMessage_thenCorrect() {
public void givenClient_whenServerEchosMessage_thenCorrect() throws IOException, InterruptedException {
Process process = EchoServer.start();
EchoClient client = EchoClient.start();
String resp1 = client.sendMessage("hello");
String resp2 = client.sendMessage("world");
assertEquals("hello", resp1);
assertEquals("world", resp2);
process.destroy();
}
}