org.apache.james.transport.remotedeliverytester
Class AbstractRemoteDeliveryTest

java.lang.Object
  extended by TestCase
      extended by org.apache.james.transport.remotedeliverytester.AbstractRemoteDeliveryTest
Direct Known Subclasses:
RemoteDeliveryTest

public abstract class AbstractRemoteDeliveryTest
extends TestCase


Constructor Summary
AbstractRemoteDeliveryTest()
           
 
Method Summary
protected  java.lang.String[][] addServers(Tester tester, java.lang.String[][] servers, boolean sendValid)
           
protected  void assertProcMail(ProcMail pmail, int state, int sends, int minBounce, java.lang.String lastServer)
          Assert procmail result.
protected  void assertServer(Tester.TestStatus status, java.lang.String server, int sends, int maxConnection)
           
protected  void assertWhole(Tester.TestStatus status, int sends, int maxConnection)
           
protected  void doTest1(RemoteDeliveryTestable rd, java.util.Properties params)
           
protected  void doTest10(RemoteDeliveryTestable rd, java.util.Properties params)
          IO Exception
protected  void doTest2_0(RemoteDeliveryTestable rd, java.util.Properties params)
           
protected  void doTest2(RemoteDeliveryTestable rd, java.util.Properties params)
           
protected  void doTest3(RemoteDeliveryTestable rd, java.util.Properties params)
          Permanent error fo 1/2 addresses.
protected  void doTest4(RemoteDeliveryTestable rd, java.util.Properties params)
          Temporary error for 1/2 addresses.
protected  void doTest5(RemoteDeliveryTestable rd, java.util.Properties params)
          1 Temporary error + 1 Permanent error
protected  void doTest6(RemoteDeliveryTestable rd, java.util.Properties params)
          Mixed
protected  void doTest7a(RemoteDeliveryTestable rd, java.util.Properties params)
          NPE during send
protected  void doTest7b(RemoteDeliveryTestable rd, java.util.Properties params)
           
protected  void doTest8(RemoteDeliveryTestable rd, java.util.Properties params)
          Multiple mx servers for a single domain.
protected  void doTest9(RemoteDeliveryTestable rd, java.util.Properties params)
          Multiple MX server for a domain.
protected  void doTestMulti(RemoteDeliveryTestable rd, java.util.Properties params)
           
abstract  RemoteDeliveryTestable getDeliverer()
           
abstract  java.util.Properties getParameters()
           
protected  java.util.Properties getStandardParameters()
           
protected  java.lang.String[][] getTestMultiEmails()
          "OK" : we expect the mail to this recipient to be delivered "KO" : we expect the mail to this recipient to fail "NA" : the result is not predictable because of random behaviour, but we expect attempts.
protected  java.lang.String[][] getTestMultiServers()
           
protected  void initEnvironment()
           
 void test1()
           
 void test10()
           
 void test2_0()
           
 void test2()
           
 void test3()
           
 void test4()
           
 void test5()
           
 void test6()
           
 void test7()
           
 void test8()
           
 void test9()
           
 void testMulti()
           
protected  int waitEmptySpool(int maxWait)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRemoteDeliveryTest

public AbstractRemoteDeliveryTest()
Method Detail

getDeliverer

public abstract RemoteDeliveryTestable getDeliverer()

getParameters

public abstract java.util.Properties getParameters()

test1

public void test1()
           throws java.lang.Exception
Throws:
java.lang.Exception

test2_0

public void test2_0()
             throws java.lang.Exception
Throws:
java.lang.Exception

test2

public void test2()
           throws java.lang.Exception
Throws:
java.lang.Exception

test3

public void test3()
           throws java.lang.Exception
Throws:
java.lang.Exception

test4

public void test4()
           throws java.lang.Exception
Throws:
java.lang.Exception

test5

public void test5()
           throws java.lang.Exception
Throws:
java.lang.Exception

test6

public void test6()
           throws java.lang.Exception
Throws:
java.lang.Exception

test7

public void test7()
           throws java.lang.Exception
Throws:
java.lang.Exception

