Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.ExternalLink


        dao.saveOrUpdate(link);
    }

    @Test(expectedExceptions = ConstraintViolationException.class)
    public void shouldFailWithNotValidUrl() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        link.setUrl("://jtalks.org");
        dao.saveOrUpdate(link);
    }
View Full Code Here


        dao.saveOrUpdate(link);
    }

    @Test(expectedExceptions = ConstraintViolationException.class)
    public void shouldFailWithLongUrl() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        //-10 = protocol + domen
        link.setUrl("http://" + RandomStringUtils.random(ExternalLink.URL_MAX_SIZE - 10, true, false) + ".org");
        session.saveOrUpdate(link);
    }
View Full Code Here

        session.saveOrUpdate(link);
    }

    @Test
    public void shouldSuccessWithMaxLengthUrl() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        //-10 = protocol + domen
        link.setUrl("http://" + RandomStringUtils.random(ExternalLink.URL_MAX_SIZE - 11, true, false) + ".org");
        dao.saveOrUpdate(link);
    }
View Full Code Here

        dao.saveOrUpdate(link);
    }

    @Test(expectedExceptions = ConstraintViolationException.class)
    public void nullHintForExternalLinkShouldRaiseConstraintException() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        link.setHint(null);
        dao.saveOrUpdate(link);
    }
View Full Code Here

        dao.saveOrUpdate(link);
    }

    @Test
    public void shouldSuccessWithMaxLengthHint() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        link.setHint(RandomStringUtils.random(ExternalLink.HINT_MAX_SIZE, true, false));
        dao.saveOrUpdate(link);
    }
View Full Code Here

        dao.saveOrUpdate(link);
    }

    @Test(expectedExceptions = ConstraintViolationException.class)
    public void shouldFailWithLongHint() {
        ExternalLink link = ObjectsFactory.getDefaultExternalLink();
        link.setHint(RandomStringUtils.random(ExternalLink.HINT_MAX_SIZE + 1, true, false));
        dao.saveOrUpdate(link);
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.ExternalLink

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.