001/*
002 * (C) Copyright 2006-2011 Nuxeo SA (http://nuxeo.com/) and contributors.
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 at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * 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 and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     bstefanescu
018 */
019package org.nuxeo.runtime.test.runner;
020
021import org.junit.runners.model.FrameworkMethod;
022
023import com.google.inject.Binder;
024
025/**
026 * These are the states the runner goes through when using runtime feature:
027 *
028 * <pre>
029 * CREATE FRAMEWORK
030 * new feature()        --> constructor
031 * COLLECT DEFINED DEPLOYMENTS
032 * feature.initialize() --> can be used to configure nuxeo home or register JNDI objects
033 * START FRAMEWORK
034 * feature.start()
035 * feature.beforeRun()
036 * feature.configure() --> can be used to add guice bindings and to dynamically deploy components using the harness
037 * for each test method:
038 *   feature.testCreated()
039 *   feature.beforeSetup
040 *   feature.beforeMethodRun()  --> test method interceptor
041 *   testMethod()
042 *   feature.afterMethodRun()   --> test method interceptor
043 *   feature.afterTeardown()
044 * feature.afterRun() --> cleanup that require framework to be started
045 * STOP FRAMEWORK
046 * feature.stop()  --> destructor
047 * </pre>
048 *
049 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
050 */
051public class SimpleFeature implements RunnerFeature {
052
053    @Override
054    public void afterRun(FeaturesRunner runner) throws Exception {
055    }
056
057    @Override
058    public void beforeRun(FeaturesRunner runner) throws Exception {
059    }
060
061    @Override
062    public void start(FeaturesRunner runner) throws Exception {
063    }
064
065    @Override
066    public void testCreated(Object test) throws Exception {
067    }
068
069    @Override
070    public void stop(FeaturesRunner runner) throws Exception {
071    }
072
073    @Override
074    public void configure(FeaturesRunner runner, Binder binder) {
075    }
076
077    @Override
078    public void initialize(FeaturesRunner runner) throws Exception {
079    }
080
081    @Override
082    public void afterMethodRun(FeaturesRunner runner, FrameworkMethod method, Object test) throws Exception {
083    }
084
085    @Override
086    public void beforeMethodRun(FeaturesRunner runner, FrameworkMethod method, Object test) throws Exception {
087    }
088
089    @Override
090    public void beforeSetup(FeaturesRunner runner) throws Exception {
091
092    }
093
094    @Override
095    public void afterTeardown(FeaturesRunner runner) throws Exception {
096
097    }
098
099}