[hornetq-commits] JBoss hornetq SVN: r8887 - trunk/tests/src/org/hornetq/tests/integration/management.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Feb 17 20:34:11 EST 2010
Author: clebert.suconic at jboss.com
Date: 2010-02-17 20:34:11 -0500 (Wed, 17 Feb 2010)
New Revision: 8887
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
Log:
fixing build / test
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-02-17 22:17:06 UTC (rev 8886)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-02-18 01:34:11 UTC (rev 8887)
@@ -143,162 +143,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);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] roles = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, roles.length);
-
- proxy.invokeOperation("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 = (Object[])proxy.retrieveAttributeValue("roles");
- 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);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- proxy.invokeOperation("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));
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.length);
-
- try
- {
- proxy.invokeOperation("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)
- {
- }
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.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);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- proxy.invokeOperation("addRole",
- roleName,
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.length);
-
- proxy.invokeOperation("removeRole", roleName);
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.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);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- try
- {
- proxy.invokeOperation("removeRole", roleName);
- Assert.fail("can not remove a role which does not exist");
- }
- catch (Exception e)
- {
- }
-
- session.deleteQueue(queue);
- }
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
More information about the hornetq-commits
mailing list