qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1716141 - in /qpid/java/trunk/broker-core/src: main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java
Date Tue, 24 Nov 2015 14:01:43 GMT
Author: orudyy
Date: Tue Nov 24 14:01:43 2015
New Revision: 1716141

URL: http://svn.apache.org/viewvc?rev=1716141&view=rev
Log:
QPID-6872: Make sure to remove only unregistered object from ACO chidlren maps

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1716141&r1=1716140&r2=1716141&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
Tue Nov 24 14:01:43 2015
@@ -2040,8 +2040,8 @@ public abstract class AbstractConfigured
         synchronized(_children)
         {
             _children.get(categoryClass).remove(child);
-            _childrenById.get(categoryClass).remove(child.getId());
-            _childrenByName.get(categoryClass).remove(child.getName());
+            _childrenById.get(categoryClass).remove(child.getId(), child);
+            _childrenByName.get(categoryClass).remove(child.getName(), child);
         }
     }
 

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java?rev=1716141&r1=1716140&r2=1716141&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestAbstractEngineImpl.java
Tue Nov 24 14:01:43 2015
@@ -31,9 +31,12 @@ import org.apache.qpid.server.model.Conf
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.StateTransition;
+import org.apache.qpid.server.model.testmodels.TestSecurityManager;
+import org.apache.qpid.server.security.SecurityManager;
 
 public class TestAbstractEngineImpl<X extends TestAbstractEngineImpl<X>> extends
AbstractConfiguredObject<X> implements TestEngine<X>
 {
+    private final TestSecurityManager _securityManager;
     @ManagedAttributeField
     private ListenableFuture<Void> _beforeCloseFuture = Futures.immediateFuture(null);
 
@@ -47,6 +50,7 @@ public class TestAbstractEngineImpl<X ex
                                   final Map<String, Object> attributes)
     {
         super(parents, attributes);
+        _securityManager = new TestSecurityManager(parents.get(TestCar.class));
     }
 
     @Override
@@ -102,4 +106,18 @@ public class TestAbstractEngineImpl<X ex
         }
         return (ListenableFuture<Void>) _stateChangeFuture;
     }
+
+    @StateTransition(currentState = {State.ACTIVE, State.UNINITIALIZED, State.ERRORED}, desiredState
= State.DELETED)
+    private ListenableFuture<Void> doDelete()
+    {
+        // to invoke ACO#unregisterChild as part of delete
+        deleted();
+        return Futures.immediateFuture(null);
+    }
+
+    @Override
+    protected SecurityManager getSecurityManager()
+    {
+        return _securityManager;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message