001    /*
002     * $Id: SmokeSuite.java,v 1.2 2012/04/24 17:03:58 oboehm Exp $
003     *
004     * Copyright (c) 2012 by Oliver Boehm
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     * 
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     * 
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     * 
018     * (c)reated 30.12.2011 by oliver (ob@oasd.de)
019     */
020    
021    package patterntesting.runtime.junit;
022    
023    import java.util.List;
024    
025    import org.junit.runner.Runner;
026    import org.junit.runner.notification.RunNotifier;
027    import org.junit.runners.Suite;
028    import org.junit.runners.model.*;
029    
030    import patterntesting.runtime.junit.internal.SmokeBuilder;
031    
032    /**
033     * Suite implementation which understand the same annotations like the
034     * {@link SmokeRunner} class.
035     * <br/>
036     * In JUnit 4.4 the used constructors of the superclass throws an
037     * InitializationError which was located in an internal package. Because
038     * this exception is deprecated since JUnit 4.5 we no longer try to support
039     * JUnit 4.4 (there were also other reasons we do not support JUnit 4.4 -
040     * e.g we need an additional SmokeSuite(Class) constructor which would not
041     * compile without tricks on new versions of JUnit).
042     * 
043     * @author oliver
044     * @since 1.2 (30.12.2011)
045     */
046    public class SmokeSuite extends Suite {
047    
048        /**
049         * Instantiates a new smoke suite.
050         *
051         * @param klass the klass
052         * @param runners the runners
053         * @throws InitializationError the initialization error
054         */
055        public SmokeSuite(Class<?> klass, List<Runner> runners) throws InitializationError {
056            super(klass, runners);
057        }
058    
059        /**
060         * Instantiates a new smoke suite.
061         *
062         * @param klass the klass
063         * @param builder the builder
064         * @throws InitializationError the initialization error
065         */
066        public SmokeSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
067            super(klass, new SmokeBuilder(builder));
068        }
069    
070        /**
071         * Instantiates a new smoke suite.
072         *
073         * @param builder the builder
074         * @param klass the klass
075         * @param suiteClasses the suite classes
076         * @throws InitializationError the initialization error
077         */
078        public SmokeSuite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses)
079                throws InitializationError {
080            super(new SmokeBuilder(builder), klass, suiteClasses);
081        }
082    
083        /**
084         * Instantiates a new smoke suite.
085         *
086         * @param builder the builder
087         * @param classes the classes
088         * @throws InitializationError the initialization error
089         */
090        public SmokeSuite(RunnerBuilder builder, Class<?>[] classes) throws InitializationError {
091            super(new SmokeBuilder(builder), classes);
092        }
093    
094        /**
095         * Instantiates a new smoke suite.
096         *
097         * @param klass the klass
098         * @param suiteClasses the suite classes
099         * @throws InitializationError the initialization error
100         */
101        protected SmokeSuite(Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
102            super(klass, suiteClasses);
103        }
104    
105        /**
106         * Run. It is only overwritten for better testing support.
107         *
108         * @param notifier the notifier
109         * @see org.junit.runners.ParentRunner#run(org.junit.runner.notification.RunNotifier)
110         */
111        @Override
112        public void run(RunNotifier notifier) {
113            super.run(notifier);
114        }
115    
116    }
117