use of org.dbunit.dataset.xml.FlatDtdWriter in project nextprot-api by calipho-sib.
the class GenerateDTDForUserSchema method generateUserDTD.
@Test
public void generateUserDTD() throws Exception {
IDatabaseConnection connection = new DatabaseConnection(dsLocator.getUserDataSource().getConnection());
// write DTD file
IDataSet dataSet = connection.createDataSet();
Writer out = new OutputStreamWriter(new FileOutputStream("user.dtd"));
FlatDtdWriter datasetWriter = new FlatDtdWriter(out);
datasetWriter.setContentModel(FlatDtdWriter.CHOICE);
// You could also use the sequence model which is the default
// datasetWriter.setContentModel(FlatDtdWriter.SEQUENCE);
datasetWriter.write(dataSet);
// delete file after the test
new File(dtdFile).delete();
}
use of org.dbunit.dataset.xml.FlatDtdWriter in project nextprot-api by calipho-sib.
the class GenerateDTD method generateDTD.
@Test
public void generateDTD() throws Exception {
IDatabaseConnection connection = new DatabaseConnection(dsLocator.getDataSource().getConnection());
// write DTD file
IDataSet dataSet = connection.createDataSet();
Writer out = new OutputStreamWriter(new FileOutputStream(dtdFile));
FlatDtdWriter datasetWriter = new FlatDtdWriter(out);
datasetWriter.setContentModel(FlatDtdWriter.CHOICE);
// You could also use the sequence model which is the default
// datasetWriter.setContentModel(FlatDtdWriter.SEQUENCE);
datasetWriter.write(dataSet);
// delete file after the test
new File(dtdFile).delete();
}
use of org.dbunit.dataset.xml.FlatDtdWriter in project nextprot-api by calipho-sib.
the class GenerateDTD method generateUserDTD.
@Test
public void generateUserDTD() throws Exception {
IDatabaseConnection connection = new DatabaseConnection(dsLocator.getUserDataSource().getConnection());
// write DTD file
IDataSet dataSet = connection.createDataSet();
Writer out = new OutputStreamWriter(new FileOutputStream("user.dtd"));
FlatDtdWriter datasetWriter = new FlatDtdWriter(out);
datasetWriter.setContentModel(FlatDtdWriter.CHOICE);
// You could also use the sequence model which is the default
// datasetWriter.setContentModel(FlatDtdWriter.SEQUENCE);
datasetWriter.write(dataSet);
// delete file after the test
new File(dtdFile).delete();
}
use of org.dbunit.dataset.xml.FlatDtdWriter in project nextprot-api by calipho-sib.
the class GenerateDTDForUserSchema method generateDTD.
@Test
public void generateDTD() throws Exception {
IDatabaseConnection connection = new DatabaseConnection(dsLocator.getDataSource().getConnection());
// write DTD file
IDataSet dataSet = connection.createDataSet();
Writer out = new OutputStreamWriter(new FileOutputStream(dtdFile));
FlatDtdWriter datasetWriter = new FlatDtdWriter(out);
datasetWriter.setContentModel(FlatDtdWriter.CHOICE);
// You could also use the sequence model which is the default
// datasetWriter.setContentModel(FlatDtdWriter.SEQUENCE);
datasetWriter.write(dataSet);
// delete file after the test
new File(dtdFile).delete();
}
use of org.dbunit.dataset.xml.FlatDtdWriter in project nextprot-api by calipho-sib.
the class GenerateUserDTD method generateUserDTD.
/**
* This method should be executed every times the db schema change.
* The schema is defined in main/resources/db.migration/*.sql.
* The generated file user.dtd should go
* @throws Exception
*/
@Test
public void generateUserDTD() throws Exception {
IDatabaseConnection connection = new DatabaseConnection(dsLocator.getUserDataSource().getConnection(), "np_users");
// write DTD file
IDataSet dataSet = connection.createDataSet();
Writer out = new OutputStreamWriter(new FileOutputStream(dtdFile));
FlatDtdWriter datasetWriter = new FlatDtdWriter(out);
datasetWriter.setContentModel(FlatDtdWriter.CHOICE);
datasetWriter.write(dataSet);
}
Aggregations