Examples of TagImpl


Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Override
    public TagImpl convert(Tag tag) {
        String id = tag.getId() == null ? generateId() : tag.getId();
        return new TagImpl(id, tag.getKeyword());
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    private Tag getTag(String keyword) {
        Tag tag = tagService.getTagByKeyword(keyword);
        if (tag == null) {
            tag = new TagImpl(keyword);
            tag = tagService.save(tag);
        }
        return tag;
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    private Tag getTag(String keyword) {
        Tag tag = tagService.getTagByKeyword(keyword);
        if (tag == null) {
            tag = new TagImpl();
            tag.setKeyword(keyword);
        }
        return tag;
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    @Test
    public void saveWidgetTag() {
        try {

            WidgetTagImpl wtag = new WidgetTagImpl();
            TagImpl tag = new TagImpl();
            wtag.setTag(tag);
            expect(widgetTagRepository.save(wtag)).andReturn(wtag);
            replay(widgetTagRepository);

            widgetTagService.createWidgetTag(wtag);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Test
    public void getAll(){
        List<Tag> tags = Arrays.<Tag>asList(new TagImpl(), new TagImpl());

        expect(tagTemplate.find(new Query())).andReturn(tags);
        replay(tagTemplate);

        List<Tag> result = repo.getAll();
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Test
    public void getLimitedList(){
        List<Tag> tags = Arrays.<Tag>asList(new TagImpl(), new TagImpl());

        expect(tagTemplate.find(new Query())).andReturn(tags);
        replay(tagTemplate);

        List<Tag> result = repo.getAll();
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Test
    public void getByKeyword() {
        String keyword = "key";
        Tag t = new TagImpl("1", keyword);
        expect(tagTemplate.findOne(Query.query(Criteria.where("keyword").is(keyword)))).andReturn(t);
        replay(tagTemplate);

        Tag fromRepo = repo.getByKeyword(keyword);
        assertThat(fromRepo.getKeyword(), is(equalTo(keyword)));
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    @Test
    public void get() {
        String keyword = "key";
        String id = "1";
        Tag t = new TagImpl(id, keyword);
        expect(tagTemplate.get(id)).andReturn(t);
        replay(tagTemplate);

        Tag fromRepo = repo.get(id);
        assertThat(fromRepo.getId(), is(equalTo(id)));
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Test
    public void save(){
        String keyword = "KEYWORD";
        Tag tag = new TagImpl("ID", keyword);
        expect(tagTemplate.count(Query.query(Criteria.where("keyword").is(keyword)))).andReturn(0L);
        expect(tagTemplate.save(tag)).andReturn(tag);
        replay(tagTemplate);
        Tag returned = repo.save(tag);
        verify(tagTemplate);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.TagImpl

    }

    @Test
    public void save_more(){
        String keyword = "KEYWORD";
        Tag tag = new TagImpl("ID", keyword);
        expect(tagTemplate.count(Query.query(Criteria.where("keyword").is(keyword)))).andReturn(1L);
        replay(tagTemplate);
        Tag returned = repo.save(tag);
        verify(tagTemplate);
        assertThat(returned, is(sameInstance(tag)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.