Skip to content

Commit 4c398ce

Browse files
committed
Update tests.
1 parent 3f256aa commit 4c398ce

2 files changed

Lines changed: 2 additions & 29 deletions

File tree

kilo-client/src/test/java/org/httprpc/kilo/util/concurrent/PipeTest.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
package org.httprpc.kilo.util.concurrent;
1616

17-
import org.junit.jupiter.api.AfterAll;
18-
import org.junit.jupiter.api.BeforeAll;
1917
import org.junit.jupiter.api.Test;
2018

2119
import java.util.concurrent.ExecutorService;
@@ -25,17 +23,7 @@
2523
import static org.junit.jupiter.api.Assertions.*;
2624

2725
public class PipeTest {
28-
private static ExecutorService executorService = null;
29-
30-
@BeforeAll
31-
public static void setUpClass() {
32-
executorService = Executors.newSingleThreadExecutor();
33-
}
34-
35-
@AfterAll
36-
public static void tearDownClass() {
37-
executorService.shutdown();
38-
}
26+
private static ExecutorService executorService = Executors.newSingleThreadExecutor();
3927

4028
@Test
4129
public void testBoundedPipe() {

kilo-test/src/main/java/org/httprpc/kilo/test/EmployeeService.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package org.httprpc.kilo.test;
1616

17-
import jakarta.servlet.ServletException;
1817
import jakarta.servlet.annotation.WebServlet;
1918
import org.httprpc.kilo.RequestMethod;
2019
import org.httprpc.kilo.ResourcePath;
@@ -33,27 +32,13 @@
3332

3433
@WebServlet(urlPatterns = {"/employees/*"}, loadOnStartup = 1)
3534
public class EmployeeService extends WebService {
36-
private static ExecutorService executorService = null;
35+
private static ExecutorService executorService = Executors.newCachedThreadPool();
3736

3837
@Override
3938
protected String getDataSourceName() {
4039
return "java:comp/env/jdbc/EmployeeDB";
4140
}
4241

43-
@Override
44-
public void init() throws ServletException {
45-
super.init();
46-
47-
executorService = Executors.newCachedThreadPool();
48-
}
49-
50-
@Override
51-
public void destroy() {
52-
executorService.shutdown();
53-
54-
super.destroy();
55-
}
56-
5742
@RequestMethod("GET")
5843
public Iterable<Employee> getEmployees(boolean stream) throws SQLException {
5944
return stream ? getEmployeesStream() : getEmployeesList();

0 commit comments

Comments
 (0)