Author: bago Date: Fri Aug 4 09:10:29 2006 New Revision: 428766 URL: http://svn.apache.org/viewvc?rev=428766&view=rev Log: SMTPServer test clients often was not waiting for the server to complete operations.
Modified: james/server/sandbox/handlerapi2/src/test/org/apache/james/smtpserver/SMTPServerTest.java Modified: james/server/sandbox/handlerapi2/src/test/org/apache/james/smtpserver/SMTPServerTest.java URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi2/src/test/org/apache/james/smtpserver/SMTPServerTest.java?rev=428766&r1=428765&r2=428766&view=diff ============================================================================== --- james/server/sandbox/handlerapi2/src/test/org/apache/james/smtpserver/SMTPServerTest.java (original) +++ james/server/sandbox/handlerapi2/src/test/org/apache/james/smtpserver/SMTPServerTest.java Fri Aug 4 09:10:29 2006 @@ -306,9 +306,13 @@ smtpProtocol2.addRecipient(recipient2); smtpProtocol1.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n.\r\n"); + smtpProtocol1.completePendingCommand(); + verifyLastMail(sender1, recipient1, null); smtpProtocol2.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n.\r\n"); + smtpProtocol2.completePendingCommand(); + verifyLastMail(sender2, recipient2, null); smtpProtocol1.quit(); @@ -337,6 +341,7 @@ smtpProtocol1.addRecipient(recipient1); smtpProtocol1.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n"); + smtpProtocol1.completePendingCommand(); verifyLastMail(sender1, recipient1, null); String sender2 = "[EMAIL PROTECTED]"; @@ -345,6 +350,7 @@ smtpProtocol1.addRecipient(recipient2); smtpProtocol1.sendShortMessageData("Subject: test2\r\n\r\nTest body2\r\n"); + smtpProtocol1.completePendingCommand(); verifyLastMail(sender2, recipient2, null); smtpProtocol1.quit(); @@ -817,6 +823,7 @@ smtpProtocol.addRecipient("[EMAIL PROTECTED]"); smtpProtocol.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n"); + smtpProtocol.completePendingCommand(); smtpProtocol.quit(); @@ -862,6 +869,7 @@ // left out for test smtpProtocol.rcpt(new Address("[EMAIL PROTECTED]")); smtpProtocol.sendShortMessageData("Subject: test\r\n\r\nTest body\r\n"); + assertTrue("sending succeeded without recepient", SMTPReply.isNegativePermanent(smtpProtocol.getReplyCode())); smtpProtocol.quit(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]