org.subethamail.smtp.test.command
Class AuthTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.subethamail.smtp.test.util.ServerTestCase
              extended by org.subethamail.smtp.test.command.AuthTest
All Implemented Interfaces:
junit.framework.Test

public class AuthTest
extends ServerTestCase

Author:
Marco Trevisan , Jeff Schnitzer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.subethamail.smtp.test.util.ServerTestCase
ServerTestCase.TestWiser
 
Field Summary
 
Fields inherited from class org.subethamail.smtp.test.util.ServerTestCase
c, PORT, wiser
 
Constructor Summary
AuthTest(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testAuthLogin()
          Test method for AUTH LOGIN.
 void testAuthPlain()
          Test method for AUTH PLAIN.
 
Methods inherited from class org.subethamail.smtp.test.util.ServerTestCase
expect, send
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthTest

public AuthTest(java.lang.String name)
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class ServerTestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class ServerTestCase
Throws:
java.lang.Exception

testAuthPlain

public void testAuthPlain()
                   throws java.lang.Exception
Test method for AUTH PLAIN. The sequence under test is as follows:
  1. HELO test
  2. User starts AUTH PLAIN
  3. User sends username+password
  4. We expect login to be successful. Also the Base64 transformations are tested.
  5. User issues another AUTH command
  6. We expect an error message
org.subethamail.smtp.command.AuthCommand#execute(java.lang.String, org.subethamail.smtp.server.ConnectionContext).

Throws:
java.lang.Exception

testAuthLogin

public void testAuthLogin()
                   throws java.lang.Exception
Test method for AUTH LOGIN. The sequence under test is as follows:
  1. HELO test
  2. User starts AUTH LOGIN
  3. User sends username
  4. User cancels authentication by sending "*"
  5. User restarts AUTH LOGIN
  6. User sends username
  7. User sends password
  8. We expect login to be successful. Also the Base64 transformations are tested.
  9. User issues another AUTH command
  10. We expect an error message
org.subethamail.smtp.command.AuthCommand#execute(java.lang.String, org.subethamail.smtp.server.ConnectionContext).

Throws:
java.lang.Exception


Copyright © 2009 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED