Package org.b3log.solo.repository

Examples of org.b3log.solo.repository.ArchiveDateArticleRepository


     *
     * @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);
    }
View Full Code Here


     *
     * @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);
    }
View Full Code Here

     *
     * @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"));
    }
View Full Code Here

     *
     * @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);
    }
View Full Code Here

     *
     * @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);
    }
View Full Code Here

     *
     * @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"));
    }
View Full Code Here

TOP

Related Classes of org.b3log.solo.repository.ArchiveDateArticleRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.