Package org.b3log.solo.repository

Examples of org.b3log.solo.repository.TagArticleRepository


        Assert.assertNotNull(tags);
        Assert.assertEquals(tags.size(), 0);
    }

    private void addTagArticle() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONObject tagArticle = new JSONObject();

        tagArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "article1 id");
        tagArticle.put(Tag.TAG + "_" + Keys.OBJECT_ID, "tag1 id");

        final Transaction transaction = tagArticleRepository.beginTransaction();
        tagArticleRepository.add(tagArticle);
        transaction.commit();
    }
View Full Code Here


     *
     * @throws Exception exception
     */
    @Test
    public void add() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONObject tagArticle = new JSONObject();

        tagArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "article1 id");
        tagArticle.put(Tag.TAG + "_" + Keys.OBJECT_ID, "tag1 id");

        final Transaction transaction = tagArticleRepository.beginTransaction();
        tagArticleRepository.add(tagArticle);
        transaction.commit();
    }
View Full Code Here

     *
     * @throws Exception exception
     */
    @Test(dependsOnMethods = "add")
    public void getByArticleId() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final List<JSONObject> tagArticle =
                tagArticleRepository.getByArticleId("article1 id");
        Assert.assertNotNull(tagArticle);

        Assert.assertEquals(tagArticleRepository.getByArticleId("").size(), 0);
    }
View Full Code Here

     *
     * @throws Exception exception
     */
    @Test(dependsOnMethods = "add")
    public void getByTagId() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONArray results =
                tagArticleRepository.getByTagId("tag1 id", 1, Integer.MAX_VALUE).
                getJSONArray(Keys.RESULTS);
        Assert.assertEquals(results.length(), 1);
    }
View Full Code Here

     *
     * @throws Exception exception
     */
    @Test
    public void add() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONObject tagArticle = new JSONObject();

        tagArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "article1 id");
        tagArticle.put(Tag.TAG + "_" + Keys.OBJECT_ID, "tag1 id");

        final Transaction transaction = tagArticleRepository.beginTransaction();
        tagArticleRepository.add(tagArticle);
        transaction.commit();
    }
View Full Code Here

     *
     * @throws Exception exception
     */
    @Test(dependsOnMethods = "add")
    public void getByArticleId() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final List<JSONObject> tagArticle =
                tagArticleRepository.getByArticleId("article1 id");
        Assert.assertNotNull(tagArticle);

        Assert.assertEquals(tagArticleRepository.getByArticleId("").size(), 0);
    }
View Full Code Here

     *
     * @throws Exception exception
     */
    @Test(dependsOnMethods = "add")
    public void getByTagId() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONArray results =
                tagArticleRepository.getByTagId("tag1 id", 1, Integer.MAX_VALUE).
                getJSONArray(Keys.RESULTS);
        Assert.assertEquals(results.length(), 1);
    }
View Full Code Here

        Assert.assertNotNull(tags);
        Assert.assertEquals(tags.size(), 0);
    }

    private void addTagArticle() throws Exception {
        final TagArticleRepository tagArticleRepository =
                getTagArticleRepository();

        final JSONObject tagArticle = new JSONObject();

        tagArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "article1 id");
        tagArticle.put(Tag.TAG + "_" + Keys.OBJECT_ID, "tag1 id");

        final Transaction transaction = tagArticleRepository.beginTransaction();
        tagArticleRepository.add(tagArticle);
        transaction.commit();
    }
View Full Code Here

TOP

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

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.