├── .gitignore ├── src └── main │ └── java │ └── org │ └── jvnet │ └── hudson │ └── test │ ├── SmokeTest.java │ ├── Issue.java │ ├── Url.java │ ├── Bug.java │ ├── For.java │ └── Email.java └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | *.ipr 4 | *.iws 5 | .idea 6 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/SmokeTest.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.hudson.test; 2 | 3 | /** 4 | * Interface used as a Category for classifying a test as a smoke-test. 5 | * 6 | *

7 | * All tests annotated like {@code @Category(SmokeTest.class)} would be run in the {@code smoke-test} suite. 8 | * The {@code smoke-test} suite is meant for running unit tests and a number of functional tests. 9 | *

10 | * 11 | * @see https://github.com/junit-team/junit4/wiki/categories 12 | * @since TODO 13 | */ 14 | public interface SmokeTest { 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/Issue.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.hudson.test; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Marks a test case to a bug filed in the issue tracker. 11 | * 12 | * @author Kohsuke Kawaguchi 13 | */ 14 | @Documented 15 | @Target({ElementType.METHOD, ElementType.TYPE}) 16 | @Retention(RetentionPolicy.SOURCE) 17 | public @interface Issue { 18 | /** 19 | * Issue ID, such as JENKINS-12345 or SECURITY-34. 20 | */ 21 | String[] value(); 22 | } 23 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jenkins-ci 5 | jenkins 6 | 1.33 7 | 8 | test-annotations 9 | 10 | 1.3-SNAPSHOT 11 | Test annotations 12 | Annotations to associate test cases with other things 13 | 14 | 15 | lib-test-annotations 16 | 17 | 18 | 19 | scm:git:git://github.com/jenkinsci/lib-test-annotations.git 20 | scm:git:git@github.com:jenkinsci/lib-test-annotations.git 21 | https://github.com/jenkinsci/lib-test-annotations 22 | HEAD 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/Url.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.jvnet.hudson.test; 25 | 26 | import java.lang.annotation.Documented; 27 | 28 | /** 29 | * Marks a test case to a bug reported in the other sources. 30 | * 31 | * @author Kohsuke Kawaguchi 32 | * @see Email 33 | */ 34 | @Documented 35 | public @interface Url { 36 | /** 37 | * URL to the web page indicating a problem related to this test case. 38 | */ 39 | String value(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/Bug.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.jvnet.hudson.test; 25 | 26 | import java.lang.annotation.Documented; 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Target; 29 | 30 | /** 31 | * Marks a test case to a bug filed in the issue tracker. 32 | * 33 | * @author Kohsuke Kawaguchi 34 | * @deprecated 35 | * Use {@link Issue} to explicitly call out which ticket system we are talking about. 36 | */ 37 | @Documented 38 | @Target({ElementType.METHOD, ElementType.TYPE}) 39 | public @interface Bug { 40 | /** 41 | * Issue number. 42 | */ 43 | int value(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/For.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.jvnet.hudson.test; 25 | 26 | import java.lang.annotation.Documented; 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Target; 29 | 30 | /** 31 | * Marks a test case as a test related to the specified production class. 32 | * 33 | *

34 | * This can be used when the relationship between the test class and the test subject 35 | * is not obvious. 36 | * 37 | * @author Kohsuke Kawaguchi 38 | * @since 1.351 39 | */ 40 | @Documented 41 | @Target({ElementType.METHOD, ElementType.TYPE}) 42 | public @interface For { 43 | Class[] value(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jvnet/hudson/test/Email.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package org.jvnet.hudson.test; 25 | 26 | import java.lang.annotation.Documented; 27 | 28 | /** 29 | * Marks a test case to a bug reported in the mailing list. 30 | * 31 | * @author Kohsuke Kawaguchi 32 | * @see Url 33 | */ 34 | @Documented 35 | public @interface Email { 36 | /** 37 | * URL to the e-mail archive. 38 | * 39 | * Look for the e-mail in 40 | * http://www.nabble.com/Hudson-users-f16872.html or 41 | * http://www.nabble.com/Hudson-dev-f25543.html 42 | */ 43 | String value(); 44 | } 45 | --------------------------------------------------------------------------------