Package org.libreplan.business.orders.entities

Examples of org.libreplan.business.orders.entities.Order$CurrentVersionInfo


                    }
                });
    }

    private Order givenValidOrderAlreadyStored() {
        Order order = Order.create();
        order.setCode(UUID.randomUUID().toString());
        order.setName("Order name " + UUID.randomUUID());
        order.setInitDate(new Date());
        order.setCalendar(configurationDAO.getConfiguration()
                .getDefaultCalendar());
        OrderVersion version = setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(version);

        orderDAO.save(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here


    @Test
    @Transactional
    @Ignore("Only working if you have a Tim server configured")
    public void testExportTimesheetsToTimWithValidCodeAndOrder()
            throws ConnectorException {
        Order order = givenOrder();
        exportTimesheetsToTim.exportTimesheets("5160", order);
        boolean result = exportTimesheetsToTim.getSynchronizationInfo()
                .isSuccessful();
        if (!result) {
            fail("Export timesheets to tim failed");
View Full Code Here

    @Test(expected = ConnectorException.class)
    @Transactional
    public void testExportTimesheetsToTimWithInvalidCode()
            throws ConnectorException {
        Order order = givenOrder();
        exportTimesheetsToTim.exportTimesheets("", order);
    }
View Full Code Here

     * @param label
     *            the jira label
     */
    public void startSyncWithJira(String label) {
        try {
            Order order = getOrder();

            List<IssueDTO> issues = jiraOrderElementSynchronizer
                    .getJiraIssues(label);

            if (issues == null || issues.isEmpty()) {
                messagesForUser.showMessage(Level.ERROR,
                        _("No JIRA issues to import"));
                return;
            }

            order.setCodeAutogenerated(false);

            jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(
                    issues, order);

            orderController.saveAndContinue(false);
View Full Code Here

                    }
                });
    }

    private Order givenValidOrderAlreadyStored() {
        Order order = Order.create();
        order.setCode(UUID.randomUUID().toString());
        order.setName("Order name " + UUID.randomUUID());
        order.setInitDate(new Date());
        order.setCalendar(configurationDAO.getConfiguration()
                .getDefaultCalendar());
        OrderVersion version = setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(version);

        orderDAO.save(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here

                });
    }


    private Order givenValidOrderWithValidOrderLinesAlreadyStored() {
        Order order = givenOrder();
        jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(issues,
                order);
        order.dontPoseAsTransientObjectAnymore();
        orderDAO.saveWithoutValidating(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here

    @Test
    @Transactional
    @Ignore("Only working if you have a JIRA server configured")
    public void testSyncJiraTimesheet() throws ConnectorException {

        Order order = givenOrderWithValidOrderLines();
        jiraTimesheetSynchronizer
                .syncJiraTimesheetWithJiraIssues(issues, order);
        assertTrue(order.getWorkReportLines(false).size() > 0);
    }
View Full Code Here

                    }
                });
    }

    private Order givenValidOrderAlreadyStored() {
        Order order = Order.create();
        order.setCode(UUID.randomUUID().toString());
        order.setName("Order name " + UUID.randomUUID());
        order.setInitDate(new Date());
        order.setCalendar(configurationDAO.getConfiguration()
                .getDefaultCalendar());
        OrderVersion version = setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(version);

        orderDAO.save(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here

                });
    }


    private Order givenValidOrderWithValidOrderLinesAlreadyStored() {
        Order order = givenOrder();
        jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(issues, order);
        order.dontPoseAsTransientObjectAnymore();
        orderDAO.saveWithoutValidating(order);
        orderDAO.flush();
        try {
            return orderDAO.find(order.getId());
        } catch (InstanceNotFoundException e) {
            return null;
        }
    }
View Full Code Here

    @Test
    @Transactional
    @Ignore("Only working if you have a JIRA server configured")
    public void testSyncOrderElementsOfAnExistingOrderWithNoOrderLines() {
        Order order = givenOrder();
        jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(issues, order);
        assertEquals(order.getOrderElements().size(), issues.size());
        assertTrue(order.getOrderElements().get(0).getHoursGroups().size() > 0);
        assertTrue(!order.getAdvancePercentage().equals(BigDecimal.ZERO));
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.orders.entities.Order$CurrentVersionInfo

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.