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/29 17:02:38 UTC

[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2584: Migrate iterator-test-harness module JUnit5

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



##########
File path: iterator-test-harness/src/main/java/org/apache/accumulo/iteratortest/junit5/BaseJUnit5IteratorTest.java
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.iteratortest.junit5;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.accumulo.iteratortest.IteratorTestInput;
+import org.apache.accumulo.iteratortest.IteratorTestOutput;
+import org.apache.accumulo.iteratortest.IteratorTestReport;
+import org.apache.accumulo.iteratortest.IteratorTestRunner;
+import org.apache.accumulo.iteratortest.testcases.IteratorTestCase;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A base JUnit5 test class for users to leverage with the JUnit ParameterizedTest.
+ * <p>
+ * Users should extend this class and override the parameters() method to provide a list of
+ * Arguments, each of which serve as the parameters for an iterator test case.
+ *
+ * <pre>
+ * public static List&lt;Arguments&gt; parameters() {
+ *   IteratorTestInput input = createIteratorInput();
+ *   IteratorTestOutput expectedOutput = createIteratorOutput();
+ *   List&lt;IteratorTestCase&gt; testCases = createTestCases();
+ *   return BaseJUnit5IteratorTest.createParameters(input, expectedOutput, testCases);
+ * }
+ * </pre>
+ */
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public abstract class BaseJUnit5IteratorTest {

Review comment:
       > This change should be mentioned in the release notes, since the parameter types have changed in the abstract method going from JUnit4 to JUnit5.
   
   It is possible to keep the parameter types the same. I changed it to `List<Arguments>` because that seems more intuitive to me. If it seems better to leave it as `Object[][]` I can go ahead and revert it back to that.




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