[hornetq-commits] JBoss hornetq SVN: r8886 - trunk/tests/src/org/hornetq/tests/integration/management.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Feb 17 17:17:06 EST 2010
Author: clebert.suconic at jboss.com
Date: 2010-02-17 17:17:06 -0500 (Wed, 17 Feb 2010)
New Revision: 8886
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
Log:
Integration work
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-02-17 22:13:31 UTC (rev 8885)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-02-17 22:17:06 UTC (rev 8886)
@@ -177,158 +177,6 @@
session.deleteQueue(queue);
}
- public void testAddRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] roles = addressControl.getRoles();
- Assert.assertEquals(0, roles.length);
-
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- roles = addressControl.getRoles();
- Assert.assertEquals(1, roles.length);
- Object[] r = (Object[])roles[0];
- Assert.assertEquals(role.getName(), r[0]);
- Assert.assertEquals(CheckType.SEND.hasRole(role), r[1]);
- Assert.assertEquals(CheckType.CONSUME.hasRole(role), r[2]);
- Assert.assertEquals(CheckType.CREATE_DURABLE_QUEUE.hasRole(role), r[3]);
- Assert.assertEquals(CheckType.DELETE_DURABLE_QUEUE.hasRole(role), r[4]);
- Assert.assertEquals(CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role), r[5]);
- Assert.assertEquals(CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role), r[6]);
- Assert.assertEquals(CheckType.MANAGE.hasRole(role), r[7]);
-
- session.deleteQueue(queue);
- }
-
- public void testAddRoleWhichAlreadyExists() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- try
- {
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
- Assert.fail("can not add a role which already exists");
- }
- catch (Exception e)
- {
- }
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- addressControl.addRole(roleName,
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- addressControl.removeRole(roleName);
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRoleWhichDoesNotExist() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- try
- {
- addressControl.removeRole(roleName);
- Assert.fail("can not remove a role which does not exist");
- }
- catch (Exception e)
- {
- }
-
- session.deleteQueue(queue);
- }
-
public void testGetNumberOfPages() throws Exception
{
session.close();
More information about the hornetq-commits
mailing list