Examples of DocumentDTO


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

    }

    @Override
    public DocumentDTO findDocument(Long id) throws Exception {
        Document document = documentDAO.find(id);
        DocumentDTO documentDTO = new DocumentDTO(document, DTOPath.DOCUMENT_DOC);
        return documentDTO;
    }
View Full Code Here

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

    }

    @Override
    public DocumentDTO loadDocument(Long id) throws Exception {
        ServiceSecurityHelper.hasAuthority(ProfileHelper.ADMINISTRATOR, getSession());
        return new DocumentDTO(documentDAO.find(id), DTOPath.DOCUMENT_NAME);
    }
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
    @ExpectedDatabase(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, assertionMode = DatabaseAssertionMode.NON_STRICT)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, type = DatabaseOperation.DELETE)
    public void testFindDocument() throws Exception {
        DocumentDTO document = dsp5Service.findDocument(1L);

        assertNotNull(document);
        assertEquals("document 1", document.getName());
    }
View Full Code Here

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

     *            The path.
     */
    public TCNDTO(TCN tcn, DTOPath path) {
        this.id = tcn.getId();
        this.freeText = tcn.getFreeText();
        this.document = new DocumentDTO(tcn.getDocument(), path);
    }
View Full Code Here

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

        assertNotNull(dtos);
        assertTrue(dtos.size() > 0);
        assertSame(4, dtos.size());
        for (int a = 0; a < dtos.size(); a++) {
            DocumentDTO dto = dtos.get(a);

            assertNotNull(dto);
            assertEquals("document " + dto.getId(), dto.getName());
        }
    }
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1_UPDATEDNAME, type = DatabaseOperation.DELETE)
    public void testUpdateNameViaUpdate() throws Exception {
        List<DocumentDTO> documents = documentService.findAllByName("document 1");
        DocumentDTO document;

        assertNotNull(documents);
        assertSame(1, documents.size());
        document = documents.get(0);
        assertNotNull(document);
        document.setDate(DOCUMENT_DATE);
        documentService.update(document);
    }
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, type = DatabaseOperation.DELETE)
    public void testRemoveName() throws Exception {
        List<DocumentDTO> documents = documentService.findAllByName("document 1");
        DocumentDTO document;

        assertNotNull(documents);
        assertSame(1, documents.size());
        document = documents.get(0);
        assertNotNull(document);
        document.setName(null);
        // The deletion should fail (the name of the document is set to "not null")
        try {
            documentService.update(document);
            ModelValidator.validate(document);
            fail("The name of a document should not be null.");
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1_UPDATEDDESCRIPTION)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1, type = DatabaseOperation.DELETE)
    public void testRemoveDescription() throws Exception {
        List<DocumentDTO> documents = documentService.findAllByName("document 1");
        DocumentDTO document;

        assertNotNull(documents);
        assertSame(1, documents.size());
        document = documents.get(0);
        assertNotNull(document);
        document.setDescription(null);
        documentService.update(document);
    }
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1_UPDATEDDESCRIPTION, type = DatabaseOperation.DELETE)
    public void testUpdateDescriptionViaUpdate() throws Exception {
        List<DocumentDTO> documents = documentService.findAllByName("document 1");
        DocumentDTO document;

        assertNotNull(documents);
        assertSame(1, documents.size());
        document = documents.get(0);
        assertNotNull(document);
        document.setDescription("description");
        documentService.update(document);
    }
View Full Code Here

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

    @Test
    @DatabaseSetup(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1)
    @DatabaseTearDown(value = DATASET_SERVICE_ADMIN_DOCUMENT_X1_UPDATEDDATE, type = DatabaseOperation.DELETE)
    public void testUpdateDateViaUpdate() throws Exception {
        List<DocumentDTO> documents = documentService.findAllByName("document 1");
        DocumentDTO document;

        assertNotNull(documents);
        assertSame(1, documents.size());
        document = documents.get(0);
        assertNotNull(document);
        document.setDate(DOCUMENT_DATE);
        documentService.update(document);
    }
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.