001
014
015 package com.liferay.portal.kernel.test.rule.callback;
016
017 import java.lang.reflect.Method;
018
019 import org.junit.runner.Description;
020
021
024 public class BaseTestCallback<C, M> implements TestCallback<C, M> {
025
026 @Override
027 public void afterClass(Class<?> clazz, C c) throws Throwable {
028 doAfterClass(Description.createSuiteDescription(clazz), c);
029 }
030
031 @Override
032 public void afterMethod(Class<?> clazz, Method method, M m, Object target)
033 throws Throwable {
034
035 doAfterMethod(
036 Description.createTestDescription(clazz, method.getName()), m,
037 target);
038 }
039
040 @Override
041 public C beforeClass(Class<?> clazz) throws Throwable {
042 return doBeforeClass(Description.createSuiteDescription(clazz));
043 }
044
045 @Override
046 public M beforeMethod(Class<?> clazz, Method method, Object target)
047 throws Throwable {
048
049 return doBeforeMethod(
050 Description.createTestDescription(clazz, method.getName()), target);
051 }
052
053 public void doAfterClass(Description description, C c) throws Throwable {
054 }
055
056 public void doAfterMethod(Description description, M m, Object target)
057 throws Throwable {
058 }
059
060 public C doBeforeClass(Description description) throws Throwable {
061 return null;
062 }
063
064 public M doBeforeMethod(Description description, Object target)
065 throws Throwable {
066
067 return null;
068 }
069
070 }