Home | History | Annotate | Download | only in annotations
      1 package org.testng.internal.annotations;
      2 
      3 import org.testng.annotations.IConfigurationAnnotation;
      4 
      5 
      6 /**
      7  * An implementation of IConfiguration
      8  *
      9  * Created on Dec 16, 2005
     10  * @author cbeust
     11  */
     12 public class ConfigurationAnnotation extends TestOrConfiguration implements IConfigurationAnnotation,
     13     IBeforeSuite, IAfterSuite,
     14     IBeforeTest, IAfterTest,
     15     IBeforeGroups, IAfterGroups,
     16     IBeforeClass, IAfterClass,
     17     IBeforeMethod, IAfterMethod {
     18   private boolean m_beforeTestClass = false;
     19   private boolean m_afterTestClass = false;
     20   private boolean m_beforeTestMethod = false;
     21   private boolean m_afterTestMethod = false;
     22   private boolean m_beforeTest = false;
     23   private boolean m_afterTest = false;
     24   private boolean m_beforeSuite = false;
     25   private boolean m_afterSuite = false;
     26   private String[] m_parameters = {};
     27   private boolean m_alwaysRun = false;
     28   private boolean m_inheritGroups = true;
     29   private String[] m_beforeGroups = {};
     30   private String[] m_afterGroups = {};
     31   private boolean m_isFakeConfiguration;
     32   private boolean m_firstTimeOnly = false;
     33   private boolean m_lastTimeOnly = false;
     34 
     35   public ConfigurationAnnotation() {
     36 
     37   }
     38 
     39   public void setAfterSuite(boolean afterSuite) {
     40     m_afterSuite = afterSuite;
     41   }
     42 
     43   public void setAfterTest(boolean afterTest) {
     44     m_afterTest = afterTest;
     45   }
     46 
     47   public void setAfterTestClass(boolean afterTestClass) {
     48     m_afterTestClass = afterTestClass;
     49   }
     50 
     51   public void setAfterTestMethod(boolean afterTestMethod) {
     52     m_afterTestMethod = afterTestMethod;
     53   }
     54 
     55   public void setAlwaysRun(boolean alwaysRun) {
     56     m_alwaysRun = alwaysRun;
     57   }
     58 
     59   public void setBeforeSuite(boolean beforeSuite) {
     60     m_beforeSuite = beforeSuite;
     61   }
     62 
     63   public void setBeforeTest(boolean beforeTest) {
     64     m_beforeTest = beforeTest;
     65   }
     66 
     67   public void setBeforeTestClass(boolean beforeTestClass) {
     68     m_beforeTestClass = beforeTestClass;
     69   }
     70 
     71   public void setBeforeTestMethod(boolean beforeTestMethod) {
     72     m_beforeTestMethod = beforeTestMethod;
     73   }
     74 
     75   public void setInheritGroups(boolean inheritGroups) {
     76     m_inheritGroups = inheritGroups;
     77   }
     78 
     79   @Override
     80   public void setParameters(String[] parameters) {
     81     m_parameters = parameters;
     82   }
     83 
     84   @Override
     85   public boolean getBeforeTestClass() {
     86     return m_beforeTestClass;
     87   }
     88 
     89   @Override
     90   public boolean getAfterTestClass() {
     91     return m_afterTestClass;
     92   }
     93 
     94   @Override
     95   public boolean getBeforeTestMethod() {
     96     return m_beforeTestMethod;
     97   }
     98 
     99   @Override
    100   public boolean getAfterTestMethod() {
    101     return m_afterTestMethod;
    102   }
    103 
    104   @Override
    105   public boolean getBeforeSuite() {
    106     return m_beforeSuite;
    107   }
    108 
    109   @Override
    110   public boolean getAfterSuite() {
    111     return m_afterSuite;
    112   }
    113 
    114   @Override
    115   public boolean getBeforeTest() {
    116     return m_beforeTest;
    117   }
    118 
    119   @Override
    120   public boolean getAfterTest() {
    121     return m_afterTest;
    122   }
    123 
    124   @Override
    125   public String[] getParameters() {
    126     return m_parameters;
    127   }
    128 
    129   @Override
    130   public boolean getAlwaysRun() {
    131     return m_alwaysRun;
    132   }
    133 
    134   @Override
    135   public boolean getInheritGroups() {
    136     return m_inheritGroups;
    137   }
    138 
    139   @Override
    140   public String[] getAfterGroups() {
    141     return m_afterGroups;
    142   }
    143 
    144   public void setAfterGroups(String[] afterGroups) {
    145     m_afterGroups = afterGroups;
    146   }
    147 
    148   @Override
    149   public String[] getBeforeGroups() {
    150     return m_beforeGroups;
    151   }
    152 
    153   public void setBeforeGroups(String[] beforeGroups) {
    154     m_beforeGroups = beforeGroups;
    155   }
    156 
    157   public void setFakeConfiguration(boolean b) {
    158     m_isFakeConfiguration = b;
    159   }
    160 
    161   @Override
    162   public boolean isFakeConfiguration() {
    163     return m_isFakeConfiguration;
    164   }
    165 
    166   public void setFirstTimeOnly(boolean f) {
    167     m_firstTimeOnly = f;
    168   }
    169 
    170   public boolean isFirstTimeOnly() {
    171     return m_firstTimeOnly;
    172   }
    173 
    174   public void setLastTimeOnly(boolean f) {
    175     m_lastTimeOnly = f;
    176   }
    177 
    178   public boolean isLastTimeOnly() {
    179     return m_lastTimeOnly;
    180   }
    181 }
    182