Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7E971822D for ; Mon, 3 Aug 2015 12:25:06 +0000 (UTC) Received: (qmail 67823 invoked by uid 500); 3 Aug 2015 12:24:44 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 67701 invoked by uid 500); 3 Aug 2015 12:24:44 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 67577 invoked by uid 99); 3 Aug 2015 12:24:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2015 12:24:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 73F98E01CA; Mon, 3 Aug 2015 12:24:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Mon, 03 Aug 2015 12:24:46 -0000 Message-Id: <92983f1eee424e0e9a656d18f2592e36@git.apache.org> In-Reply-To: <8b9eafc7f2db4815b4276c749d346abc@git.apache.org> References: <8b9eafc7f2db4815b4276c749d346abc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] activemq-artemis git commit: Fix NPE in management test Fix NPE in management test Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ecc2cecf Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ecc2cecf Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ecc2cecf Branch: refs/heads/master Commit: ecc2cecf87e6f529a9afef96795b78d13c530332 Parents: 5e2a405 Author: jbertram Authored: Thu Jul 30 10:35:20 2015 -0500 Committer: Clebert Suconic Committed: Mon Aug 3 08:24:28 2015 -0400 ---------------------------------------------------------------------- .../integration/management/CoreMessagingProxy.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ecc2cecf/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/CoreMessagingProxy.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/CoreMessagingProxy.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/CoreMessagingProxy.java index fdd446a..1f13b20 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/CoreMessagingProxy.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/CoreMessagingProxy.java @@ -94,13 +94,20 @@ public class CoreMessagingProxy ClientMessage m = session.createMessage(false); ManagementHelper.putOperationInvocation(m, resourceName, operationName, args); ClientMessage reply = requestor.request(m); - if (ManagementHelper.hasOperationSucceeded(reply)) + if (reply != null) { - return ManagementHelper.getResult(reply); + if (ManagementHelper.hasOperationSucceeded(reply)) + { + return ManagementHelper.getResult(reply); + } + else + { + throw new Exception((String) ManagementHelper.getResult(reply)); + } } else { - throw new Exception((String)ManagementHelper.getResult(reply)); + return null; } }