Email Answering System
Version 1.0

test
Class InteractionUnitTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--test.InteractionUnitTest
All Implemented Interfaces:
junit.framework.Test

public class InteractionUnitTest
extends junit.framework.TestCase

Unit test for the email resource adapter connection.

Author:
Derrick Oswald

Field Summary
protected  Connection mConnection
          The connection used in the tests.
protected  RecordFactory mRecordFactory
          The record factory used in the tests.
 
Constructor Summary
InteractionUnitTest(String testName)
          Construct a Connection test.
 
Method Summary
 InternetAddress getEmailAddress()
          Return a valid adjusted email address.
static void main(String[] args)
          Mainline for the Connection.
protected  void setUp()
          Create a connection.
static junit.framework.Test suite()
          Create the suite of tests for the Connection.
 void testClose()
          Test if the close method.
 void testReceive()
          Test the execute method for function 'receive'.
 void testReceiveWithIndexedOutputRecord()
          Test the execute method for function 'receive' with an indexed output record.
 void testReceiveWithMappedOutputRecord()
          Test the execute method for function 'receive' with a mapped output record.
 void testSend()
          Test the execute method for function 'send'.
 void testWarnings()
          Test if interactions are invalidated by the connection close method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

mRecordFactory

protected RecordFactory mRecordFactory
The record factory used in the tests.


mConnection

protected Connection mConnection
The connection used in the tests.

Constructor Detail

InteractionUnitTest

public InteractionUnitTest(String testName)
Construct a Connection test.

Parameters:
testName - the name of the test
Method Detail

suite

public static junit.framework.Test suite()
Create the suite of tests for the Connection.

Returns:
The suite of tests.

setUp

protected void setUp()
Create a connection.

Overrides:
setUp in class junit.framework.TestCase

getEmailAddress

public InternetAddress getEmailAddress()
Return a valid adjusted email address. Extract the 'mail.from' property from the configuration properties, but add quotes just to fool our checkForMe() test in EmailInteraction.

Returns:
The 'mail.from' property from the configuration with a quoted local part (see RFC822 http://www.faqs.org/rfcs/rfc822.html).

testWarnings

public void testWarnings()
Test if interactions are invalidated by the connection close method.


testClose

public void testClose()
Test if the close method.


testSend

public void testSend()
Test the execute method for function 'send'.


testReceive

public void testReceive()
Test the execute method for function 'receive'.


testReceiveWithIndexedOutputRecord

public void testReceiveWithIndexedOutputRecord()
Test the execute method for function 'receive' with an indexed output record.


testReceiveWithMappedOutputRecord

public void testReceiveWithMappedOutputRecord()
Test the execute method for function 'receive' with a mapped output record.


main

public static void main(String[] args)
Mainline for the Connection. Invoke the JUnit mainline.

Parameters:
args - JUnit arguments, optionally prefixed by a JUnit test runner class name. The default is junit.swingui.TestRunner, but other possibilities include:

junit.textui.TestRunner

junit.awtui.TestRunner


Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.