01: package test.access;
02:
03: import org.testng.Assert;
04:
05: import test.BasePrivateAccessConfigurationMethods;
06:
07: public class PrivateAccessConfigurationMethods extends
08: BaseSamePackagePrivateAccessConfigurationMethods {
09: private boolean m_private = false;
10: private boolean m_default = false;
11: private boolean m_protected = false;
12: private boolean m_public = false;
13:
14: /**
15: * @testng.before-method
16: */
17: private void privateConfBeforeMethod() {
18: m_private = true;
19: }
20:
21: /**
22: * @testng.before-method
23: */
24: void defaultConfBeforeMethod() {
25: m_default = true;
26: }
27:
28: /**
29: * @testng.before-method
30: */
31: protected void protectedConfBeforeMethod() {
32: m_protected = true;
33: }
34:
35: /**
36: * @testng.before-method
37: */
38: public void publicConfBeforeMethod() {
39: m_public = true;
40: }
41:
42: /**
43: * @testng.test
44: */
45: public void allAccessModifiersConfiguration() {
46: Assert.assertTrue(m_private,
47: "private @Configuration should have been run");
48: Assert.assertTrue(m_default,
49: "default @Configuration should have been run");
50: Assert.assertTrue(m_protected,
51: "protected @Configuration should have been run");
52: Assert.assertTrue(m_public,
53: "public @Configuration should have been run");
54:
55: Assert.assertTrue(m_samePackagePublic,
56: "public base @Configuration should have been run");
57: Assert.assertTrue(m_samePackageProtected,
58: "protected base @Configuration should have been run");
59: Assert.assertTrue(m_samePackageDefault,
60: "default base @Configuration should have been run");
61: Assert.assertTrue(m_samePackagePrivate,
62: "private base @Configuration should not have been run");
63:
64: Assert
65: .assertTrue(m_basePublic,
66: "public external base @Configuration should have been run");
67: Assert
68: .assertTrue(m_baseProtected,
69: "protected external base @Configuration should have been run");
70: Assert
71: .assertTrue(m_baseDefault,
72: "default external base @Configuration should not have been run");
73: Assert
74: .assertTrue(m_basePrivate,
75: "private external base @Configuration should not have been run");
76: }
77: }
|