|
21 | 21 | import static org.hamcrest.MatcherAssert.assertThat;
|
22 | 22 | import static org.junit.Assert.assertThrows;
|
23 | 23 | import static org.junit.Assert.fail;
|
24 |
| - |
25 | 24 | import java.io.IOException;
|
26 | 25 | import java.lang.reflect.InvocationTargetException;
|
27 | 26 | import java.lang.reflect.Method;
|
28 | 27 | import java.lang.reflect.Modifier;
|
| 28 | +import java.util.HashSet; |
| 29 | +import java.util.Set; |
29 | 30 | import org.apache.hadoop.hbase.HBaseClassTestRule;
|
30 | 31 | import org.apache.hadoop.hbase.HBaseConfiguration;
|
31 | 32 | import org.apache.hadoop.hbase.net.Address;
|
|
39 | 40 | import org.junit.experimental.categories.Category;
|
40 | 41 | import org.slf4j.Logger;
|
41 | 42 | import org.slf4j.LoggerFactory;
|
42 |
| - |
43 | 43 | import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
|
44 | 44 |
|
45 | 45 | @Category({ ClientTests.class, SmallTests.class })
|
@@ -73,8 +73,18 @@ public void testPrivateMethodExecutedInEventLoop() throws IllegalAccessException
|
73 | 73 | assertThrows(AssertionError.class, () -> {
|
74 | 74 | assert false;
|
75 | 75 | });
|
| 76 | + |
| 77 | + final Set<String> methodsToCheck = new HashSet<>(); |
| 78 | + methodsToCheck.add("shutdown0"); |
| 79 | + methodsToCheck.add("sendRequest0"); |
| 80 | + methodsToCheck.add("connect"); |
| 81 | + |
76 | 82 | for (Method method : NettyRpcConnection.class.getDeclaredMethods()) {
|
77 | 83 | if (Modifier.isPrivate(method.getModifiers()) && !method.getName().contains("$")) {
|
| 84 | + if (!methodsToCheck.contains(method.getName())) { |
| 85 | + LOG.info("skipping {}", method); |
| 86 | + continue; |
| 87 | + } |
78 | 88 | LOG.info("checking {}", method);
|
79 | 89 | method.setAccessible(true);
|
80 | 90 | // all private methods should be called inside the event loop thread, so calling it from
|
|
0 commit comments