From 481b9c01b87d862127658459c3fbf5a4941ab191 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Mon, 6 Feb 2012 23:24:15 +0000 Subject: QPID-3816: add client version to connection open logging git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1241257 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/server/logging/ConnectionLoggingTest.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'qpid/java/systests/src') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java index 2c1cebb9b3..ffe25a5cbe 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java @@ -21,6 +21,9 @@ package org.apache.qpid.server.logging; import javax.jms.Connection; + +import org.apache.qpid.common.QpidProperties; + import java.util.HashMap; import java.util.List; import java.util.TreeSet; @@ -68,7 +71,7 @@ public class ConnectionLoggingTest extends AbstractTestLogging // MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open // MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open : Protocol Version : 0-9 - // MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 + // MESSAGE [con:1(/127.0.0.1:46927)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 : Client Version : 1.2.3_4 // MESSAGE [con:0(/127.0.0.1:46927)] CON-1002 : Close HashMap> connectionData = splitResultsOnConnectionID(results); @@ -87,18 +90,18 @@ public class ConnectionLoggingTest extends AbstractTestLogging validateMessageID("CON-1001",log); // validate the last three CON-1001 messages. - // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 - validateConnectionOpen(results, 0, true, true, clientid); + // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol Version : 0-9 : Client Version : 1.2.3_4 + validateConnectionOpen(results, 0, true, true, clientid, true, QpidProperties.getReleaseVersion()); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Protocol Version : 0-9 - validateConnectionOpen(results, 1, true, false, null); + validateConnectionOpen(results, 1, true, false, null, false, null); // MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open - validateConnectionOpen(results, 2, false, false, null); + validateConnectionOpen(results, 2, false, false, null, false, null); } private void validateConnectionOpen(List results, int positionFromEnd, - boolean protocolVersionPresent, boolean clientIdOptionPresent, String clientIdValue) + boolean protocolVersionPresent, boolean clientIdOptionPresent, String clientIdValue, boolean clientVersionPresent, String clientVersionValue) { String log = getLogMessageFromEnd(results, positionFromEnd); @@ -115,6 +118,13 @@ public class ConnectionLoggingTest extends AbstractTestLogging protocolVersionPresent, fromMessage(log).contains("Protocol Version :")); //fixme there is no way currently to find out the negotiated protocol version // The delegate is the versioned class ((AMQConnection)connection)._delegate + + assertEquals("unexpected Client ID option state", clientVersionPresent, fromMessage(log).contains("Client Version :")); + + if(clientVersionPresent && clientVersionValue != null) + { + assertTrue("Client version value is not present: " + clientVersionValue, fromMessage(log).contains(clientVersionValue)); + } } /** -- cgit v1.2.1