KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > compliance > standard > SpuriousAttributeTEST


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package test.compliance.standard;
9
10 import junit.framework.TestCase;
11
12 import javax.management.MBeanAttributeInfo;
13 import javax.management.MBeanInfo;
14
15 /**
16  * @author <a HREF="mailto:trevor@protocool.com">Trevor Squires</a>.
17  */

18
19 public class SpuriousAttributeTEST extends TestCase
20 {
21    private String failureHint;
22    private MBeanInfo info;
23    private String attributeName;
24
25    public SpuriousAttributeTEST(String failureHint, MBeanInfo info, String attributeName)
26    {
27       super("testForSpuriousAttribute");
28       this.failureHint = failureHint;
29       this.info = info;
30       this.attributeName = attributeName;
31    }
32
33    public void testForSpuriousAttribute()
34    {
35       MBeanAttributeInfo[] attributes = info.getAttributes();
36       assertNull(failureHint + ": attribute " + info.getClassName() + ": " + attributeName + " should not be present",
37                  InfoUtil.findAttribute(attributes, attributeName));
38    }
39 }
40
Popular Tags