-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProxyTest.java
More file actions
39 lines (29 loc) · 776 Bytes
/
Copy pathProxyTest.java
File metadata and controls
39 lines (29 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package proxy;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
public class ProxyTest {
private Client client;
@Before
public void runServerAndClient() throws IOException {
new Thread(() -> {
try {
Server server = new Server(5000);
} catch (IOException e) {
e.printStackTrace();
}
}).start();
client = new Client(5000);
}
@Test
public void testMul() {
Assert.assertEquals(200.0, client.mul(20, 10), 0.01);
Assert.assertEquals(800.0, client.mul(20, 40), 0.01);
}
@After
public void tearDown() throws IOException {
client.close();
}
}