|
48 | 48 | import org.mockito.invocation.InvocationOnMock; |
49 | 49 | import org.mockito.stubbing.Answer; |
50 | 50 |
|
| 51 | +import org.apache.hbase.thirdparty.com.google.common.io.Closeables; |
| 52 | + |
51 | 53 | /** |
52 | 54 | * Test the procedure member, and it's error handling mechanisms. |
53 | 55 | */ |
@@ -77,14 +79,9 @@ public class TestProcedureMember { |
77 | 79 | * Reset all the mock objects |
78 | 80 | */ |
79 | 81 | @After |
80 | | - public void resetTest() { |
| 82 | + public void resetTest() throws IOException { |
81 | 83 | reset(mockListener, mockBuilder, mockMemberComms); |
82 | | - if (member != null) |
83 | | - try { |
84 | | - member.close(); |
85 | | - } catch (IOException e) { |
86 | | - e.printStackTrace(); |
87 | | - } |
| 84 | + Closeables.close(member, true); |
88 | 85 | } |
89 | 86 |
|
90 | 87 | /** |
@@ -273,7 +270,7 @@ public Void answer(InvocationOnMock invocation) throws Throwable { |
273 | 270 |
|
274 | 271 | /** |
275 | 272 | * Handle failures if a member's commit phase fails. |
276 | | - * |
| 273 | + * <p/> |
277 | 274 | * NOTE: This is the core difference that makes this different from traditional 2PC. In true |
278 | 275 | * 2PC the transaction is committed just before the coordinator sends commit messages to the |
279 | 276 | * member. Members are then responsible for reading its TX log. This implementation actually |
@@ -314,7 +311,7 @@ public Void answer(InvocationOnMock invocation) throws Throwable { |
314 | 311 |
|
315 | 312 | /** |
316 | 313 | * Handle Failures if a member's commit phase succeeds but notification to coordinator fails |
317 | | - * |
| 314 | + * <p/> |
318 | 315 | * NOTE: This is the core difference that makes this different from traditional 2PC. In true |
319 | 316 | * 2PC the transaction is committed just before the coordinator sends commit messages to the |
320 | 317 | * member. Members are then responsible for reading its TX log. This implementation actually |
|
0 commit comments