summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java89
1 files changed, 46 insertions, 43 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
index c5f5e06ae1..95a378f1f6 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
@@ -95,9 +95,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
{
String TESTID="BRK-1006";
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
startBroker();
@@ -165,8 +163,6 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerStartupDefaultLog4j() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
if (isJavaBroker() && isExternalBroker() && !isInternalBroker())
{
String TESTID = "BRK-1007";
@@ -256,7 +252,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
public void testBrokerStartupCustomLog4j() throws Exception
{
// This logging startup code only occurs when you run a Java broker
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
String customLog4j = getBrokerCommandLog4JFile().getAbsolutePath();
@@ -344,7 +340,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
{
// This logging startup code only occurs when you run a Java broker,
// that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
String TESTID = "BRK-1001";
@@ -426,9 +422,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerStartupListeningTCPDefault() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
String TESTID = "BRK-1002";
@@ -484,7 +478,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
//3
String message = getMessageString(log);
assertTrue("Expected Listen log not correct" + message,
- message.endsWith("Listening on [TCP] port " + getPort()));
+ message.endsWith("Listening on TCP port " + getPort()));
validation = true;
}
@@ -534,9 +528,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerStartupListeningTCPSSL() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
String TESTID = "BRK-1002";
@@ -545,6 +537,8 @@ public class BrokerLoggingTest extends AbstractTestLogging
sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+ sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+ sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
getBrokerConfiguration().addPortConfiguration(sslPortAttributes);
startBroker();
@@ -595,16 +589,23 @@ public class BrokerLoggingTest extends AbstractTestLogging
assertEquals("Four listen messages should be found.",
4, listenMessages .size());
- //3
- //Check the first
- String message = getMessageString(getLog(listenMessages .get(0)));
- assertTrue("Expected Listen log not correct" + message,
- message.endsWith("Listening on [TCP] port " + getPort()));
+ int tcpStarted = 0;
+ int sslStarted = 0;
- // Check the third, ssl listen.
- message = getMessageString(getLog(listenMessages .get(2)));
- assertTrue("Expected Listen log not correct" + message,
- message.endsWith("Listening on [SSL] port " + DEFAULT_SSL_PORT));
+ for (String message : listenMessages)
+ {
+ if (message.endsWith("Listening on TCP port " + getPort()))
+ {
+ tcpStarted++;
+ }
+ if (message.endsWith("Listening on SSL port " + DEFAULT_SSL_PORT))
+ {
+ sslStarted++;
+ }
+ }
+
+ assertEquals("Unexpected number of logs 'Listening on TCP port'", 2, tcpStarted);
+ assertEquals("Unexpected number of logs 'Listening on SSL port'", 2, sslStarted);
//4 Test ports open
testSocketOpen(getPort());
@@ -643,9 +644,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerStartupReady() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker())
{
String TESTID = "BRK-1004";
@@ -731,9 +730,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerShutdownListeningTCPDefault() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker() && isInternalBroker())
{
String TESTID = "BRK-1003";
@@ -825,9 +822,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerShutdownListeningTCPSSL() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker() && isInternalBroker())
{
String TESTID = "BRK-1003";
@@ -836,6 +831,8 @@ public class BrokerLoggingTest extends AbstractTestLogging
sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+ sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+ sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
getBrokerConfiguration().addPortConfiguration(sslPortAttributes);
startBroker();
@@ -869,15 +866,23 @@ public class BrokerLoggingTest extends AbstractTestLogging
assertEquals("Two shutdown messages should be found.",
2, listenMessages.size());
- //3
- String message = getMessageString(getLog(listenMessages.get(0)));
- assertTrue("Expected shutdown log not correct" + message,
- message.endsWith("TCP port " + getPort()));
+ int tcpShuttingDown = 0;
+ int sslShuttingDown = 0;
- // Check second, ssl, listen.
- message = getMessageString(getLog(listenMessages.get(1)));
- assertTrue("Expected shutdown log not correct" + message,
- message.endsWith("TCP/SSL port " + DEFAULT_SSL_PORT));
+ for (String m : listenMessages)
+ {
+ if (m.endsWith("Shutting down : TCP port " + getPort()))
+ {
+ tcpShuttingDown++;
+ }
+ if (m.endsWith("Shutting down : SSL port " + DEFAULT_SSL_PORT))
+ {
+ sslShuttingDown++;
+ }
+ }
+
+ assertEquals("Unexpected number of logs 'Shutting down : TCP port'", 1, tcpShuttingDown);
+ assertEquals("Unexpected number of logs 'Shutting down : SSL port'", 1, sslShuttingDown);
//4
//Test Port closed
@@ -913,9 +918,7 @@ public class BrokerLoggingTest extends AbstractTestLogging
*/
public void testBrokerShutdownStopped() throws Exception
{
- // This logging startup code only occurs when you run a Java broker,
- // that broker must be started via Main so not an InVM broker.
- if (isJavaBroker() && isExternalBroker())
+ if (isJavaBroker() && isInternalBroker())
{
String TESTID = "BRK-1005";