alex-rufous commented on a change in pull request #34: QPID-7615 Number of
selectors can be equal to connection thread pool size
URL: https://github.com/apache/qpid-broker-j/pull/34#discussion_r323797158
##########
File path:
broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
##########
@@ -542,32 +558,50 @@ public void testCreateValidation()
}
@Test
- public void testChangeValidation()
+ public void testSelectorNumberMustBePositiveOnChange()
{
- QueueManagingVirtualHost<?> virtualHost =
createVirtualHost(getTestName());
+ final QueueManagingVirtualHost<?> virtualHost =
createVirtualHost(getTestName());
+
virtualHost.setAttributes(Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
"1"));
try
{
- virtualHost.setAttributes(Collections.<String,
Object>singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, "-1"));
- fail("Exception not thrown for negative number of selectors");
+
virtualHost.setAttributes(Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
"0"));
+ fail("Exception not thrown for non-positive number of selectors");
}
catch (IllegalConfigurationException e)
{
// pass
}
+ }
+
+ @Test
+ public void testConnectionThreadPoolSizeMustBePositiveOnChange()
+ {
+ final QueueManagingVirtualHost<?> virtualHost =
createVirtualHost(getTestName());
+ final Map<String, Object> vhAttributes = new HashMap<>();
+ vhAttributes.put(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE,
1);
+ vhAttributes.put(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, 1);
+ virtualHost.setAttributes(vhAttributes);
Review comment:
The test can be strengthen with asserts verifying that specified values are
indeed set on the corresponding attributes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]