You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/03/08 14:38:39 UTC

[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2549: Migrate Minicluster module to JUnit5

DomGarguilo commented on a change in pull request #2549:
URL: https://github.com/apache/accumulo/pull/2549#discussion_r821709097



##########
File path: minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java
##########
@@ -18,30 +18,32 @@
  */
 package org.apache.accumulo.miniclusterImpl;
 
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 import java.io.File;
 import java.util.Collections;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
 import org.easymock.EasyMock;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
 public class CleanShutdownMacTest {
 
-  @Rule
-  public TemporaryFolder tmpDir =
-      new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
+  @TempDir
+  private static File tmpDir;
 
   @SuppressWarnings("unchecked")
   @Test
   public void testExecutorServiceShutdown() throws Exception {
-    File tmp = tmpDir.newFolder();
+    // File tmp = tmpDir.newFolder();

Review comment:
       ```suggestion
   ```
   Looks like this might be left over.

##########
File path: minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
##########
@@ -98,7 +100,8 @@ public void checkDFSConstants() {
   }
 
   @SuppressWarnings("deprecation")
-  @Test(timeout = 30000)
+  @Test
+  @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS)

Review comment:
       It might be more readable if these were in seconds rather than milliseconds when possible.

##########
File path: minicluster/pom.xml
##########
@@ -138,6 +144,11 @@
       <artifactId>easymock</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.junit.vintage</groupId>

Review comment:
       Vintage engine should be able to be removed once all tests are converted to JUnit5.

##########
File path: minicluster/pom.xml
##########
@@ -123,6 +123,12 @@
       <artifactId>curator-test</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.curator</groupId>
+      <artifactId>curator-test</artifactId>
+      <version>5.1.0</version>
+      <scope>test</scope>
+    </dependency>

Review comment:
       ```suggestion
       <dependency>
         <groupId>org.apache.curator</groupId>
         <artifactId>curator-test</artifactId>
         <version>5.1.0</version>
         <scope>test</scope>
       </dependency>
   ```
   I think this can be removed as a duplicate of the dependency above it.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

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