Package org.libreplan.business.workreports.valueobjects

Examples of org.libreplan.business.workreports.valueobjects.DescriptionField


    @Test
    @Transactional
    public void checkInvalidFieldNameDescriptionFields() {
        WorkReportType workReportType = createValidWorkReportType();

        DescriptionField descriptionFieldHead = createValidDescriptionField();
        descriptionFieldHead.setFieldName("");
        workReportType.addDescriptionFieldToEndHead(descriptionFieldHead);

        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
        }

        descriptionFieldHead.setFieldName(null);
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
        }

        descriptionFieldHead.setFieldName("XXX");
        try {
            workReportTypeDAO.save(workReportType);
        } catch (ValidationException e) {
            fail("It should throw an exception");
        }
View Full Code Here


    @Test
    @Transactional
    public void checkInvalidLenghtDescriptionFields() {
        WorkReportType workReportType = createValidWorkReportType();

        DescriptionField descriptionFieldHead = createValidDescriptionField();
        descriptionFieldHead.setLength(null);
        workReportType.addDescriptionFieldToEndHead(descriptionFieldHead);

        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
        }

        descriptionFieldHead.setLength(0);
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
        }

        descriptionFieldHead.setLength(1);
        try {
            workReportTypeDAO.save(workReportType);
        } catch (ValidationException e) {
            fail("It should throw an exception");
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workreports.valueobjects.DescriptionField

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.