*
* @throws Exception exception
*/
@Test
public void add() throws Exception {
final ArchiveDateRepository archiveDateRepository = getArchiveDateRepository();
final JSONObject archiveDate = new JSONObject();
archiveDate.put(ArchiveDate.ARCHIVE_TIME, DateUtils.parseDate("2011/12", new String[] {"yyyy/MM"}).getTime());
archiveDate.put(ArchiveDate.ARCHIVE_DATE_ARTICLE_COUNT, 1);
archiveDate.put(ArchiveDate.ARCHIVE_DATE_PUBLISHED_ARTICLE_COUNT, 1);
final Transaction transaction = archiveDateRepository.beginTransaction();
archiveDateRepository.add(archiveDate);
transaction.commit();
final List<JSONObject> archiveDates = archiveDateRepository.getArchiveDates();
Assert.assertNotNull(archiveDates);
Assert.assertEquals(archiveDates.size(), 1);
}