Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7ca7c69098
@ -56,6 +56,7 @@ public class AsyncEchoClient {
|
|||||||
readResult.get();
|
readResult.get();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
}
|
||||||
String echo = new String(buffer.array()).trim();
|
String echo = new String(buffer.array()).trim();
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
return echo;
|
return echo;
|
||||||
@ -73,7 +74,7 @@ public class AsyncEchoClient {
|
|||||||
AsyncEchoClient client = AsyncEchoClient.getInstance();
|
AsyncEchoClient client = AsyncEchoClient.getInstance();
|
||||||
client.start();
|
client.start();
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
||||||
String line = null;
|
String line;
|
||||||
System.out.println("Message to server:");
|
System.out.println("Message to server:");
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
String response = client.sendMessage(line);
|
String response = client.sendMessage(line);
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
package com.baeldung.htmlunit;
|
package com.baeldung.htmlunit;
|
||||||
|
|
||||||
import org.junit.Assert;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import com.gargoylesoftware.htmlunit.WebClient;
|
import com.gargoylesoftware.htmlunit.WebClient;
|
||||||
import com.gargoylesoftware.htmlunit.html.HtmlPage;
|
import com.gargoylesoftware.htmlunit.html.HtmlPage;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class HtmlUnitAndJUnitTest {
|
public class HtmlUnitAndJUnitTest {
|
||||||
|
|
||||||
|
private WebClient webClient;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
webClient = new WebClient();
|
webClient = new WebClient();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user