You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/11/10 17:33:15 UTC

[GitHub] [geode] moleske commented on a change in pull request #5725: GEODE-8664: Nest errors in DistributionImpl.start

moleske commented on a change in pull request #5725:
URL: https://github.com/apache/geode/pull/5725#discussion_r520744117



##########
File path: geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionTest.java
##########
@@ -204,4 +207,30 @@ public void testSendToEmptyListIsRejected() throws Exception {
     distribution.send(emptyList, m);
     verify(membership, never()).send(any(), any());
   }
+
+  @Test
+  public void testExceptionNestedOnStartConfigError() throws Exception {
+    Throwable cause = new RuntimeException("Exception cause");
+    Throwable exception = new MembershipConfigurationException("Test exception", cause);
+    doThrow(exception).when(membership).start();
+    try {

Review comment:
       JUnit has [ExpectedException](https://junit.org/junit4/javadoc/4.12/org/junit/rules/ExpectedException.html) which I think works better than `try` `catch` statements.  There are some examples in the Geode code base if you want some inspiration




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org