Package org.libreplan.business.scenarios.entities

Examples of org.libreplan.business.scenarios.entities.Scenario


    }

    @Test
    @Transactional
    public void testRemoveScenarioWithoutOrders() {
        Scenario scenario = givenStoredScenario();

        int previous = scenarioModel.getScenarios().size();

        scenarioModel.remove(scenario, false);
        assertThat(scenarioModel.getScenarios().size(), equalTo(previous - 1));
View Full Code Here


    }

    @Test(expected = IllegalArgumentException.class)
    @Transactional
    public void testRemoveScenarioWithDerivedScenraios() {
        Scenario scenario = givenStoredScenario();
        givenStoredScenario(scenario);
        scenarioModel.remove(scenario);
    }
View Full Code Here

    @Test
    @Transactional
    @Ignore("FIXME: test was causing problems in Debian Wheezy")
    public void testRemoveScenarioWithOrders() throws InstanceNotFoundException {
        Order order = givenStoredOrderInDefaultScenario();
        Scenario scenario = givenStoredScenario();

        int previous = scenarioModel.getScenarios().size();

        OrderVersion orderVersion = scenario.getOrderVersion(order);

        scenarioModel.remove(scenario, false);
        assertThat(scenarioModel.getScenarios().size(), equalTo(previous - 1));

        assertNotNull(orderDAO.find(order.getId()));
View Full Code Here

    @Test
    @Transactional
    public void testRemoveScenarioWithOrdersJustInThisScenario()
            throws InstanceNotFoundException {
        Scenario scenario = givenStoredScenario();
        Order order = givenStoredOrderInScenario(scenario);

        int previous = scenarioModel.getScenarios().size();

        // Reload scenario information
        sessionFactory.getCurrentSession().evict(scenario);
        scenario = scenarioDAO.find(scenario.getId());

        OrderVersion orderVersion = scenario.getOrderVersion(order);

        scenarioModel.remove(scenario, false);
        assertThat(scenarioModel.getScenarios().size(), equalTo(previous - 1));

        try {
View Full Code Here

        WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE })
public class OrderModelTest {

    public static OrderVersion setupVersionUsing(
            IScenarioManager scenarioManager, Order order) {
        Scenario current = scenarioManager.getCurrent();
        OrderVersion result = OrderVersion.createInitialVersion(current);
        order.setVersionForScenario(current, result);
        return result;
    }
View Full Code Here

    }

    private void givenOrder() {
        order = Order.create();
        order.setName("order");
        Scenario scenario = PredefinedScenarios.MASTER.getScenario();
        OrderVersion result = OrderVersion.createInitialVersion(scenario);
        order.setVersionForScenario(scenario, result);
        order.useSchedulingDataFor(scenario);
    }
View Full Code Here

        for (Order each : orders) {
            reattachmentOrder(each);
        }

        Scenario currentScenario = scenarioManager.getCurrent();
        for (Order each : orders) {
            each.useSchedulingDataFor(currentScenario);
        }

        List<TimeLineRequiredMaterialDTO> result = filterConsult(startingDate,
View Full Code Here

    }

    public void accept() {
        BandboxSearch scenarioBandboxSearch = (BandboxSearch) window
                .getFellow("scenarioBandboxSearch");
        Scenario scenario = (Scenario) scenarioBandboxSearch
                .getSelectedElement();

        templateModel.setScenario(SecurityUtils.getSessionUserLoginName(),
                scenario, new IOnFinished() {
                    @Override
View Full Code Here

    }

    private List<TaskElement> criticalPathFor(PlanningState state,
            IResourcesSearcher resourcesSearcher) {
        final Order order = state.getOrder();
        final Scenario currentScenario = state.getCurrentScenario();

        IAdapter<TaskElement, DependencyWithVisibility> adapter = TemplateModelAdapter
                .create(currentScenario, asLocalDate(order.getInitDate()),
                        asLocalDate(order.getDeadline()), resourcesSearcher);
        GanttDiagramGraph<TaskElement, DependencyWithVisibility> graph = GanttDiagramBuilder
View Full Code Here

    }

    @Override
    @Transactional(readOnly = true)
    public List<Order> getOrders() {
        Scenario currentScenario = scenarioManager.getCurrent();
        final List<Order> orders = orderDAO
                .getOrdersByReadAuthorizationByScenario(
                        SecurityUtils.getSessionUserLoginName(),
                        currentScenario);
        for (Order each: orders) {
View Full Code Here

TOP

Related Classes of org.libreplan.business.scenarios.entities.Scenario

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.