Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/673#discussion_r72462809
--- Diff:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java
---
@@ -72,7 +72,7 @@ public boolean expireMessage(final long messageID) throws
Exception {
@Override
public int expireMessages(final String filter) throws Exception {
-return (Integer) proxy.invokeOperation("expireMessages",
filter);
+return ((Number) proxy.invokeOperation("expireMessages",
filter)).intValue();
--- End diff --
I would change the proxy as:
```java
public Object invokeOperation(final String operationName, final
Object... args) throws Exception {
return invokeOperation(null, operationName, args);
}
public Object invokeOperation(final Class desiredType, final String
operationName, final Object... args) throws Exception {
ClientMessage m = session.createMessage(false);
ManagementHelper.putOperationInvocation(m, resourceName,
operationName, args);
ClientMessage reply = requestor.request(m);
if (reply != null) {
if (ManagementHelper.hasOperationSucceeded(reply)) {
return ManagementHelper.getResult(reply, desiredType);
}
else {
throw new Exception((String) ManagementHelper.getResult(reply));
}
}
else {
return null;
}
}
```
and pass in the desiredType on these.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---