diff options
| author | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-10-03 16:02:42 +0000 |
|---|---|---|
| committer | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-10-03 16:02:42 +0000 |
| commit | a3625d8ed5d7edfbd41acf38130d3f574f1c0aa5 (patch) | |
| tree | 60f8230476e27245ec190a402274f077fff0e3c4 /qpid/java/systests/src | |
| parent | a5b1a1073e2596da8b5fbcd24769aec87107d212 (diff) | |
| download | qpid-python-a3625d8ed5d7edfbd41acf38130d3f574f1c0aa5.tar.gz | |
QPID-2839 Add channel (CHN) Operational Loggin on 0-10
Committed patch from SorinS <ssuciu@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1003985 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java index 0e7f4aa166..bd9b18d848 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java @@ -64,27 +64,34 @@ public class ChannelLoggingTest extends AbstractTestLogging // Test that calling session.close gives us the expected output ((AMQConnection)connection).createSession(false, Session.AUTO_ACKNOWLEDGE,PREFETCH); - // Wait to ensure that the CHN-1004 message is logged - waitForMessage("CHN-1004"); + // Wait to ensure that the CHN-1001 message is logged + waitForMessage("CHN-1001"); - List<String> results = findMatches(CHANNEL_PREFIX); + List<String> results = findMatches("CHN-1001"); // Validation - - assertEquals("CHN messages not logged", 2, results.size()); + assertEquals("CHN-1001 messages not logged", 1, results.size()); String log = getLogMessage(results, 0); // MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1001 : Create - //1 & 2 validateMessageID("CHN-1001", log); assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log))); - log = getLogMessage(results, 1); - // MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number} - //1 & 2 - validateMessageID("CHN-1004", log); - assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log))); - assertTrue("Prefetch Count not correct",getMessageString(fromMessage(log)).endsWith("Count "+PREFETCH)); + if (isBroker08()) + { + // Wait to ensure that the CHN-1004 message is logged + waitForMessage("CHN-1004"); + + results = findMatches("CHN-1004"); + + // Validation + assertEquals("CHN-1004 messages not logged", 1, results.size()); + log = getLogMessage(results, 0); + // MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number} + validateMessageID("CHN-1004", log); + assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log))); + assertTrue("Prefetch Count not correct",getMessageString(fromMessage(log)).endsWith("Count "+PREFETCH)); + } connection.close(); } @@ -276,9 +283,11 @@ public class ChannelLoggingTest extends AbstractTestLogging Connection connection = getConnection(); // Create a session and then close it - connection.createSession(false, Session.AUTO_ACKNOWLEDGE).close(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + waitForMessage("CHN-1001"); // Wait to ensure that the CHN-1003 message is logged + session.close(); waitForMessage("CHN-1003"); List<String> results = findMatches(CHANNEL_PREFIX); @@ -291,11 +300,14 @@ public class ChannelLoggingTest extends AbstractTestLogging private void validateChannelClose(List<String> results) { - String log = getLogMessageFromEnd(results, 0); - - validateMessageID("CHN-1003", log); - assertEquals("Message should be Close", "Close",getMessageString(fromMessage(log))); - assertEquals("Incorrect Channel ID closed.", 1, getChannelID(fromActor(log))); - assertEquals("Incorrect Channel ID closed.", 1, getChannelID(fromSubject(log))); + String open = getLogMessage(results, 0); + String close = getLogMessageFromEnd(results, 0); + + validateMessageID("CHN-1001", open); + validateMessageID("CHN-1003", close); + assertEquals("Message should be Close", "Close", getMessageString(fromMessage(close))); + assertEquals("Incorrect Channel ID closed", 1, getChannelID(fromSubject(close))); + assertEquals("Channel IDs should be the same", getChannelID(fromActor(open)), getChannelID(fromSubject(close))); + assertEquals("Connection IDs should be the same", getConnectionID(fromActor(open)), getConnectionID(fromSubject(close))); } }
\ No newline at end of file |
