本文整理汇总了Java中javax.management.modelmbean.ModelMBeanInfo.getOperation方法的典型用法代码示例。如果您正苦于以下问题:Java ModelMBeanInfo.getOperation方法的具体用法?Java ModelMBeanInfo.getOperation怎么用?Java ModelMBeanInfo.getOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.modelmbean.ModelMBeanInfo
的用法示例。
在下文中一共展示了ModelMBeanInfo.getOperation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAttributeHasCorrespondingOperations
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testAttributeHasCorrespondingOperations() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo get = info.getOperation("getName");
assertNotNull("get operation should not be null", get);
assertEquals("get operation should have visibility of four",
get.getDescriptor().getFieldValue("visibility"),
new Integer(4));
assertEquals("get operation should have role \"getter\"", "getter", get.getDescriptor().getFieldValue("role"));
ModelMBeanOperationInfo set = info.getOperation("setName");
assertNotNull("set operation should not be null", set);
assertEquals("set operation should have visibility of four",
set.getDescriptor().getFieldValue("visibility"),
new Integer(4));
assertEquals("set operation should have role \"setter\"", "setter", set.getDescriptor().getFieldValue("role"));
}
示例2: testOperationParameterMetadata
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationParameterMetadata() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo oper = info.getOperation("add");
MBeanParameterInfo[] params = oper.getSignature();
assertEquals("Invalid number of params", 2, params.length);
assertEquals("Incorrect name for x param", "x", params[0].getName());
assertEquals("Incorrect type for x param", int.class.getName(), params[0].getType());
assertEquals("Incorrect name for y param", "y", params[1].getName());
assertEquals("Incorrect type for y param", int.class.getName(), params[1].getType());
}
示例3: testMetricDescription
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testMetricDescription() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo metric = inf.getAttribute(QUEUE_SIZE_METRIC);
ModelMBeanOperationInfo operation = inf.getOperation("getQueueSize");
assertEquals("The description for the queue size metric is incorrect",
"The QueueSize metric", metric.getDescription());
assertEquals("The description for the getter operation of the queue size metric is incorrect",
"The QueueSize metric", operation.getDescription());
}
示例4: testSetNameParameterIsNamed
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testSetNameParameterIsNamed() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
MBeanOperationInfo operationSetAge = info.getOperation("setName");
assertEquals("name", operationSetAge.getSignature()[0].getName());
}
示例5: testOperationFromInterface
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationFromInterface() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo op = inf.getOperation("fromInterface");
assertNotNull(op);
}
示例6: testOperationOnGetter
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationOnGetter() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo op = inf.getOperation("getExpensiveToCalculate");
assertNotNull(op);
}