org.apache.james.jspf
Class AbstractYamlTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.james.jspf.AbstractYamlTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
MailZoneYamlTest, RFC4408YamlTest, SPFYamlTest, YamlTest

public abstract class AbstractYamlTest
extends junit.framework.TestCase


Field Summary
protected static org.apache.james.jspf.tester.DNSTestingServer dnsTestServer
           
protected static int FAKE_SERVER
           
protected  Logger log
           
protected static MacroExpand macroExpand
           
protected static int MOCK_SERVICE
           
protected static SPFRecordParser parser
           
protected static org.apache.james.jspf.tester.SPFYamlTestDescriptor prevData
           
protected static int REAL_SERVER
           
protected static SPF spf
           
protected static int STAGED_EXECUTOR
           
protected static int STAGED_EXECUTOR_DNSJNIO
           
protected static int STAGED_EXECUTOR_MULTITHREADED
           
protected static int SYNCHRONOUS_EXECUTOR
           
protected static int TIMEOUT
           
 
Constructor Summary
  AbstractYamlTest()
           
protected AbstractYamlTest(org.apache.james.jspf.tester.SPFYamlTestDescriptor def)
           
protected AbstractYamlTest(org.apache.james.jspf.tester.SPFYamlTestDescriptor def, java.lang.String test)
           
protected AbstractYamlTest(java.lang.String name)
           
 
Method Summary
protected  DNSService getDNSService()
           
protected  DNSService getDNSServiceFakeServer()
           
protected  DNSService getDNSServiceMockedDNSService()
           
protected  int getDnsServiceMockStyle()
           
protected  DNSService getDNSServiceReal()
           
protected abstract  java.lang.String getFilename()
           
static java.lang.String getRecordTypeDescription(int recordType)
          Return a string representation of a DNSService record type.
protected  int getSpfExecutorType()
           
protected  void runTest()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TIMEOUT

protected static final int TIMEOUT
See Also:
Constant Field Values

MOCK_SERVICE

protected static final int MOCK_SERVICE
See Also:
Constant Field Values

FAKE_SERVER

protected static final int FAKE_SERVER
See Also:
Constant Field Values

REAL_SERVER

protected static final int REAL_SERVER
See Also:
Constant Field Values

SYNCHRONOUS_EXECUTOR

protected static final int SYNCHRONOUS_EXECUTOR
See Also:
Constant Field Values

STAGED_EXECUTOR

protected static final int STAGED_EXECUTOR
See Also:
Constant Field Values

STAGED_EXECUTOR_MULTITHREADED

protected static final int STAGED_EXECUTOR_MULTITHREADED
See Also:
Constant Field Values

STAGED_EXECUTOR_DNSJNIO

protected static final int STAGED_EXECUTOR_DNSJNIO
See Also:
Constant Field Values

log

protected Logger log

macroExpand

protected static MacroExpand macroExpand

spf

protected static SPF spf

prevData

protected static org.apache.james.jspf.tester.SPFYamlTestDescriptor prevData

parser

protected static SPFRecordParser parser

dnsTestServer

protected static org.apache.james.jspf.tester.DNSTestingServer dnsTestServer
Constructor Detail

AbstractYamlTest

protected AbstractYamlTest(org.apache.james.jspf.tester.SPFYamlTestDescriptor def,
                           java.lang.String test)

AbstractYamlTest

protected AbstractYamlTest(org.apache.james.jspf.tester.SPFYamlTestDescriptor def)

AbstractYamlTest

protected AbstractYamlTest(java.lang.String name)
                    throws java.io.IOException
Throws:
java.io.IOException

AbstractYamlTest

public AbstractYamlTest()
Method Detail

getFilename

protected abstract java.lang.String getFilename()

runTest

protected void runTest()
                throws java.lang.Throwable
Overrides:
runTest in class junit.framework.TestCase
Throws:
java.lang.Throwable

getDNSServiceMockedDNSService

protected DNSService getDNSServiceMockedDNSService()
Returns:
a Mocked DNSService

getDNSService

protected DNSService getDNSService()
Returns:
the right dnsservice according to what the test specialization declares

getDnsServiceMockStyle

protected int getDnsServiceMockStyle()

getDNSServiceFakeServer

protected DNSService getDNSServiceFakeServer()
Returns:
a dns resolver pointing to the local fake server

getDNSServiceReal

protected DNSService getDNSServiceReal()
Returns:
a real dns resolver

getRecordTypeDescription

public static java.lang.String getRecordTypeDescription(int recordType)
Return a string representation of a DNSService record type.

Parameters:
recordType - the DNSService.CONSTANT type to convert
Returns:
a string representation of the given record type

getSpfExecutorType

protected int getSpfExecutorType()


Copyright © 2006-2009 The Apache Software Foundation. All Rights Reserved.