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