gov.nih.nci.cabig.caaers.domain.workflow.ReviewCommentTest.java Source code

Java tutorial

Introduction

Here is the source code for gov.nih.nci.cabig.caaers.domain.workflow.ReviewCommentTest.java

Source

/*******************************************************************************
 * Copyright SemanticBits, Northwestern University and Akaza Research
 * 
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/caaers/LICENSE.txt for details.
 ******************************************************************************/
package gov.nih.nci.cabig.caaers.domain.workflow;

import junit.framework.TestCase;

import org.apache.commons.lang.StringUtils;

public class ReviewCommentTest extends TestCase {
    ReviewComment comment;

    protected void setUp() throws Exception {
        super.setUp();
        comment = new ReportingPeriodReviewComment();
    }

    public void testGetFullComment() {
        assertTrue(StringUtils.isEmpty(comment.getFullComment()));
        comment.setAutoGeneratedText("Hello");
        assertEquals("Hello", comment.getFullComment());
        comment.setAutoGeneratedText(null);
        assertTrue(StringUtils.isEmpty(comment.getFullComment()));
        comment.setUserComment("World");
        System.out.println(comment.getFullComment());
        assertEquals(" : World", comment.getFullComment());

        comment.setAutoGeneratedText("Hello");
        assertEquals("Hello : World", comment.getFullComment());
    }

    public void testIsEditable() {
        assertNull(comment.getEditable());
        comment.setEditable(Boolean.TRUE);
        assertTrue(comment.getEditable());
    }

    public void testGetUserId() {
        assertNull(comment.getUserId());
        comment.setUserId("abcd");
        assertEquals("abcd", comment.getUserId());
    }
}