qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1691250 [2/2] - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/logging/messages/ broker-core/src/main/java/org/apache/qpid/server/model/port/ broker-core/src/main/java/org/apache/qpid/server/security/ broker-core/src...
Date Wed, 15 Jul 2015 17:25:31 GMT
Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
Wed Jul 15 17:25:30 2015
@@ -35,6 +35,7 @@ import java.util.UUID;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
@@ -80,6 +81,7 @@ public class PortFactoryTest extends Qpi
         when(_authProvider.getName()).thenReturn(_authProviderName);
         when(_broker.getChildren(eq(AuthenticationProvider.class))).thenReturn(Collections.singleton(_authProvider));
         when(_broker.getCategoryClass()).thenReturn(Broker.class);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
 
         ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
         when(_broker.getObjectFactory()).thenReturn(objectFactory);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java
Wed Jul 15 17:25:30 2015
@@ -32,6 +32,7 @@ import javax.net.ssl.KeyManager;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObjectFactory;
@@ -62,6 +63,7 @@ public class FileKeyStoreTest extends Qp
         when(_broker.getModel()).thenReturn(_model);
         when(_broker.getSecurityManager()).thenReturn(_securityManager);
         when(_broker.getCategoryClass()).thenReturn(Broker.class);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
     }
 
     public void testCreateKeyStoreFromFile_Success() throws Exception

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java
Wed Jul 15 17:25:30 2015
@@ -33,6 +33,7 @@ import javax.net.ssl.TrustManager;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
@@ -66,6 +67,7 @@ public class FileTrustStoreTest extends
         when(_broker.getModel()).thenReturn(_model);
         when(_broker.getSecurityManager()).thenReturn(_securityManager);
         when(_broker.getCategoryClass()).thenReturn(Broker.class);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
     }
 
     public void testCreateTrustStoreFromFile_Success() throws Exception

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaKeyStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaKeyStoreTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaKeyStoreTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaKeyStoreTest.java
Wed Jul 15 17:25:30 2015
@@ -41,6 +41,7 @@ import java.util.Map;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObjectFactory;
@@ -67,6 +68,7 @@ public class NonJavaKeyStoreTest extends
         when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
         when(_broker.getModel()).thenReturn(_model);
         when(_broker.getSecurityManager()).thenReturn(_securityManager);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
         _testResources = new ArrayList<>();
     }
 

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaTrustStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaTrustStoreTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaTrustStoreTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/security/NonJavaTrustStoreTest.java
Wed Jul 15 17:25:30 2015
@@ -29,6 +29,7 @@ import java.util.Map;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObjectFactory;
@@ -54,6 +55,7 @@ public class NonJavaTrustStoreTest exten
         when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
         when(_broker.getModel()).thenReturn(_model);
         when(_broker.getSecurityManager()).thenReturn(_securityManager);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
     }
 
     public void testCreationOfTrustStoreFromValidCertificate() throws Exception

Modified: qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java
(original)
+++ qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImpl.java
Wed Jul 15 17:25:30 2015
@@ -28,6 +28,8 @@ import java.util.Set;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
+import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.messages.AccessControlMessages;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,6 +57,7 @@ public class ACLFileAccessControlProvide
 
     protected DefaultAccessControl _accessControl;
     protected final Broker _broker;
+    private final EventLogger _eventLogger;
 
     @ManagedAttributeField( afterSet = "reloadAclFile")
     private String _path;
@@ -66,7 +69,8 @@ public class ACLFileAccessControlProvide
 
 
         _broker = broker;
-
+        _eventLogger = _broker.getEventLogger();
+        _eventLogger.message(AccessControlMessages.CREATE(getName()));
     }
 
     @Override
@@ -220,6 +224,7 @@ public class ACLFileAccessControlProvide
                         finally
                         {
                             returnVal.set(null);
+                            _eventLogger.message(AccessControlMessages.DELETE(getName()));
                         }
                     }
                 }, getTaskExecutor().getExecutor()

Modified: qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactoryTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactoryTest.java
(original)
+++ qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderFactoryTest.java
Wed Jul 15 17:25:30 2015
@@ -32,6 +32,7 @@ import java.util.regex.Pattern;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.AccessControlProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
@@ -59,6 +60,7 @@ public class ACLFileAccessControlProvide
         taskExecutor.start();
         when(_broker.getTaskExecutor()).thenReturn(taskExecutor);
         when(_broker.getChildExecutor()).thenReturn(taskExecutor);
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
 
     }
 

