summaryrefslogtreecommitdiff
path: root/java/systests/src
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-02-06 23:24:15 +0000
committerRobert Gemmell <robbie@apache.org>2012-02-06 23:24:15 +0000
commitfe05ba45954eb5f83b13039370afd7530cdef572 (patch)
tree1d62f2752b4ebbfb1c6377f024b38d24ee77dc3a /java/systests/src
parent85c71e6021c91194b16b8a2f5ef705e05d30f243 (diff)
downloadqpid-python-fe05ba45954eb5f83b13039370afd7530cdef572.tar.gz
QPID-3816: add client version to connection open logging
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1241257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
index 2c1cebb9b3..ffe25a5cbe 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
+++ b/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<Integer, List<String>> 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<String> 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));
+ }
}
/**