[GitHub] activemq-artemis pull request #673: ARTEMIS-565 more JSON fixes

2016-07-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/activemq-artemis/pull/673


---
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.
---


[GitHub] activemq-artemis pull request #673: ARTEMIS-565 more JSON fixes

2016-07-27 Thread clebertsuconic
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.
---


[GitHub] activemq-artemis pull request #673: ARTEMIS-565 more JSON fixes

2016-07-27 Thread jbertram
GitHub user jbertram opened a pull request:

https://github.com/apache/activemq-artemis/pull/673

ARTEMIS-565 more JSON fixes



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jbertram/activemq-artemis JSONfixes

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/673.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #673






---
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.
---