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_r323794957
 
 

 ##########
 File path: 
broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
 ##########
 @@ -509,31 +509,47 @@ public void testExistingConnectionBlocking()
     }
 
     @Test
-    public void testCreateValidation()
+    public void testSelectorNumberMustBePositiveOnCreate()
     {
+        createVirtualHost(getTestName(), 
Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, "1"));
         try
         {
-            createVirtualHost(getTestName(), 
Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS,
-                                                                      "-1"));
-            fail("Exception not thrown for negative number of selectors");
+            createVirtualHost(getTestName(), 
Collections.singletonMap(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, "0"));
+            fail("Exception not thrown for non-positive number of selectors");
         }
         catch (IllegalConfigurationException e)
         {
             // pass
         }
+    }
+
+    @Test
+    public void testConnectionThreadPoolSizeMustBePositiveOnCreate()
+    {
+        final Map<String, Object> vhAttributes = new HashMap<>();
+        vhAttributes.put(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE, 
1);
+        vhAttributes.put(QueueManagingVirtualHost.NUMBER_OF_SELECTORS, 1);
+        createVirtualHost(getTestName(), vhAttributes);
         try
         {
-            createVirtualHost(getTestName(), 
Collections.singletonMap(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE, 
"-1"));
-            fail("Exception not thrown for negative connection thread pool 
size");
+            createVirtualHost(getTestName(), 
Collections.singletonMap(QueueManagingVirtualHost.CONNECTION_THREAD_POOL_SIZE, 
"0"));
+            fail("Exception not thrown for non-positive connection thread pool 
size");
         }
         catch (IllegalConfigurationException e)
         {
             // pass
         }
+    }
+
+    @Test
+    public void testSelectorNumberMustBeLessOrEqualToThePoolSizeOnCreate()
 
 Review comment:
   I would like to suggest splitting positive and negative tests into separate 
methods

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

Reply via email to