qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r800370 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
Date Mon, 03 Aug 2009 13:29:19 GMT
Author: ritchiem
Date: Mon Aug  3 13:29:19 2009
New Revision: 800370

URL: http://svn.apache.org/viewvc?rev=800370&view=rev
Log:
QPID-2002 : Updated ConnectionLoggingTest to use new validation methods in Abstract parent

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java?rev=800370&r1=800369&r2=800370&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ConnectionLoggingTest.java
Mon Aug  3 13:29:19 2009
@@ -77,8 +77,7 @@
         String log = results.get(0);
         //  MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open
         //1 & 2
-        assertTrue("CON-1001 is not the first CON message",
-                   log.contains("CON-1001"));
+        validateMessageID("CON-1001",log);
 
         //We get the size so that we can validate the last three CON- messages
         int resultsSize = results.size();
@@ -88,28 +87,28 @@
         // 3 - Assert the options are correct
         log = results.get(resultsSize - 1);
         //  MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol
Version : 0-9
-        assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001"));
-        assertTrue("Client ID option is not present", log.contains("Client ID :"));
-        assertTrue("Client ID value is not present", log.contains(connection.getClientID()));
+        validateMessageID("CON-1001",log);
+        assertTrue("Client ID option is not present", fromMessage(log).contains("Client ID
:"));
+        assertTrue("Client ID value is not present", fromMessage(log).contains(connection.getClientID()));
 
-        assertTrue("Protocol Version option is not present", log.contains("Protocol Version
:"));
+        assertTrue("Protocol Version option is not present", 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
 
         log = results.get(resultsSize - 2);
         //  MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Protocol Version : 0-9
-        assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001"));
-        assertTrue("Protocol Version option is not present", log.contains("Protocol Version
:"));
+        validateMessageID("CON-1001",log);
+        assertTrue("Protocol Version option is not present", fromMessage(log).contains("Protocol
Version :"));
         //fixme agani we should check the version
         // Check that client ID is not present in log
-        assertTrue("Client ID option is present", !log.contains("Client ID :"));
+        assertTrue("Client ID option is present", !fromMessage(log).contains("Client ID :"));
 
         log = results.get(resultsSize - 3);
-        assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001"));
+        validateMessageID("CON-1001",log);
         // Check that PV is not present in log
-        assertTrue("Protocol Version option is present", !log.contains("Protocol Version
:"));
+        assertTrue("Protocol Version option is present", !fromMessage(log).contains("Protocol
Version :"));
         // Check that client ID is not present in log
-        assertTrue("Client ID option is present", !log.contains("Client ID :"));
+        assertTrue("Client ID option is present", !fromMessage(log).contains("Client ID :"));
 
         connection.close();
     }
@@ -149,7 +148,7 @@
 
         // Validate Close message occurs
         String log = results.get(resultsSize - 1);
-        assertTrue("Incorrect CON message, not CON-1002", log.contains("CON-1002"));
+        validateMessageID("CON-1002",log);
         assertTrue("Message does not end with close:" + log, log.endsWith("Close"));
 
         // Extract connection ID to validate there is a CON-1001 messasge for it
@@ -158,7 +157,7 @@
         //Previous log message should be the open
         log = results.get(resultsSize - 2);
         //  MESSAGE [con:1(/127.0.0.1:52540)] CON-1001 : Open : Client ID : clientid : Protocol
Version : 0-9
-        assertTrue("Incorrect CON message, not CON-1001", log.contains("CON-1001"));
-        assertEquals("Connection IDs do not match", connectionID, extractConnectionID(log));
+        validateMessageID("CON-1001",log);
+        assertEquals("Connection IDs do not match", connectionID, extractConnectionID(fromActor(log)));
     }
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message