Modified: qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImplTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImplTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImplTest.java
(original)
+++ qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProviderImplTest.java
Wed Jul 15 17:25:30 2015
@@ -33,6 +33,7 @@ import java.util.UUID;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.Model;
@@ -55,6 +56,7 @@ public class ACLFileAccessControlProvide
         when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
         when(_broker.getModel()).thenReturn(_model);
         when(_broker.getId()).thenReturn(UUID.randomUUID());
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
     }
 
     public void testValidationOnCreateWithNonExistingACLFile()

Modified: qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0Test.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0Test.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0Test.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngine_1_0_0Test.java
Wed Jul 15 17:25:30 2015
@@ -40,6 +40,7 @@ import java.util.UUID;
 
 import javax.security.auth.Subject;
 
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.transport.AMQPConnection;
 import org.apache.qpid.server.virtualhost.VirtualHostPrincipal;
@@ -94,6 +95,7 @@ public class ProtocolEngine_1_0_0Test ex
         when(_broker.getChildExecutor()).thenReturn(taskExecutor);
         when(_broker.getTaskExecutor()).thenReturn(taskExecutor);
         when(_broker.getId()).thenReturn(UUID.randomUUID());
+        when(_broker.getEventLogger()).thenReturn(new EventLogger());
         _port = mock(AmqpPort.class);
         when(_port.getChildExecutor()).thenReturn(taskExecutor);
         when(_port.getCategoryClass()).thenReturn(Port.class);

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java?rev=1691250&r1=1691249&r2=1691250&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java
(original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AccessControlLoggingTest.java
Wed Jul 15 17:25:30 2015
@@ -82,7 +82,7 @@ public class AccessControlLoggingTest ex
         conn.start();
         ((AMQSession<?, ?>) sess).createQueue("allow", false, false, false);
 
-        List<String> matches = findMatches(ACL_LOG_PREFIX);
+        List<String> matches = findMatches(ACL_LOG_PREFIX + 1001);
 
         assertTrue("Should be no ACL log messages", matches.isEmpty());
     }
@@ -97,7 +97,7 @@ public class AccessControlLoggingTest ex
         conn.start();
         ((AMQSession<?, ?>) sess).createQueue("allow-log", false, false, false);
 
-        List<String> matches = findMatches(ACL_LOG_PREFIX);
+        List<String> matches = findMatches(ACL_LOG_PREFIX + 1001);
 
         assertEquals("Should only be one ACL log message", 1, matches.size());
 
@@ -123,7 +123,8 @@ public class AccessControlLoggingTest ex
         Connection conn = getConnection(USER, PASS);
         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         conn.start();
-        try {
+        try
+        {
             ((AMQSession<?, ?>) sess).createQueue("deny-log", false, false, false);
 	        fail("Should have denied queue creation");
         }
@@ -133,7 +134,7 @@ public class AccessControlLoggingTest ex
             assertEquals("Expected ACCESS_REFUSED error code", AMQConstant.ACCESS_REFUSED,
amqe.getErrorCode());
         }
 
-        List<String> matches = findMatches(ACL_LOG_PREFIX);
+        List<String> matches = findMatches(ACL_LOG_PREFIX + 1002);
 
         assertEquals("Should only be one ACL log message", 1, matches.size());
 
@@ -159,7 +160,8 @@ public class AccessControlLoggingTest ex
         Connection conn = getConnection(USER, PASS);
         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         conn.start();
-        try {
+        try
+        {
             ((AMQSession<?, ?>) sess).createQueue("deny", false, false, false);
             fail("Should have denied queue creation");
         }
@@ -169,7 +171,7 @@ public class AccessControlLoggingTest ex
             assertEquals("Expected ACCESS_REFUSED error code", AMQConstant.ACCESS_REFUSED,
amqe.getErrorCode());
         }
 
-        List<String> matches = findMatches(ACL_LOG_PREFIX);
+        List<String> matches = findMatches(ACL_LOG_PREFIX + 1002);
 
         assertTrue("Should be no ACL log messages", matches.isEmpty());
     }



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


Mime
View raw message