Package org.apache.hadoop.hbase
Class HBaseClassTestRule
java.lang.Object
org.apache.hadoop.hbase.HBaseClassTestRule
- All Implemented Interfaces:
- org.junit.rules.TestRule
The class level TestRule for all the tests. Every test class should have a 
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
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final Class<?>private static final org.slf4j.Loggerprivate static longprivate final SystemExitRuleprivate final org.junit.rules.Timeout
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateHBaseClassTestRule(Class<?> clazz, org.junit.rules.Timeout timeout) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) static HBaseClassTestRuleClass<?>getClazz()Mainly used forHBaseClassTestRuleCheckerto confirm that we use the correct class to generate timeout ClassRule.(package private) static intgetNumParameters(Class<?> clazz) private static longgetTimeoutInSeconds(Class<?> clazz) private static booleanisParametersMethod(Method method) Helper method that checks if the input method is a valid JUnit @Parameters method.
- 
Field Details- 
LOG
- 
UNIT_TEST_CLASSES
- 
PER_UNIT_TEST_TIMEOUT_MINS
- 
clazz
- 
timeout
- 
systemExitRule
 
- 
- 
Constructor Details- 
HBaseClassTestRule
 
- 
- 
Method Details- 
getClazzMainly used forHBaseClassTestRuleCheckerto confirm that we use the correct class to generate timeout ClassRule.
- 
getTimeoutInSeconds
- 
getNumParameters- Parameters:
- clazz- Test class that is running.
- Returns:
- the number of parameters for this given test class. If the test is not parameterized or if there is any issue determining the number of parameters, returns 1.
 
- 
isParametersMethodHelper method that checks if the input method is a valid JUnit @Parameters method.- Parameters:
- method- Input method.
- Returns:
- true if the method is a valid JUnit parameters method, false otherwise.
 
- 
forClass
- 
applypublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
- applyin interface- org.junit.rules.TestRule
 
 
-