org.dbunit.ant
Class AbstractStep

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.dbunit.ant.AbstractStep
All Implemented Interfaces:
Cloneable, DbUnitTaskStep
Direct Known Subclasses:
Compare, Export, Operation

public abstract class AbstractStep
extends org.apache.tools.ant.ProjectComponent
implements DbUnitTaskStep

Since:
2.1 (Apr 3, 2004)
Version:
$Revision: 855 $ $Date: 2008-11-01 15:23:09 +0100 (Sat, 01 Nov 2008) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Field Summary
static String FORMAT_CSV
           
static String FORMAT_DTD
           
static String FORMAT_FLAT
           
static String FORMAT_XLS
           
static String FORMAT_XML
           
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
AbstractStep()
           
 
Method Summary
protected  void checkDataFormat(String format)
          Checks if the given data format is a valid one according to the method isDataFormat(String).
protected  IDataSet getDatabaseDataSet(IDatabaseConnection connection, List tables, boolean forwardonly)
           
static InputSource getInputSource(File file)
          Creates and returns an InputSource
protected  IDataSet getSrcDataSet(File src, String format, boolean forwardonly)
           
 boolean isDataFormat(String format)
          Checks if the given format is a format which contains tabular data.
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dbunit.ant.DbUnitTaskStep
execute, getLogMessage
 

Field Detail

FORMAT_FLAT

public static final String FORMAT_FLAT
See Also:
Constant Field Values

FORMAT_XML

public static final String FORMAT_XML
See Also:
Constant Field Values

FORMAT_DTD

public static final String FORMAT_DTD
See Also:
Constant Field Values

FORMAT_CSV

public static final String FORMAT_CSV
See Also:
Constant Field Values

FORMAT_XLS

public static final String FORMAT_XLS
See Also:
Constant Field Values
Constructor Detail

AbstractStep

public AbstractStep()
Method Detail

getDatabaseDataSet

protected IDataSet getDatabaseDataSet(IDatabaseConnection connection,
                                      List tables,
                                      boolean forwardonly)
                               throws DatabaseUnitException
Throws:
DatabaseUnitException

getSrcDataSet

protected IDataSet getSrcDataSet(File src,
                                 String format,
                                 boolean forwardonly)
                          throws DatabaseUnitException
Throws:
DatabaseUnitException

isDataFormat

public boolean isDataFormat(String format)
Checks if the given format is a format which contains tabular data.

Parameters:
format - The format to check
Returns:
true if the given format is a data format. A data format is a format which holds tabular data that can be loaded via dbunit. An example for a data format is "xml" or "flat". A non-data format is "dtd" which holds only metadata information.
Since:
2.4

checkDataFormat

protected void checkDataFormat(String format)
Checks if the given data format is a valid one according to the method isDataFormat(String). If it is not an IllegalArgumentException is thrown.

Parameters:
format - The format to check
Throws:
IllegalArgumentException - If the given format is not a valid data format
Since:
2.4

getInputSource

public static InputSource getInputSource(File file)
                                  throws MalformedURLException
Creates and returns an InputSource

Parameters:
file - The file for which an InputSource should be created
Returns:
The input source for the given file
Throws:
MalformedURLException


Copyright © 2002-2012. All Rights Reserved.