use of org.b3log.solo.repository.ArchiveDateArticleRepository in project solo by b3log.
the class ArchiveDateArticleRepositoryImplTestCase method getByArchiveDateId.
/**
* Get By ArchiveDate Id.
*
* @throws Exception exception
*/
@Test(dependsOnMethods = "add")
public void getByArchiveDateId() throws Exception {
final ArchiveDateArticleRepository archiveDateArticleRepository = getArchiveDateArticleRepository();
final JSONObject found = archiveDateArticleRepository.getByArchiveDateId("archiveDateId", 1, Integer.MAX_VALUE);
Assert.assertNotNull(found);
final JSONObject notFound = archiveDateArticleRepository.getByArchiveDateId("not found", 1, Integer.MAX_VALUE);
Assert.assertNotNull(notFound);
}
use of org.b3log.solo.repository.ArchiveDateArticleRepository in project solo by b3log.
the class ArchiveDateArticleRepositoryImplTestCase method add.
/**
* Adds successfully.
*
* @throws Exception exception
*/
@Test
public void add() throws Exception {
final ArchiveDateArticleRepository archiveDateArticleRepository = getArchiveDateArticleRepository();
final JSONObject archiveDateArticle = new JSONObject();
archiveDateArticle.put(ArchiveDate.ARCHIVE_DATE + "_" + Keys.OBJECT_ID, "archiveDateId");
archiveDateArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "articleId");
final Transaction transaction = archiveDateArticleRepository.beginTransaction();
archiveDateArticleRepository.add(archiveDateArticle);
transaction.commit();
final JSONObject found = archiveDateArticleRepository.getByArticleId("articleId");
Assert.assertNotNull(found);
final JSONObject notFound = archiveDateArticleRepository.getByArticleId("not found");
Assert.assertNull(notFound);
}
use of org.b3log.solo.repository.ArchiveDateArticleRepository in project solo by b3log.
the class ArchiveDateArticleRepositoryImplTestCase method getByArticleId.
/**
* Get By Archive Id.
*
* @throws Exception exception
*/
@Test(dependsOnMethods = "add")
public void getByArticleId() throws Exception {
final ArchiveDateArticleRepository archiveDateArticleRepository = getArchiveDateArticleRepository();
Assert.assertNotNull(archiveDateArticleRepository.getByArticleId("articleId"));
Assert.assertNull(archiveDateArticleRepository.getByArticleId("not found"));
}
Aggregations