Package org.dbunit.dataset.yaml
Class YamlDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.CachedDataSet
org.dbunit.dataset.yaml.YamlDataSet
- All Implemented Interfaces:
IDataSet,IDataSetConsumer
Reads and writes flat YAML-based dataset documents. Contrary to the flat XML layout,
columns are calculated by parsing the entire data set, not just the first row.
The format looks like this:
I.e.:
The format looks like this:
<table_name>:
- <column>: <value>
<column>: <value>
...
- <column>: <value>
<column>: <value>
...
...
...
I.e.:
TEST_TABLE:
- COL0: "row 0 col 0"
COL1: "row 0 col 1"
COL2: "row 0 col 2"
- COL1: "row 1 col 1"
SECOND_TABLE:
- COL0: "row 0 col 0"
COL1: "row 0 col 1"
EMPTY_TABLE: []
- Version:
- $Revision$ $Date$
- Author:
- Björn Beskow
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionYamlDataSet(File file) Creates a YAML dataset based on a yaml fileYamlDataSet(InputStream inputStream) Creates a YAML dataset based on an inputstream -
Method Summary
Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTableMethods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, initialize, isCaseSensitiveTableNames, iterator, reverseIterator, toString
-
Constructor Details
-
YamlDataSet
Creates a YAML dataset based on a yaml file- Throws:
IOExceptionDataSetException
-
YamlDataSet
Creates a YAML dataset based on an inputstream- Parameters:
inputStream- An inputstream pointing to a YAML dataset- Throws:
DataSetException
-
-
Method Details
-
write
Write the specified dataset to the specified output stream as YAML.- Throws:
DataSetException
-
write
Write the specified dataset to the specified writer as YAML.- Throws:
DataSetException
-