You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2008/03/12 09:29:27 UTC

svn commit: r636249 - /mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java

Author: ngn
Date: Wed Mar 12 01:29:21 2008
New Revision: 636249

URL: http://svn.apache.org/viewvc?rev=636249&view=rev
Log:
Fixed broken test, now correctly waits for the response to the PASS command

Modified:
    mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java

Modified: mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java?rev=636249&r1=636248&r2=636249&view=diff
==============================================================================
--- mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java (original)
+++ mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/clienttests/ConcatedCommandsTest.java Wed Mar 12 01:29:21 2008
@@ -25,12 +25,16 @@
  * Tests that commands sent simultaniously are handled correctly.
  */
 public class ConcatedCommandsTest extends ClientTestTemplate {
-
+	
     public void testLogin() throws Exception {
-        client.sendCommand("USER admin\r\nPASS admin");
+		// send both commands, expect a 331 response
+    	assertEquals(331, client.sendCommand("USER admin\r\nPASS admin"));
         
-        assertTrue(FTPReply.isPositiveCompletion(client.noop()));
+    	// make sure we wait for the 230 to come back
+    	client.completePendingCommand();
+    	assertEquals(230, client.getReplyCode());
 
+        assertTrue(FTPReply.isPositiveCompletion(client.noop()));
     }
     
 }