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 
ConfigurationAnnotation()35   public ConfigurationAnnotation() {
36 
37   }
38 
setAfterSuite(boolean afterSuite)39   public void setAfterSuite(boolean afterSuite) {
40     m_afterSuite = afterSuite;
41   }
42 
setAfterTest(boolean afterTest)43   public void setAfterTest(boolean afterTest) {
44     m_afterTest = afterTest;
45   }
46 
setAfterTestClass(boolean afterTestClass)47   public void setAfterTestClass(boolean afterTestClass) {
48     m_afterTestClass = afterTestClass;
49   }
50 
setAfterTestMethod(boolean afterTestMethod)51   public void setAfterTestMethod(boolean afterTestMethod) {
52     m_afterTestMethod = afterTestMethod;
53   }
54 
setAlwaysRun(boolean alwaysRun)55   public void setAlwaysRun(boolean alwaysRun) {
56     m_alwaysRun = alwaysRun;
57   }
58 
setBeforeSuite(boolean beforeSuite)59   public void setBeforeSuite(boolean beforeSuite) {
60     m_beforeSuite = beforeSuite;
61   }
62 
setBeforeTest(boolean beforeTest)63   public void setBeforeTest(boolean beforeTest) {
64     m_beforeTest = beforeTest;
65   }
66 
setBeforeTestClass(boolean beforeTestClass)67   public void setBeforeTestClass(boolean beforeTestClass) {
68     m_beforeTestClass = beforeTestClass;
69   }
70 
setBeforeTestMethod(boolean beforeTestMethod)71   public void setBeforeTestMethod(boolean beforeTestMethod) {
72     m_beforeTestMethod = beforeTestMethod;
73   }
74 
setInheritGroups(boolean inheritGroups)75   public void setInheritGroups(boolean inheritGroups) {
76     m_inheritGroups = inheritGroups;
77   }
78 
79   @Override
setParameters(String[] parameters)80   public void setParameters(String[] parameters) {
81     m_parameters = parameters;
82   }
83 
84   @Override
getBeforeTestClass()85   public boolean getBeforeTestClass() {
86     return m_beforeTestClass;
87   }
88 
89   @Override
getAfterTestClass()90   public boolean getAfterTestClass() {
91     return m_afterTestClass;
92   }
93 
94   @Override
getBeforeTestMethod()95   public boolean getBeforeTestMethod() {
96     return m_beforeTestMethod;
97   }
98 
99   @Override
getAfterTestMethod()100   public boolean getAfterTestMethod() {
101     return m_afterTestMethod;
102   }
103 
104   @Override
getBeforeSuite()105   public boolean getBeforeSuite() {
106     return m_beforeSuite;
107   }
108 
109   @Override
getAfterSuite()110   public boolean getAfterSuite() {
111     return m_afterSuite;
112   }
113 
114   @Override
getBeforeTest()115   public boolean getBeforeTest() {
116     return m_beforeTest;
117   }
118 
119   @Override
getAfterTest()120   public boolean getAfterTest() {
121     return m_afterTest;
122   }
123 
124   @Override
getParameters()125   public String[] getParameters() {
126     return m_parameters;
127   }
128 
129   @Override
getAlwaysRun()130   public boolean getAlwaysRun() {
131     return m_alwaysRun;
132   }
133 
134   @Override
getInheritGroups()135   public boolean getInheritGroups() {
136     return m_inheritGroups;
137   }
138 
139   @Override
getAfterGroups()140   public String[] getAfterGroups() {
141     return m_afterGroups;
142   }
143 
setAfterGroups(String[] afterGroups)144   public void setAfterGroups(String[] afterGroups) {
145     m_afterGroups = afterGroups;
146   }
147 
148   @Override
getBeforeGroups()149   public String[] getBeforeGroups() {
150     return m_beforeGroups;
151   }
152 
setBeforeGroups(String[] beforeGroups)153   public void setBeforeGroups(String[] beforeGroups) {
154     m_beforeGroups = beforeGroups;
155   }
156 
setFakeConfiguration(boolean b)157   public void setFakeConfiguration(boolean b) {
158     m_isFakeConfiguration = b;
159   }
160 
161   @Override
isFakeConfiguration()162   public boolean isFakeConfiguration() {
163     return m_isFakeConfiguration;
164   }
165 
setFirstTimeOnly(boolean f)166   public void setFirstTimeOnly(boolean f) {
167     m_firstTimeOnly = f;
168   }
169 
isFirstTimeOnly()170   public boolean isFirstTimeOnly() {
171     return m_firstTimeOnly;
172   }
173 
setLastTimeOnly(boolean f)174   public void setLastTimeOnly(boolean f) {
175     m_lastTimeOnly = f;
176   }
177 
isLastTimeOnly()178   public boolean isLastTimeOnly() {
179     return m_lastTimeOnly;
180   }
181 }
182