org.unitils.dbmaintainer.structure.impl
Class DtdDataSetStructureGenerator
java.lang.Object
org.unitils.dbmaintainer.util.BaseDatabaseAccessor
org.unitils.dbmaintainer.structure.impl.DtdDataSetStructureGenerator
- All Implemented Interfaces:
- DataSetStructureGenerator, DatabaseAccessing
public class DtdDataSetStructureGenerator
- extends BaseDatabaseAccessor
- implements DataSetStructureGenerator
Implementation of DataSetStructureGenerator
for the DbUnit FlatXmlDataSet
XML test data files format
todo test and fix for hsqldb (see sample project)
- Author:
- Filip Neven, Tim Ducheyne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROPKEY_DTD_FILENAME
public static final String PROPKEY_DTD_FILENAME
- See Also:
- Constant Field Values
DtdDataSetStructureGenerator
public DtdDataSetStructureGenerator()
doInit
protected void doInit(Properties configuration)
- Initializes the generator by retrieving the name for the DTD file.
- Overrides:
doInit
in class BaseDatabaseAccessor
- Parameters:
configuration
- The config, not null
generateDataSetStructure
public void generateDataSetStructure()
- Generates the DTD, and writes it to the file specified by the property
PROPKEY_DTD_FILENAME
.
The DTD will contain the structure of the database. All tables will be written as optional elements and
all columns will be optional attributes.
- Specified by:
generateDataSetStructure
in interface DataSetStructureGenerator
generateDtdContent
protected String generateDtdContent()
- Generates the actual content of the DTD file as an in-memory string.
- Returns:
- the DTD content, not null
Copyright © 2011. All Rights Reserved.