Package net.stinfoservices.pacifiq.shared.dto

Examples of net.stinfoservices.pacifiq.shared.dto.DSP5DTO


        for (DSP5 dsp5 : dsp5s) {
            checkConsumedItemQuantities(dsp5);
        }
        for (DSP5 dsp5 : dsp5s) {
            // lazy is used here !
            DSP5DTO dsp5DTO = new DSP5DTO(dsp5, DTOPath.DSP5_BOARD);
            dsp5DTO.setOverConsumption(isConsumedItemCountTooBig(dsp5));
            dsp5DTO.setItemsFilled(dsp5.getItems().size() > 0);
            dsp5sDTO.add(dsp5DTO);
        }
        return dsp5sDTO;
    }
View Full Code Here


        } catch (Exception e) {
            readOnly = true;
        }

        DSP5 dsp5 = dSP5DAO.find(id);
        DSP5DTO dto = new DSP5DTO(dsp5, DTOPath.DSP5_DOC);
        dto.setOverConsumption(isConsumedItemCountTooBig(dsp5));
        if (readOnly) {
            dto.freeze();
        }
        return dto;
    }
View Full Code Here

    }

    @Override
    public DSP5DTO loadDsp5(Long id) throws Exception {
        ServiceSecurityHelper.hasAuthority(ProfileHelper.ADMINISTRATOR, getSession());
        return new DSP5DTO(dSP5DAO.find(id), DTOPath.DSP5_DOC);
    }
View Full Code Here

    @Test
    @DatabaseSetup(value = DATASET_DOCUMENT_DSP5)
    @ExpectedDatabase(value = DATASET_DOCUMENT_DSP5, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = DATASET_DOCUMENT_DSP5, type = DatabaseOperation.DELETE)
    public void testLoadDocument() throws Exception {
        DSP5DTO dto = dsp5Service.loadDocument(1L);
        assertNotNull(dto);
        assertEquals(dto.getItems().size(), 2);
    }
View Full Code Here

     */
    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_EMPTY)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, type = DatabaseOperation.DELETE)
    public void testSaveDocument() throws Exception {
        DSP5DTO dsp5 = new DSP5DTO();
        BusinessPartnerDTO bp1 = new BusinessPartnerDTO();
        BusinessPartnerDTO bp2 = new BusinessPartnerDTO();
        BusinessPartnerDTO bp3 = new BusinessPartnerDTO();
        BusinessPartnerDTO bp4 = new BusinessPartnerDTO();
        ConcreteBusinessPartnerDTO enduser = new ConcreteBusinessPartnerDTO();
        ConcreteBusinessPartnerDTO manufacturer = new ConcreteBusinessPartnerDTO();
        ConcreteBusinessPartnerDTO seller = new ConcreteBusinessPartnerDTO();
        ConcreteBusinessPartnerDTO sourceOfCommodity = new ConcreteBusinessPartnerDTO();
        String address = "somewhere";

        bp1.setId(3L);
        bp1.setName("john foo");
        bp2.setId(4L);
        bp1.setName("john too");
        bp3.setId(5L);
        bp1.setName("john luu");
        bp4.setId(6L);
        bp1.setName("john kof");
        enduser.setId(3L);
        enduser.setAddress(address);
        enduser.setBusinessPartner(bp1);
        manufacturer.setId(4L);
        manufacturer.setAddress(address);
        manufacturer.setBusinessPartner(bp2);
        seller.setId(5L);
        seller.setAddress(address);
        seller.setBusinessPartner(bp3);
        sourceOfCommodity.setId(6L);
        sourceOfCommodity.setAddress(address);
        sourceOfCommodity.setBusinessPartner(bp4);
        dsp5.setDateOfIssue(DSP5_DATE);
        dsp5.setEndDate(DSP5_DATE);
        dsp5.setFreeText("blabla");
        dsp5.setLicenseNumber("license 1");
        dsp5.setType12327(false);
        dsp5.setEndUser(enduser);
        dsp5.setManufacturer(manufacturer);
        dsp5.setSeller(seller);
        dsp5.setSourceOfCommodity(sourceOfCommodity);
        dsp5Service.saveDocument(dsp5);
    }
View Full Code Here

            }
            setConsumptions(theConsumptions);
        }

        if (path.accept(DTOPath.ITEM_WITH_DSP5_LINK)) {
            setDsp5(new DSP5DTO(item.getDsp5(), path));
        }
        setLine(item.getLine());
        setQuantity(item.getQuantity());
        setValue(item.getValue());
    }
View Full Code Here

    @Test
    public void testClone() throws Exception {
        DSP5 dsp5 = dsp5DAO.find(1L);
        assertNotNull(dsp5);

        DSP5DTO dsp5Document = new DSP5DTO(dsp5, DTOPath.DSP5_DOC);
        assertEquals(dsp5Document.getItems().size(), 2);
        DSP5DTO dsp5DocumentClone = dsp5Document.clone();
        assertNotSame(dsp5Document.getItems().iterator().next(), dsp5DocumentClone.getItems().iterator().next());
        verifyEquals(dsp5Document.getItems().iterator().next(), dsp5DocumentClone.getItems().iterator().next());
    }
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.shared.dto.DSP5DTO

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.