Class SkipJunit

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class SkipJunit
    extends Object
    implements org.junit.rules.TestRule
    Use as a @Rule or @ClassRule to skip all methods in a class on some OSes.
    • Constructor Detail

      • SkipJunit

        public SkipJunit​(OS... oses)
      • SkipJunit

        public SkipJunit​(int jdkMajorVersion)
    • Method Detail

      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runner.Description description)
        Specified by:
        apply in interface org.junit.rules.TestRule
      • skipOnOS

        public static void skipOnOS​(OS... oses)
        Use within a @Test method to skip that method on some OSes. Use in a @BeforeClass method to skip all methods in a class on some OSes.
      • onlyOnOS

        public static void onlyOnOS​(OS... oses)
        Use within a @Test method to run this test only on certain OSes. Use in a @BeforeClass method to run all methods in a class only on some OSes.
      • skipSinceJDK

        public static void skipSinceJDK​(int major)