001/*002 * Copyright 2002-2014 the original author or authors.003 *004 * Licensed under the Apache License, Version 2.0 (the "License");005 * you may not use this file except in compliance with the License.006 * You may obtain a copy of the License at007 *008 * https://www.apache.org/licenses/LICENSE-2.0009 *010 * Unless required by applicable law or agreed to in writing, software011 * distributed under the License is distributed on an "AS IS" BASIS,012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.013 * See the License for the specific language governing permissions and014 * limitations under the License.015 */016017package org.springframework.test.context.support;018019import org.springframework.core.Ordered;020import org.springframework.test.context.TestContext;021import org.springframework.test.context.TestExecutionListener;022023/**024 * Abstract implementation of the {@link TestExecutionListener} interface which025 * provides empty method stubs. Subclasses can extend this class and override026 * only those methods suitable for the task at hand.027 *028 * @author Sam Brannen029 * @author Juergen Hoeller030 * @since 2.5031 */032public abstract class AbstractTestExecutionListener implements TestExecutionListener, Ordered {033034 /**035 * The default implementation is <em>empty</em>. Can be overridden by036 * subclasses as necessary.037 */038 @Override039 public void beforeTestClass(TestContext testContext) throws Exception {040 /* no-op */041 }042043 /**044 * The default implementation is <em>empty</em>. Can be overridden by045 * subclasses as necessary.046 */047 @Override048 public void prepareTestInstance(TestContext testContext) throws Exception {049 /* no-op */050 }051052 /**053 * The default implementation is <em>empty</em>. Can be overridden by054 * subclasses as necessary.055 */056 @Override057 public void beforeTestMethod(TestContext testContext) throws Exception {058 /* no-op */059 }060061 /**062 * The default implementation is <em>empty</em>. Can be overridden by063 * subclasses as necessary.064 */065 @Override066 public void afterTestMethod(TestContext testContext) throws Exception {067 /* no-op */068 }069070 /**071 * The default implementation is <em>empty</em>. Can be overridden by072 * subclasses as necessary.073 */074 @Override075 public void afterTestClass(TestContext testContext) throws Exception {076 /* no-op */077 }078079