org.apache.james.test.functional
Class FileProtocolSessionBuilder

java.lang.Object
  extended by org.apache.james.test.functional.FileProtocolSessionBuilder

public class FileProtocolSessionBuilder
extends java.lang.Object

A builder which generates a ProtocolSession from a test file.

Version:
$Revision: 709874 $
Author:
Darrell DeBoer

Constructor Summary
FileProtocolSessionBuilder()
           
 
Method Summary
 void addProtocolLinesFromStream(java.io.InputStream is, ProtocolSession session, java.lang.String fileName)
          Reads ProtocolElements from the supplied InputStream and adds them to the ProtocolSession.
 void addTestFile(java.lang.String fileName, ProtocolSession session)
          Adds all protocol elements from a test file to the ProtocolSession supplied.
 ProtocolSession buildProtocolSession(java.lang.String fileName)
          Builds a ProtocolSession by reading lines from the test file with the supplied name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProtocolSessionBuilder

public FileProtocolSessionBuilder()
Method Detail

buildProtocolSession

public ProtocolSession buildProtocolSession(java.lang.String fileName)
                                     throws java.lang.Exception
Builds a ProtocolSession by reading lines from the test file with the supplied name.

Parameters:
fileName - The name of the protocol session file.
Returns:
The ProtocolSession
Throws:
java.lang.Exception

addTestFile

public void addTestFile(java.lang.String fileName,
                        ProtocolSession session)
                 throws java.lang.Exception
Adds all protocol elements from a test file to the ProtocolSession supplied.

Parameters:
fileName - The name of the protocol session file.
session - The ProtocolSession to add the elements to.
Throws:
java.lang.Exception

addProtocolLinesFromStream

public void addProtocolLinesFromStream(java.io.InputStream is,
                                       ProtocolSession session,
                                       java.lang.String fileName)
                                throws java.lang.Exception
Reads ProtocolElements from the supplied InputStream and adds them to the ProtocolSession.

Parameters:
is - The input stream containing the protocol definition.
session - The ProtocolSession to add elements to.
fileName - The name of the source file, for error messages.
Throws:
java.lang.Exception


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.