adoroszlai commented on code in PR #3414:
URL: https://github.com/apache/ozone/pull/3414#discussion_r875164030
##########
hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/cache/TestTableCache.java:
##########
@@ -20,68 +20,43 @@
package org.apache.hadoop.hdds.utils.db.cache;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import com.google.common.base.Optional;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
import org.slf4j.event.Level;
-import static org.junit.Assert.fail;
/**
* Class tests partial table cache.
*/
-@RunWith(value = Parameterized.class)
public class TestTableCache {
- private static final Logger LOG =
- LoggerFactory.getLogger(TestTableCache.class);
-
private TableCache<CacheKey<String>, CacheValue<String>> tableCache;
- private final TableCache.CacheType cacheType;
-
-
- @Parameterized.Parameters
- public static Collection<Object[]> policy() {
- Object[][] params = new Object[][] {
- {TableCache.CacheType.FULL_CACHE},
- {TableCache.CacheType.PARTIAL_CACHE}
- };
- return Arrays.asList(params);
- }
-
- public TestTableCache(
- TableCache.CacheType cacheType) {
+ @BeforeAll
+ public static void setLogLevel() {
GenericTestUtils.setLogLevel(FullTableCache.LOG, Level.DEBUG);
- this.cacheType = cacheType;
}
-
- @Before
- public void create() {
+ private void createTableCache(TableCache.CacheType cacheType) {
if (cacheType == TableCache.CacheType.FULL_CACHE) {
tableCache = new FullTableCache<>();
} else {
tableCache = new PartialTableCache<>();
}
- LOG.info("cacheType: {}", cacheType);
}
+ @ParameterizedTest
+ @EnumSource(TableCache.CacheType.class)
Review Comment:
👍
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]