Package org.jtalks.common.model.entity

Examples of org.jtalks.common.model.entity.Property


    public void setUp() {
        initMocks(this);
        imageSizeProperty.setName(PROPERTY_NAME);
        imageSizeProperty.setPropertyDao(propertyDao);
        when(propertyDao.getByName(PROPERTY_NAME))
                .thenReturn(new Property(PROPERTY_NAME, String.valueOf(IMAGE_MAX_SIZE)));
        imageService = new ImageService(
                imageConverter,
                base64Wrapper,
                "org/jtalks/jcommune/service/avatar.gif",
                imageSizeProperty);
View Full Code Here


    @Test
    public void testSendMessageNotificationEnabled() throws NotFoundException {

        when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder);
        when(propertyDao.getByName(PROPERTY_NAME)).
                thenReturn(new Property(PROPERTY_NAME, String.valueOf(SENDING_NOTIFICATIONS_ENABLED)));

        JC_USER.setSendPmNotification(SENDING_NOTIFICATIONS_ENABLED);
        PrivateMessage pm = pmService.sendMessage("body", "title", JC_USER, user);

        assertFalse(pm.isRead());
View Full Code Here

    @Test
    public void testSendMessageNotificationDisabled() throws NotFoundException {
        when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder);

        when(propertyDao.getByName(PROPERTY_NAME)).
                thenReturn(new Property(PROPERTY_NAME, String.valueOf(SENDING_NOTIFICATIONS_DISABLED)));

        JC_USER.setSendPmNotification(SENDING_NOTIFICATIONS_DISABLED);
        PrivateMessage pm = pmService.sendMessage("body", "title", JC_USER, user);

        assertFalse(pm.isRead());
View Full Code Here

    @Test
    public void testSendDraftNotificationEnabled() throws NotFoundException {
        when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder);
        when(propertyDao.getByName(PROPERTY_NAME)).
                thenReturn(new Property(PROPERTY_NAME, String.valueOf(SENDING_NOTIFICATIONS_ENABLED)));

        JC_USER.setSendPmNotification(SENDING_NOTIFICATIONS_ENABLED);
        PrivateMessage pm = pmService.sendDraft(1L, "body", "title", JC_USER, user);

        assertFalse(pm.isRead());
View Full Code Here

    @Test
    public void testSendDraftNotificationDisabled() throws NotFoundException {
        when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder);
        when(propertyDao.getByName(PROPERTY_NAME)).
                thenReturn(new Property(PROPERTY_NAME, String.valueOf(SENDING_NOTIFICATIONS_DISABLED)));

        JC_USER.setSendPmNotification(SENDING_NOTIFICATIONS_DISABLED);
        PrivateMessage pm = pmService.sendDraft(1L, "body", "title", JC_USER, user);

        assertFalse(pm.isRead());
View Full Code Here

    }

    @Test
    public void testGetValue() {
        String expected = "value";
        Property property = new Property("name", expected);
        Mockito.when(propertyDao.getByName(Mockito.anyString())).thenReturn(property);
        jcommuneProperty.setPropertyDao(propertyDao);

        String actual = jcommuneProperty.getValue();
View Full Code Here

        Assert.assertEquals(actual, expected, "Returned an invalid property value.");
    }

    @Test(dataProvider = "checkBooleanValueParameter")
    public void testBooleanValue(String value, Boolean expectedBoolean) {
        Property property = null;
        Mockito.when(propertyDao.getByName(Mockito.anyString())).thenReturn(property);
        jcommuneProperty.setPropertyDao(propertyDao);
        jcommuneProperty.setDefaultValue(value);

        Boolean actualBoolean = jcommuneProperty.booleanValue();
View Full Code Here

        };
    }

    @Test
    public void testIntValue() {
        Property property = null;
        Mockito.when(propertyDao.getByName(Mockito.anyString())).thenReturn(property);
        jcommuneProperty.setPropertyDao(propertyDao);
        jcommuneProperty.setDefaultValue("1");

        int actualValue = jcommuneProperty.intValue();
View Full Code Here

        Assert.assertEquals(actualValue, 1, "Returned an invalid property value.");
    }

    @Test(expectedExceptions = NumberFormatException.class)
    public void testIntValueWrong() {
        Property property = null;
        Mockito.when(propertyDao.getByName(Mockito.anyString())).thenReturn(property);
        jcommuneProperty.setPropertyDao(propertyDao);
        jcommuneProperty.setDefaultValue("");

        jcommuneProperty.intValue();
View Full Code Here

        jcommuneProperty.intValue();
    }

    @Test
    public void testGetValueWithNotFoundedProperty() {
        Property property = null;
        Mockito.when(propertyDao.getByName(Mockito.anyString())).thenReturn(property);
        jcommuneProperty.setPropertyDao(propertyDao);
        String expectedValue = Boolean.TRUE.toString();
        jcommuneProperty.setDefaultValue(expectedValue);
View Full Code Here

TOP

Related Classes of org.jtalks.common.model.entity.Property

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.