Class OSTestMethodSelector

  • All Implemented Interfaces:
    org.testng.IInvokedMethodListener, org.testng.ITestNGListener

    public class OSTestMethodSelector
    extends java.lang.Object
    implements org.testng.IInvokedMethodListener
    Use this listener if you want to exclude automatically tests based on your operating system. Example: @Test(groups = { TestGroup.OS_WIN }) public void testA() { } @Test(groups = { TestGroup.OS_WIN, TestGroup.OS_UNIX }) public void testB() { } @Test(groups = { TestGroup.OS_WIN }) public void testC() { } and you are running your tests on Unix, then only testB will be executed, the remaining ones will be marked as skipped.
    Author:
    Paul Brodner
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterInvocation​(org.testng.IInvokedMethod testNGmethod, org.testng.ITestResult testResult)  
      void beforeInvocation​(org.testng.IInvokedMethod testNGmethod, org.testng.ITestResult testResult)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OSTestMethodSelector

        public OSTestMethodSelector()
    • Method Detail

      • beforeInvocation

        public void beforeInvocation​(org.testng.IInvokedMethod testNGmethod,
                                     org.testng.ITestResult testResult)
        Specified by:
        beforeInvocation in interface org.testng.IInvokedMethodListener
      • afterInvocation

        public void afterInvocation​(org.testng.IInvokedMethod testNGmethod,
                                    org.testng.ITestResult testResult)
        Specified by:
        afterInvocation in interface org.testng.IInvokedMethodListener