Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/geode/pull/429#discussion_r107048816
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java
 ---
    @@ -126,14 +111,16 @@ public void testDeployToInvalidDirectory() throws 
IOException, ClassNotFoundExce
           public void run() {
             try {
               barrier.await();
    -        } catch (Exception e) {
    -          fail(e);
    +        } catch (InterruptedException iex) {
    --- End diff --
    
    Never catch "unexpected" exceptions in a JUnit Test. This makes a mess and 
adds tons of lines to a test for no good reason. JUnit framework handles 
"unexpected" exceptions than this crazy catch/rethrow business. All the books 
about JUnit say don't do this. Also, use new Concurrency constructs.
    ```java
        Future<Boolean> done = Executors.newSingleThreadExecutor().submit(() -> 
{
          barrier.await();
          
jarDeployer.deployWithoutRegistering("JarDeployerIntegrationTest.jar", 
jarBytes);
          return true;
        });
    
        barrier.await();
        Thread.sleep(500); // don't ever do this
        alternateDir.mkdir();
        assertThat(done.get(2, TimeUnit.MINUTES)).isTrue();
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to