[hornetq-commits] JBoss hornetq SVN: r8953 - in trunk: src/main/org/hornetq/core/management/impl and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Mar 24 09:28:10 EDT 2010


Author: ataylor
Date: 2010-03-24 09:28:09 -0400 (Wed, 24 Mar 2010)
New Revision: 8953

Modified:
   trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
   trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
Log:
fixed tests

Modified: trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java	2010-03-24 12:46:38 UTC (rev 8952)
+++ trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java	2010-03-24 13:28:09 UTC (rev 8953)
@@ -498,7 +498,7 @@
    @Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
    void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
 
-   Set<Role> getSecuritySettings(String addressMatch);
+   Set<Role> getSecuritySettings(String addressMatch) throws Exception;
 
    @Operation(desc = "get roles for a specific address match", impact = MBeanOperationInfo.INFO)
    Object[] getRoles(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;

Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2010-03-24 12:46:38 UTC (rev 8952)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2010-03-24 13:28:09 UTC (rev 8953)
@@ -1089,7 +1089,7 @@
       }
    }
 
-   public Set<Role> getSecuritySettings(String addressMatch)
+   public Set<Role> getSecuritySettings(String addressMatch) throws Exception
    {
       clearIO();
       try

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java	2010-03-24 12:46:38 UTC (rev 8952)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java	2010-03-24 13:28:09 UTC (rev 8953)
@@ -300,47 +300,6 @@
       });
    }
 
-   public void testSecuritySettings() throws Exception
-   {
-      JMSServerControl serverControl = createManagementControl();
-      String destination = HornetQDestination.createQueueAddressFromName(randomString()).toString();
-      
-      serverControl.addSecuritySettings(destination, "foo", "foo, bar", "foo", "bar", "foo, bar", "", "");
-      
-      String rolesAsJSON = serverControl.getSecuritySettingsAsJSON(destination);
-      RoleInfo[] roleInfos = RoleInfo.from(rolesAsJSON);
-      assertEquals(2, roleInfos.length);
-      RoleInfo fooRole = null;
-      RoleInfo barRole = null;
-      if (roleInfos[0].getName().equals("foo"))
-      {
-         fooRole = roleInfos[0];
-         barRole = roleInfos[1];
-      }
-      else
-      {
-         fooRole = roleInfos[1];
-         barRole = roleInfos[0];
-      }
-      assertTrue(fooRole.isSend());
-      assertTrue(fooRole.isConsume());
-      assertTrue(fooRole.isCreateDurableQueue());
-      assertFalse(fooRole.isDeleteDurableQueue());
-      assertTrue(fooRole.isCreateNonDurableQueue());
-      assertFalse(fooRole.isDeleteNonDurableQueue());
-      assertFalse(fooRole.isManage());
-   
-      assertFalse(barRole.isSend());
-      assertTrue(barRole.isConsume());
-      assertFalse(barRole.isCreateDurableQueue());
-      assertTrue(barRole.isDeleteDurableQueue());
-      assertTrue(barRole.isCreateNonDurableQueue());
-      assertFalse(barRole.isDeleteNonDurableQueue());
-      assertFalse(barRole.isManage());
-      
-      serverControl.removeSecuritySettings(destination);
-   }
-
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java	2010-03-24 12:46:38 UTC (rev 8952)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java	2010-03-24 13:28:09 UTC (rev 8953)
@@ -22,7 +22,11 @@
 import org.hornetq.api.core.management.ResourceNames;
 import org.hornetq.core.config.Configuration;
 import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.settings.impl.AddressSettings;
 
+import java.util.Set;
+
 /**
  * A HornetQServerControlUsingCoreTest
  *
@@ -466,7 +470,12 @@
          
          public void removeSecuritySettings(String addressMatch) throws Exception {
             proxy.invokeOperation("removeSecuritySettings", addressMatch); 
-         };
+         }
+
+         public Set<Role> getSecuritySettings(String addressMatch) throws Exception
+         {
+            return (Set<Role>)proxy.invokeOperation("removeSecuritySettings", addressMatch);
+         }
          
          public Object[] getRoles(String addressMatch) throws Exception
          {
@@ -478,6 +487,21 @@
             return (String)proxy.invokeOperation("getRolesAsJSON", addressMatch);
          }
 
+         public void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch, @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA, @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress, @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue, @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts, @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes, @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes, @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay, @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay, @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNo!
 Route") boolean sendToDLAOnNoRoute, @Parameter(desc = "the ploicy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy) throws Exception
+         {
+            //To change body of implemented methods use File | Settings | File Templates.
+         }
+
+         public AddressSettings getAddressSettings(String address)
+         {
+            return null;  //To change body of implemented methods use File | Settings | File Templates.
+         }
+
+         public void removeAddressSettings(String addressMatch)
+         {
+            //To change body of implemented methods use File | Settings | File Templates.
+         }
+
          public String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception
          {
             return (String)proxy.invokeOperation("getAddressSettingsAsJSON", addressMatch);



More information about the hornetq-commits mailing list