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



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

Review comment:
       versions should be managed in the pom.xml at the root in the 
dependencyManagement section

##########
File path: 
minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
##########
@@ -169,20 +172,21 @@ public void test() throws Exception {
     conn.tableOperations().delete("table1");
   }
 
-  @Rule
-  public TemporaryFolder folder =
-      new TemporaryFolder(new File(System.getProperty("user.dir") + 
"/target"));
+  @TempDir
+  private static File tempDir;
 
   @SuppressWarnings("deprecation")
-  @Test(timeout = 60000)
+  @Test
+  @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS)
   public void testPerTableClasspath() throws Exception {
 
     org.apache.accumulo.core.client.Connector conn = 
accumulo.getConnector("root", "superSecret");
 
     conn.tableOperations().create("table2");
 
-    File jarFile = folder.newFile("iterator.jar");
-    FileUtils.copyURLToFile(this.getClass().getResource("/FooFilter.jar"), 
jarFile);
+    File jarFile = new File(tempDir, "iterator.jar");
+    
FileUtils.copyURLToFile(Objects.requireNonNull(this.getClass().getResource("/FooFilter.jar")),
+        jarFile);

Review comment:
       Could static import `requireNonNull` and drop `this.` to make this one 
line and more readable.
   ```suggestion
       
FileUtils.copyURLToFile(requireNonNull(getClass().getResource("/FooFilter.jar")),
 jarFile);
   ```

##########
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:
       This comment applies throughout this module. We only used millis because 
we had to. They should all be seconds now that we don't need to use millis.
   
   ```suggestion
     @Timeout(value = 30, unit = TimeUnit.SECONDS)
   ```

##########
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();
+    File tmp = new File(tmpDir, "folder1/");

Review comment:
       Can remove commented out code.
   
   Instead of "folder1", can use `testName()`

##########
File path: minicluster/src/test/java/org/apache/accumulo/WithTestNames.java
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo;

Review comment:
       For less confusion, this should be in a package corresponding to the 
module it is contained in.
   
   ```suggestion
   package org.apache.accumulo.minicluster;
   ```




-- 
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-unsubscr...@accumulo.apache.org

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


Reply via email to