You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ma...@apache.org on 2016/12/16 15:05:33 UTC
[1/3] activemq-artemis git commit: ARTEMIS-878 Fix compilation and
tests
Repository: activemq-artemis
Updated Branches:
refs/heads/master 749db2596 -> be38f4dd4
ARTEMIS-878 Fix compilation and tests
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/03cc566c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/03cc566c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/03cc566c
Branch: refs/heads/master
Commit: 03cc566c5d79e7f766126dcdd99a934c65c9a3b2
Parents: 749db25
Author: Francesco Nigro <ni...@gmail.com>
Authored: Fri Dec 16 15:26:00 2016 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Dec 16 09:34:02 2016 -0500
----------------------------------------------------------------------
.../activemq/artemis/core/postoffice/impl/PostOfficeImpl.java | 2 +-
.../artemis/tests/integration/cli/QueueCommandTest.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/03cc566c/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
index 60a6ffa..3decd14 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
@@ -469,7 +469,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
final Queue queue = queueBinding.getQueue();
//TODO put the whole update logic on Queue
//validate update
- if (maxConsumers != null) {
+ if (maxConsumers != null && maxConsumers.intValue() != Queue.MAX_CONSUMERS_UNLIMITED) {
final int consumerCount = queue.getConsumerCount();
if (consumerCount > maxConsumers) {
throw ActiveMQMessageBundle.BUNDLE.invalidMaxConsumersUpdate(name.toString(), maxConsumers, consumerCount);
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/03cc566c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
index c254eed..d578154 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
@@ -257,7 +257,8 @@ public class QueueCommandTest extends JMSTestBase {
final UpdateQueue updateQueue = new UpdateQueue();
updateQueue.setName(queueName);
updateQueue.setDeleteOnNoConsumers(newDeleteOnNoConsumers);
- updateQueue.setRoutingType(newRoutingType.name());
+ updateQueue.setMulticast(newRoutingType.equals(RoutingType.MULTICAST));
+ updateQueue.setAnycast(newRoutingType.equals(RoutingType.ANYCAST));
updateQueue.setMaxConsumers(newMaxConsumers);
updateQueue.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
@@ -286,7 +287,8 @@ public class QueueCommandTest extends JMSTestBase {
final RoutingType newRoutingType = RoutingType.ANYCAST;
final UpdateQueue updateQueue = new UpdateQueue();
updateQueue.setName(queueName);
- updateQueue.setRoutingType(newRoutingType.name());
+ updateQueue.setMulticast(newRoutingType.equals(RoutingType.MULTICAST));
+ updateQueue.setAnycast(newRoutingType.equals(RoutingType.ANYCAST));
updateQueue.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
final String expectedErrorMessage = MessageFormat.format("Can''t update queue {0} with routing type: {1}, Supported routing types for address: {2} are {3}", queueName, newRoutingType, addressName, supportedRoutingTypes);
[3/3] activemq-artemis git commit: This closes #932
Posted by ma...@apache.org.
This closes #932
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/be38f4dd
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/be38f4dd
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/be38f4dd
Branch: refs/heads/master
Commit: be38f4dd453df740248f6b79676692b0bcf914e2
Parents: 749db25 e1577e2
Author: Martyn Taylor <mt...@redhat.com>
Authored: Fri Dec 16 15:05:08 2016 +0000
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Fri Dec 16 15:05:08 2016 +0000
----------------------------------------------------------------------
.../artemis/cli/commands/queue/CreateQueue.java | 2 +-
.../cli/commands/queue/QueueAbstract.java | 7 +++++--
.../artemis/cli/commands/queue/UpdateQueue.java | 2 +-
.../core/postoffice/impl/PostOfficeImpl.java | 2 +-
.../tests/integration/cli/QueueCommandTest.java | 21 ++++++++++----------
5 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
[2/3] activemq-artemis git commit: ARTEMIS-878 test fixes
Posted by ma...@apache.org.
ARTEMIS-878 test fixes
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e1577e23
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e1577e23
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e1577e23
Branch: refs/heads/master
Commit: e1577e230a472bf6bdbade7cbcbc0c5da56aedff
Parents: 03cc566
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Dec 16 09:26:54 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Dec 16 09:37:46 2016 -0500
----------------------------------------------------------------------
.../artemis/cli/commands/queue/CreateQueue.java | 2 +-
.../cli/commands/queue/QueueAbstract.java | 7 ++++--
.../artemis/cli/commands/queue/UpdateQueue.java | 2 +-
.../tests/integration/cli/QueueCommandTest.java | 23 ++++++++++----------
4 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e1577e23/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
index a76b3c6..93c8e78 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/CreateQueue.java
@@ -37,7 +37,7 @@ public class CreateQueue extends QueueAbstract {
@Override
public void setUpInvocation(ClientMessage message) throws Exception {
String address = getAddress();
- ManagementHelper.putOperationInvocation(message, "broker", "createQueue", address, getRoutingType(), getName(), getFilter(), isDurable(), getMaxConsumers(), treatNoConsumers(true), isAutoCreateAddress());
+ ManagementHelper.putOperationInvocation(message, "broker", "createQueue", address, getRoutingType(), getName(), getFilter(), isDurable(), getMaxConsumers(-1), treatNoConsumers(true), isAutoCreateAddress());
}
@Override
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e1577e23/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAbstract.java
index beeb179..1e0da90 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/QueueAbstract.java
@@ -41,7 +41,7 @@ public class QueueAbstract extends AbstractAction {
private boolean keepOnNoConsumers = false;
@Option(name = "--max-consumers", description = "Maximum number of consumers allowed on this queue at any one time (default no limit)")
- private int maxConsumers = -1;
+ private Integer maxConsumers;
@Option(name = "--auto-create-ddress", description = "Auto create the address (if it doesn't exist) with default values")
private Boolean autoCreateAddress = false;
@@ -89,7 +89,10 @@ public class QueueAbstract extends AbstractAction {
return this;
}
- public int getMaxConsumers() {
+ public Integer getMaxConsumers(Integer defaultValue) {
+ if (maxConsumers == null) {
+ return defaultValue;
+ }
return maxConsumers;
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e1577e23/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java
index b134269..cb4d89f 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java
@@ -36,7 +36,7 @@ public class UpdateQueue extends QueueAbstract {
performCoreManagement(new ManagementCallback<ClientMessage>() {
@Override
public void setUpInvocation(ClientMessage message) throws Exception {
- ManagementHelper.putOperationInvocation(message, "broker", "updateQueue", getName(), getRoutingType(), getMaxConsumers(), isDeleteOnNoConsumers());
+ ManagementHelper.putOperationInvocation(message, "broker", "updateQueue", getName(), getRoutingType(), getMaxConsumers(null), isDeleteOnNoConsumers());
}
@Override
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e1577e23/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
index d578154..ed9f147 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java
@@ -59,7 +59,7 @@ public class QueueCommandTest extends JMSTestBase {
command.setMulticast(true);
command.setAnycast(false);
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:");
+ checkExecutionFailure(command, "AMQ119203");
assertFalse(server.queueQuery(new SimpleString(queueName)).isExists());
}
@@ -137,7 +137,7 @@ public class QueueCommandTest extends JMSTestBase {
command.setAnycast(false);
command.execute(new ActionContext());
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- checkExecutionFailure(command, "AMQ119019: Queue already exists " + queueName);
+ checkExecutionFailure(command, "AMQ119019");
}
@Test
@@ -167,7 +167,7 @@ public class QueueCommandTest extends JMSTestBase {
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- checkExecutionFailure(delete, "AMQ119017: Queue " + queueName + " does not exist");
+ checkExecutionFailure(delete, "AMQ119017");
assertFalse(server.queueQuery(queueName).isExists());
}
@@ -189,7 +189,7 @@ public class QueueCommandTest extends JMSTestBase {
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- checkExecutionFailure(delete, "AMQ119025: Cannot delete queue " + queueName + " on binding deleteQueue");
+ checkExecutionFailure(delete, "AMQ119025");
}
@Test
@@ -257,8 +257,8 @@ public class QueueCommandTest extends JMSTestBase {
final UpdateQueue updateQueue = new UpdateQueue();
updateQueue.setName(queueName);
updateQueue.setDeleteOnNoConsumers(newDeleteOnNoConsumers);
- updateQueue.setMulticast(newRoutingType.equals(RoutingType.MULTICAST));
- updateQueue.setAnycast(newRoutingType.equals(RoutingType.ANYCAST));
+ updateQueue.setAnycast(true);
+ updateQueue.setMulticast(false);
updateQueue.setMaxConsumers(newMaxConsumers);
updateQueue.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
@@ -287,12 +287,12 @@ public class QueueCommandTest extends JMSTestBase {
final RoutingType newRoutingType = RoutingType.ANYCAST;
final UpdateQueue updateQueue = new UpdateQueue();
updateQueue.setName(queueName);
- updateQueue.setMulticast(newRoutingType.equals(RoutingType.MULTICAST));
- updateQueue.setAnycast(newRoutingType.equals(RoutingType.ANYCAST));
+ updateQueue.setAnycast(true);
+ updateQueue.setMulticast(false);
+ updateQueue.setMaxConsumers(-1);
updateQueue.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- final String expectedErrorMessage = MessageFormat.format("Can''t update queue {0} with routing type: {1}, Supported routing types for address: {2} are {3}", queueName, newRoutingType, addressName, supportedRoutingTypes);
- checkExecutionFailure(updateQueue, expectedErrorMessage);
+ checkExecutionFailure(updateQueue, "AMQ119211");
final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString);
assertEquals("maxConsumers", oldMaxConsumers, queueQueryResult.getMaxConsumers());
@@ -322,8 +322,7 @@ public class QueueCommandTest extends JMSTestBase {
updateQueue.setMaxConsumers(newMaxConsumers);
updateQueue.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
- final String expectedErrorMessage = MessageFormat.format("Can''t update queue {0} with maxConsumers: {1}. Current consumers are {2}.", queueName, newMaxConsumers, 2);
- checkExecutionFailure(updateQueue, expectedErrorMessage);
+ checkExecutionFailure(updateQueue, "AMQ119210");
final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString);
assertEquals("maxConsumers", oldMaxConsumers, queueQueryResult.getMaxConsumers());