@DatabaseTearDown(value = CREATE_DATASET, type = DatabaseOperation.DELETE_ALL)
@Override
public void testSave() throws Exception {
try {
DatabaseConnection connection = new DatabaseConnection(dataSource.getConnection());
IDataSet expectedDataSet = new FlatXmlDataSetBuilder().build(this.getClass().getResource("/dbunit/dao/admin/alert-create_no-id.xml")
.openStream());
Alert alert = new Alert();
Alert nalert;
alert.setId(null);
alert.setStartTime(DEFAULT_DATE);
alert.setEndTime(DEFAULT_DATE);
alert.setMonday(false);
alert.setTuesday(false);
alert.setWednesday(false);
alert.setThursday(false);
alert.setFriday(false);
alert.setSaturday(false);
alert.setSunday(false);
alert.setVersion(1);
nalert = alertDAO.save(alert);
assertEquals(alert.getStartTime(), nalert.getStartTime());
assertEquals(alert.getEndTime(), nalert.getEndTime());
assertEquals(alert.getMonday(), nalert.getMonday());
assertEquals(alert.getTuesday(), nalert.getTuesday());
assertEquals(alert.getWednesday(), nalert.getWednesday());
assertEquals(alert.getThursday(), nalert.getThursday());
assertEquals(alert.getFriday(), nalert.getFriday());
assertEquals(alert.getSaturday(), nalert.getSaturday());
assertEquals(alert.getSunday(), nalert.getSunday());
entityManager.getTransaction().commit();
DatabaseAssertionMode.NON_STRICT.getDatabaseAssertion().assertEquals(expectedDataSet,
connection.createDataSet(expectedDataSet.getTableNames()));
connection.close();
} catch (DatabaseUnitException e) {
e.printStackTrace();
fail(e.getLocalizedMessage());
} catch (SQLException e) {