1 22 package org.jboss.test.jbossmx.compliance.standard; 23 24 import junit.framework.TestCase; 25 26 import javax.management.MBeanInfo ; 27 import javax.management.MBeanOperationInfo ; 28 29 32 33 public class OperationInfoTEST extends TestCase 34 { 35 private String failureHint; 36 private MBeanInfo info; 37 private String operationName; 38 private int impact; 39 private String returnType; 40 private String signatureString; 41 42 public OperationInfoTEST(String failureHint, MBeanInfo info, String operationName, int impact, String returnType, String [] signature) 43 { 44 super("testValidOperation"); 45 this.failureHint = failureHint; 46 this.info = info; 47 this.operationName = operationName; 48 this.impact = impact; 49 this.returnType = returnType; 50 this.signatureString = InfoUtil.makeSignatureString(signature); 51 } 52 53 public void testValidOperation() 54 { 55 MBeanOperationInfo [] operations = info.getOperations(); 56 57 MBeanOperationInfo foundOperation = null; 58 59 for (int i = 0; i < operations.length; i++) 60 { 61 if (operations[i].getName().equals(operationName)) 62 { 63 if (signatureString.equals(InfoUtil.makeSignatureString(operations[i].getSignature()))) 64 { 65 foundOperation = operations[i]; 66 break; 67 } 68 } 69 } 70 71 assertNotNull(failureHint + ": " + info.getClassName() + "." + operationName + signatureString + " was not found", foundOperation); 72 assertEquals(failureHint + ": " + info.getClassName() + "." + operationName + signatureString + " impact", impact, foundOperation.getImpact()); 73 assertEquals(failureHint + ": " + info.getClassName() + "." + operationName + signatureString + " returnType", returnType, foundOperation.getReturnType()); 74 } 75 } 76 | Popular Tags |