Examples of WorkReportType


Examples of org.libreplan.business.workreports.entities.WorkReportType

    @Test
    @Transactional
    public void checkIfCodeWorkReportTypeIsUnique() throws ValidationException {
        String code = new String("A");
        WorkReportType workReportTypeA = createValidWorkReportType();
        workReportTypeA.setCode(code);
        workReportTypeDAO.save(workReportTypeA);
        workReportTypeDAO.flush();

        WorkReportType workReportTypeACopy = createValidWorkReportType();
        workReportTypeACopy.setCode(code);

        try {
            workReportTypeDAO.save(workReportTypeACopy);
            workReportTypeDAO.flush();
            fail("It should throw an Exception");
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    @Transactional
    public void checkIfNameWorkReportTypeIsUnique() throws ValidationException {
        WorkReportType workReportTypeA = createValidWorkReportType();
        workReportTypeA.setName("A");
        workReportTypeDAO.save(workReportTypeA);
        workReportTypeDAO.flush();

        WorkReportType workReportTypeACopy = createValidWorkReportType();
        workReportTypeACopy.setName("A");

        try {
            workReportTypeDAO.save(workReportTypeACopy);
            workReportTypeDAO.flush();
            fail("It should throw an Exception");
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

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

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

        DescriptionField descriptionFieldLine = createValidDescriptionField();
        workReportType.addDescriptionFieldToEndLine(descriptionFieldLine);

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

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

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

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

        DescriptionField descriptionFieldLine = createValidDescriptionField();
        descriptionFieldLine.setFieldName("A");
        workReportType.addDescriptionFieldToEndLine(descriptionFieldLine);

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

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @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) {
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @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) {
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

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

        WorkReportLabelTypeAssigment labelAssigmentHead = createValidWorkReportLabelTypeAssigment();
        workReportType.addLabelAssigmentToEndHead(labelAssigmentHead);

        WorkReportLabelTypeAssigment labelAssigmentLine = createValidWorkReportLabelTypeAssigment();
        workReportType.addLabelAssigmentToEndLine(labelAssigmentLine);

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

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    @Transactional
    public void checkIfLabelTypeWorkReportLabelTypeAssigmentIsNull() {
        WorkReportType workReportType = createValidWorkReportType();
        WorkReportLabelTypeAssigment labelAssigment = createValidWorkReportLabelTypeAssigment();
        labelAssigment.setLabelType(null);
        workReportType.addLabelAssigmentToEndLine(labelAssigment);

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

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    @Transactional
    public void checkIfLabelWorkReportLabelTypeAssigmentIsNull() {
        WorkReportType workReportType = createValidWorkReportType();
        WorkReportLabelTypeAssigment labelAssigment = createValidWorkReportLabelTypeAssigment();
        labelAssigment.setDefaultLabel(null);
        workReportType.addLabelAssigmentToEndLine(labelAssigment);

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

Examples of org.libreplan.business.workreports.entities.WorkReportType

        return workReportLines;
    }

    public WorkReport createValidWorkReport() {
        WorkReportType workReportType = createValidWorkReportType();
        workReportTypeDAO.save(workReportType);
        WorkReport workReport = WorkReport.create(workReportType);
        return workReport;
    }
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.