29
29
import javax .management .remote .JMXConnectorServerFactory ;
30
30
import javax .management .remote .JMXServiceURL ;
31
31
32
+ import org .junit .Test ;
32
33
import org .springframework .jmx .AbstractMBeanServerTests ;
33
34
import org .springframework .jmx .IJmxTestBean ;
34
35
import org .springframework .jmx .JmxException ;
40
41
* @author Rob Harrop
41
42
* @author Juergen Hoeller
42
43
* @author Sam Brannen
44
+ * @author Chris Beams
43
45
*/
44
46
public class MBeanClientInterceptorTests extends AbstractMBeanServerTests {
45
47
@@ -77,13 +79,15 @@ protected IJmxTestBean getProxy() throws Exception {
77
79
return (IJmxTestBean ) factory .getObject ();
78
80
}
79
81
82
+ @ Test
80
83
public void testProxyClassIsDifferent () throws Exception {
81
84
if (!runTests )
82
85
return ;
83
86
IJmxTestBean proxy = getProxy ();
84
87
assertTrue ("The proxy class should be different than the base class" , (proxy .getClass () != IJmxTestBean .class ));
85
88
}
86
89
90
+ @ Test
87
91
public void testDifferentProxiesSameClass () throws Exception {
88
92
if (!runTests )
89
93
return ;
@@ -94,6 +98,7 @@ public void testDifferentProxiesSameClass() throws Exception {
94
98
assertSame ("The proxy classes should be the same" , proxy1 .getClass (), proxy2 .getClass ());
95
99
}
96
100
101
+ @ Test
97
102
public void testGetAttributeValue () throws Exception {
98
103
if (!runTests )
99
104
return ;
@@ -102,6 +107,7 @@ public void testGetAttributeValue() throws Exception {
102
107
assertEquals ("The age should be 100" , 100 , age );
103
108
}
104
109
110
+ @ Test
105
111
public void testSetAttributeValue () throws Exception {
106
112
if (!runTests )
107
113
return ;
@@ -110,6 +116,7 @@ public void testSetAttributeValue() throws Exception {
110
116
assertEquals ("The name of the bean should have been updated" , "Rob Harrop" , target .getName ());
111
117
}
112
118
119
+ @ Test
113
120
public void testSetAttributeValueWithRuntimeException () throws Exception {
114
121
if (!runTests )
115
122
return ;
@@ -122,6 +129,7 @@ public void testSetAttributeValueWithRuntimeException() throws Exception {
122
129
}
123
130
}
124
131
132
+ @ Test
125
133
public void testSetAttributeValueWithCheckedException () throws Exception {
126
134
if (!runTests )
127
135
return ;
@@ -134,6 +142,7 @@ public void testSetAttributeValueWithCheckedException() throws Exception {
134
142
}
135
143
}
136
144
145
+ @ Test
137
146
public void testSetAttributeValueWithIOException () throws Exception {
138
147
if (!runTests )
139
148
return ;
@@ -146,6 +155,7 @@ public void testSetAttributeValueWithIOException() throws Exception {
146
155
}
147
156
}
148
157
158
+ @ Test
149
159
public void testSetReadOnlyAttribute () throws Exception {
150
160
if (!runTests )
151
161
return ;
@@ -158,6 +168,7 @@ public void testSetReadOnlyAttribute() throws Exception {
158
168
}
159
169
}
160
170
171
+ @ Test
161
172
public void testInvokeNoArgs () throws Exception {
162
173
if (!runTests )
163
174
return ;
@@ -166,6 +177,7 @@ public void testInvokeNoArgs() throws Exception {
166
177
assertEquals ("The operation should return 1" , 1 , result );
167
178
}
168
179
180
+ @ Test
169
181
public void testInvokeArgs () throws Exception {
170
182
if (!runTests )
171
183
return ;
@@ -174,6 +186,7 @@ public void testInvokeArgs() throws Exception {
174
186
assertEquals ("The operation should return 3" , 3 , result );
175
187
}
176
188
189
+ @ Test
177
190
public void testInvokeUnexposedMethodWithException () throws Exception {
178
191
if (!runTests )
179
192
return ;
@@ -186,6 +199,7 @@ public void testInvokeUnexposedMethodWithException() throws Exception {
186
199
}
187
200
}
188
201
202
+ @ Test
189
203
public void testTestLazyConnectionToRemote () throws Exception {
190
204
if (!runTests )
191
205
return ;
0 commit comments