Class TestOrConfiguration

java.lang.Object
org.testng.internal.annotations.BaseAnnotation
org.testng.internal.annotations.TestOrConfiguration
All Implemented Interfaces:
IAnnotation, IParameterizable, ITestOrConfiguration
Direct Known Subclasses:
BaseBeforeAfter, ConfigurationAnnotation, TestAnnotation

public class TestOrConfiguration extends BaseAnnotation implements ITestOrConfiguration
  • Field Details

    • m_groups

      private String[] m_groups
    • m_enabled

      private boolean m_enabled
    • m_dependsOnGroups

      private String[] m_dependsOnGroups
    • m_dependsOnMethods

      private String[] m_dependsOnMethods
    • m_description

      private String m_description
    • m_priority

      private int m_priority
    • m_timeOut

      private long m_timeOut
  • Constructor Details

    • TestOrConfiguration

      public TestOrConfiguration()
  • Method Details

    • getGroups

      public String[] getGroups()
      Specified by:
      getGroups in interface ITestOrConfiguration
      Returns:
      The list of groups this class/method belongs to.
    • getEnabled

      public boolean getEnabled()
      Description copied from interface: IParameterizable
      Whether this annotation is enabled.
      Specified by:
      getEnabled in interface IParameterizable
      Returns:
      true if enabled
    • setDependsOnGroups

      public void setDependsOnGroups(String[] dependsOnGroups)
      Specified by:
      setDependsOnGroups in interface ITestOrConfiguration
    • setDependsOnMethods

      public void setDependsOnMethods(String[] dependsOnMethods)
      Specified by:
      setDependsOnMethods in interface ITestOrConfiguration
    • setGroups

      public void setGroups(String[] groups)
      Specified by:
      setGroups in interface ITestOrConfiguration
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ITestOrConfiguration
      Returns:
      The description for this method, which will be shown in the reports.
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface IParameterizable
    • getDependsOnGroups

      public String[] getDependsOnGroups()
      Specified by:
      getDependsOnGroups in interface ITestOrConfiguration
      Returns:
      The list of groups this method depends on. Every method member of one of these groups is guaranteed to have been invoked before this method. Furthermore, if any of these methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP.
    • getDependsOnMethods

      public String[] getDependsOnMethods()
      Specified by:
      getDependsOnMethods in interface ITestOrConfiguration
      Returns:
      The list of methods this method depends on. There is no guarantee on the order on which the methods depended upon will be run, but you are guaranteed that all these methods will be run before the test method that contains this annotation is run. Furthermore, if any of these methods was not a SUCCESS, this test method will not be run and will be flagged as a SKIP.

      If some of these methods have been overloaded, all the overloaded versions will be run.

    • setDescription

      public void setDescription(String description)
      Specified by:
      setDescription in interface ITestOrConfiguration
    • getPriority

      public int getPriority()
    • setPriority

      public void setPriority(int priority)
    • setTimeOut

      public void setTimeOut(long timeOut)
      Specified by:
      setTimeOut in interface ITestOrConfiguration
    • getTimeOut

      public long getTimeOut()
      Specified by:
      getTimeOut in interface ITestOrConfiguration
      Returns:
      Returns the maximum number of milliseconds this test should take. If it hasn't returned after this time, it will be marked as a FAIL.