Examples of WidgetComment


Examples of org.apache.rave.portal.model.WidgetComment

        Date createdDate = new Date();
        Date lastModDate = new Date();
        String text = "my comment";
        User user = new UserImpl(VALID_USER_ID);

        WidgetComment wc = new JpaWidgetComment();
        wc.setCreatedDate(createdDate);
        wc.setWidgetId(VALID_WIDGET_ID);
        wc.setLastModifiedDate(lastModDate);
        wc.setText(text);
        wc.setUser(user);
        assertThat(wc.getId(), is(nullValue()));
        repository.save(wc);
        long newId = wc.getId();
        assertThat(newId > 0, is(true));
        WidgetComment newComment = repository.get(newId);
        assertThat(newComment.getWidgetId(), is(VALID_WIDGET_ID));
        assertThat(newComment.getUser().getId(), is(VALID_USER_ID));
        assertThat(newComment.getText(), is(text));
        assertThat(newComment.getCreatedDate(), is(createdDate));
        assertThat(newComment.getLastModifiedDate(), is(lastModDate));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void save_existing() {
        final String UPDATED_TEXT = "updated comment";
        WidgetComment widgetComment = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(widgetComment.getText(), is(not(UPDATED_TEXT)));
        widgetComment.setText(UPDATED_TEXT);
        repository.save(widgetComment);
        WidgetComment updatedComment = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(updatedComment.getText(), is(UPDATED_TEXT));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_jpaObject() {
        WidgetComment wc = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(wc, is(notNullValue()));
        repository.delete(wc);
        wc = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(wc, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_implObject() {
        WidgetComment wc = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(wc, is(notNullValue()));
        WidgetComment impl = new WidgetCommentImpl(wc.getId());
        repository.delete(impl);
        wc = repository.get(VALID_WIDGET_COMMENT_ID);
        assertThat(wc, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

    @Autowired
    private JpaWidgetCommentConverter widgetCommentConverter;

    @Test
    public void noConversion() {
        WidgetComment comment = new JpaWidgetComment();
        assertThat(widgetCommentConverter.convert(comment), is(sameInstance(comment)));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

        assertThat(widgetCommentConverter.convert(comment), is(sameInstance(comment)));
    }

    @Test
    public void nullConversion() {
        WidgetComment template = null;
        assertThat(widgetCommentConverter.convert(template), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

    }


    @Test
    public void newComment() {
        WidgetComment comment = new WidgetCommentImpl();
        comment.setCreatedDate(new Date());
        comment.setId(9L);
        comment.setLastModifiedDate(new Date());
        comment.setText("hello");
        comment.setUser(new JpaUser(1L));
        comment.setWidgetId(9L);

        JpaWidgetComment converted = widgetCommentConverter.convert(comment);
        assertThat(converted, is(not(sameInstance(comment))));
        assertThat(converted, is(instanceOf(JpaWidgetComment.class)));
        assertThat(converted.getCreatedDate(), is(equalTo(comment.getCreatedDate())));
        assertThat(converted.getEntityId(), is(equalTo(comment.getId())));
        assertThat(converted.getId(), is(equalTo(comment.getId())));
        assertThat(converted.getLastModifiedDate(), is(equalTo(comment.getLastModifiedDate())));
        assertThat(converted.getText(), is(equalTo(comment.getText())));
        assertThat(converted.getUser(), is(equalTo(comment.getUser())));
        assertThat(converted.getWidgetId(), is(equalTo(comment.getWidgetId())));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

        widgetCommentService = new DefaultWidgetCommentService(widgetCommentRepository);
    }

    @Test
    public void getWidgetComment() {
        WidgetComment comment = new WidgetCommentImpl();
        comment.setId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        replay(widgetCommentRepository);

        assertEquals(comment, widgetCommentService.getWidgetComment(1L));
        verify(widgetCommentRepository);
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

        verify(widgetCommentRepository);
    }

    @Test
    public void saveWidgetComment() {
        WidgetComment comment = new WidgetCommentImpl();
        comment.setId(1L);
        expect(widgetCommentRepository.save(comment)).andReturn(comment);
        replay(widgetCommentRepository);

        widgetCommentService.saveWidgetComment(comment);
        verify(widgetCommentRepository);
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetComment

        verify(widgetCommentRepository);
    }

    @Test
    public void deleteWidgetComment() {
        WidgetComment comment = new WidgetCommentImpl();
        comment.setId(1L);
        expect(widgetCommentRepository.get(1L)).andReturn(comment);
        widgetCommentRepository.delete(comment);
        replay(widgetCommentRepository);

        widgetCommentService.removeWidgetComment(1L);
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.