@InterfaceAudience.Private public final class HBaseClassTestRule extends Object implements org.junit.rules.TestRule
ClassRule
with
it.
For now it only sets a test method timeout based off the test categories small, medium, large. Based on junit Timeout TestRule; see https://github.com/junit-team/junit/wiki/Rules
Modifier and Type | Field and Description |
---|---|
private Class<?> |
clazz |
private static org.slf4j.Logger |
LOG |
private static long |
PER_UNIT_TEST_TIMEOUT_MINS |
private SystemExitRule |
systemExitRule |
private org.junit.rules.Timeout |
timeout |
static Set<Class<?>> |
UNIT_TEST_CLASSES |
Modifier | Constructor and Description |
---|---|
private |
HBaseClassTestRule(Class<?> clazz,
org.junit.rules.Timeout timeout) |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
static HBaseClassTestRule |
forClass(Class<?> clazz) |
Class<?> |
getClazz()
Mainly used for
HBaseClassTestRuleChecker to confirm that we use the correct
class to generate timeout ClassRule. |
(package private) static int |
getNumParameters(Class<?> clazz) |
private static long |
getTimeoutInSeconds(Class<?> clazz) |
private static boolean |
isParametersMethod(Method method)
Helper method that checks if the input method is a valid JUnit @Parameters method.
|
private static final org.slf4j.Logger LOG
public static final Set<Class<?>> UNIT_TEST_CLASSES
private static long PER_UNIT_TEST_TIMEOUT_MINS
private final org.junit.rules.Timeout timeout
private final SystemExitRule systemExitRule
private HBaseClassTestRule(Class<?> clazz, org.junit.rules.Timeout timeout)
public Class<?> getClazz()
HBaseClassTestRuleChecker
to confirm that we use the correct
class to generate timeout ClassRule.private static long getTimeoutInSeconds(Class<?> clazz)
static int getNumParameters(Class<?> clazz)
clazz
- Test class that is running.private static boolean isParametersMethod(@NonNull Method method)
method
- Input method.public static HBaseClassTestRule forClass(Class<?> clazz)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.