test8

public void test8()
           throws java.lang.Exception
Throws:
java.lang.Exception

test9

public void test9()
           throws java.lang.Exception
Throws:
java.lang.Exception

test10

public void test10()
            throws java.lang.Exception
Throws:
java.lang.Exception

testMulti

public void testMulti()
               throws java.lang.Exception
Throws:
java.lang.Exception

initEnvironment

protected void initEnvironment()

getStandardParameters

protected java.util.Properties getStandardParameters()

addServers

protected java.lang.String[][] addServers(Tester tester,
                                          java.lang.String[][] servers,
                                          boolean sendValid)

waitEmptySpool

protected int waitEmptySpool(int maxWait)

assertWhole

protected void assertWhole(Tester.TestStatus status,
                           int sends,
                           int maxConnection)
Parameters:
status -
sends - Email send attempts number. if < 0 will take the minimum number.
maxConnection - Max attempts to connect the server. If < 0 defaults to the minimum.

assertServer

protected void assertServer(Tester.TestStatus status,
                            java.lang.String server,
                            int sends,
                            int maxConnection)
Parameters:
status -
server -
sends - Email send attempts number. if < 0 will take the minimum number.
maxConnection - Max attempts to connect the server. If < 0 defaults to the minimum.

assertProcMail

protected void assertProcMail(ProcMail pmail,
                              int state,
                              int sends,
                              int minBounce,
                              java.lang.String lastServer)
Assert procmail result.

Parameters:
pmail -
state -
sends - Email send attempts number. if < 0 will take the minimum number.
minBounce -
lastServer -

doTest1

protected void doTest1(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Throws:
java.lang.Exception

doTest2_0

protected void doTest2_0(RemoteDeliveryTestable rd,
                         java.util.Properties params)
                  throws java.lang.Exception
Throws:
java.lang.Exception

doTest2

protected void doTest2(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Throws:
java.lang.Exception

doTest3

protected void doTest3(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Permanent error fo 1/2 addresses.

Parameters:
rd -
Throws:
java.lang.Exception

doTest4

protected void doTest4(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Temporary error for 1/2 addresses.

Parameters:
rd -
Throws:
java.lang.Exception

doTest5

protected void doTest5(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
1 Temporary error + 1 Permanent error

Parameters:
rd -
Throws:
java.lang.Exception

doTest6

protected void doTest6(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Mixed

Parameters:
rd -
Throws:
java.lang.Exception

doTest7a

protected void doTest7a(RemoteDeliveryTestable rd,
                        java.util.Properties params)
                 throws java.lang.Exception
NPE during send

Parameters:
rd -
Throws:
java.lang.Exception

doTest7b

protected void doTest7b(RemoteDeliveryTestable rd,
                        java.util.Properties params)
                 throws java.lang.Exception
Throws:
java.lang.Exception

doTest8

protected void doTest8(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Multiple mx servers for a single domain. One failing with a 400V on the first reception. This test expect the RemoteDelivery to check the next server on a temporary error on the first server. Other remote delivery implementations could use different strategies.

Throws:
java.lang.Exception

doTest9

protected void doTest9(RemoteDeliveryTestable rd,
                       java.util.Properties params)
                throws java.lang.Exception
Multiple MX server for a domain.

Throws:
java.lang.Exception

doTest10

protected void doTest10(RemoteDeliveryTestable rd,
                        java.util.Properties params)
                 throws java.lang.Exception
IO Exception

Throws:
java.lang.Exception

getTestMultiServers

protected java.lang.String[][] getTestMultiServers()

getTestMultiEmails

protected java.lang.String[][] getTestMultiEmails()
"OK" : we expect the mail to this recipient to be delivered "KO" : we expect the mail to this recipient to fail "NA" : the result is not predictable because of random behaviour, but we expect attempts. "ID" : we expect no attempt because of early failures.


doTestMulti

protected void doTestMulti(RemoteDeliveryTestable rd,
                           java.util.Properties params)
                    throws java.lang.Exception
Throws:
java.lang.Exception


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.