001    /*
002     * $Id: SmokeTest.java,v 1.2 2010/06/08 21:32:53 oboehm Exp $
003     *
004     * Copyright (c) 2010 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 02.03.2010 by oliver (ob@oasd.de)
019     */
020    
021    package patterntesting.runtime.annotation;
022    
023    import java.lang.annotation.*;
024    
025    /**
026     * For fast CI build it is helpful to mark important JUnit tests and test
027     * method as SmokeTest. If the JUnit tests are started with the system property
028     * "patterntesting.runSmokeTest" set then only these marked test classes and
029     * methods will be executed. This will help you to start only the important
030     * tests for a faster build.
031     * <br/>
032     * For finer granularity a level could be set. This level can be set with the
033     * same property, e.g. "-Dpatterntesting.runSmokeTest=5". Then only tests with
034     * level 5 or less will be executed. The other tests with level 6 or higher
035     * will be skipped.
036     * <br/>
037     * <em>Note</em>: this feature is reserved for future use. If you would
038     * like it raise a feature request at
039     * {@link "http://sourceforge.net/tracker/?atid=454320&group_id=48833"}.
040     *
041     * @author oliver
042     * @since 1.0
043     */
044    @Documented
045    @Target({ElementType.METHOD, ElementType.TYPE})
046    @Retention(RetentionPolicy.RUNTIME)
047    public @interface SmokeTest {
048    
049        /**
050         * You can change the default string to give a reason why the test will
051         * be executed in "SmokeTest mode".
052         */
053        String value() default "marked as @SmokeTest";
054    
055        /**
056         * You are free to define your only levels here.
057         * Normally "1" is the highest level. You can replace "level" by
058         * "priority" if you want - it has the same meaning here.
059         *
060         * It is not forbidden to define a level "0" or a negative level.
061         */
062        int level() default 1;
063    
064    }
065