1 22 package org.jboss.test.jmx.compliance.standard; 23 24 import javax.management.MBeanAttributeInfo ; 25 import javax.management.MBeanInfo ; 26 27 import junit.framework.TestCase; 28 29 32 33 public class AttributeInfoTEST extends TestCase 34 { 35 private String failureHint; 36 private MBeanInfo info; 37 private String attributeName; 38 private String type; 39 private boolean read; 40 private boolean write; 41 private boolean is; 42 43 public AttributeInfoTEST(String failureHint, MBeanInfo info, String attributeName, String type, boolean read, boolean write, boolean is) 44 { 45 super("testValidAttribute"); 46 this.failureHint = failureHint; 47 this.info = info; 48 this.attributeName = attributeName; 49 this.type = type; 50 this.read= read; 51 this.write= write; 52 this.is= is; 53 } 54 55 public void testValidAttribute() 56 { 57 MBeanAttributeInfo [] attributes = info.getAttributes(); 58 MBeanAttributeInfo attribute = InfoUtil.findAttribute(attributes, attributeName); 59 60 assertNotNull(failureHint + ": " + info.getClassName() + ": " + attributeName + " was not found", attribute); 61 assertEquals(failureHint + ": " + info.getClassName() + ": " + attributeName + " type", type, attribute.getType()); 62 assertEquals(failureHint + ": " + info.getClassName() + ": " + attributeName + " readable", read, attribute.isReadable()); 63 assertEquals(failureHint + ": " + info.getClassName() + ": " + attributeName + " writable", write, attribute.isWritable()); 64 assertEquals(failureHint + ": " + info.getClassName() + ": " + attributeName + " isIS", is, attribute.isIs()); 65 } 66 } 67 | Popular Tags |