Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.Plan


        List<Plan> plans = parser.importProjects(in);

        Assert.assertTrue(plans.size() == 1);

        Plan plan = plans.get(0);
        PlanProperties pp = plan.getPlanProperties();

        Assert.assertTrue("PlanParser Test - minimal".equals(pp.getName()));
        Assert.assertTrue("Test".equals(pp.getDescription()));
        Assert.assertTrue("Test1 Test1".equals(pp.getAuthor()));
        Assert.assertTrue("TUW".equals(pp.getOrganization()));
View Full Code Here


        List<Plan> plans = parser.importProjects(in);

        Assert.assertTrue(plans.size() == 1);

        Plan plan = plans.get(0);
        ExecutablePlanDefinition ex = plan.getExecutablePlanDefinition();

        Assert.assertNull(ex.getObjectPath());
        Assert.assertTrue("".equals(ex.getToolParameters()));
        Assert.assertTrue("".equals(ex.getTriggersConditions()));
        Assert.assertTrue("".equals(ex.getValidateQA()));
View Full Code Here

        List<Plan> plans = parser.importProjects(in);

        Assert.assertTrue(plans.size() == 1);

        Plan plan = plans.get(0);
        DigitalObject pap = plan.getPreservationActionPlan();

        Assert.assertNull(pap.getPid());
        Assert.assertTrue("PreservationActionPlan.xml".equals(pap.getFullname()));
        Assert.assertTrue("application/xml".equals(pap.getContentType()));
View Full Code Here

     */
    public boolean exportComplete(int ppid, OutputStream out, String baseTempPath) {
        ProjectExporter exporter = new ProjectExporter();
        Document doc = exporter.createProjectDoc();

        Plan plan = null;
        try {
            plan = em.createQuery("select p from Plan p where p.planProperties.id = :ppid ", Plan.class)
                .setParameter("ppid", ppid)
                .getSingleResult();
        } catch (Exception e) {
View Full Code Here

        List<VPlanLeaf> planLeaves = planSelection.getSelectionPlanLeaves();

        selectedPlans.clear();
        // We also need the scores of the alternatives - for each selected plan
        for (int pId : planSelection.getSelectedPlans()) {
            Plan plan = planManager.loadPlan(pId);
            ResultNode result = new ResultNode(plan.getTree().getRoot(), new WeightedSum(), plan
                .getAlternativesDefinition().getConsideredAlternatives());
            selectedPlans.add(new PlanInfo(pId, result, plan.getPlanProperties()));
        }
        // Init calculation classes
        this.calculator = new KBrowserCalculator(planLeaves, nrRelevantPlans);

        HashMap<String, Measure> usedMeasures = getUsedMeasures(planLeaves);
View Full Code Here

        assertThat(getNode(doc, "/templates"), notNullValue());
    }

    @Test
    public void exportToXml_planProperties() throws PlanningException {
        Plan p = generateBasicPlan();
        p.setPlanProperties(generatePlanProperties());

        Document doc = exporter.exportToXml(p);

        Element ppElement = (Element) getNode(doc, "/plans/p:plan/p:properties");

        assertThat(ppElement.attributeValue("author"), is("Author"));
        assertThat(ppElement.attributeValue("organization"), is("Organization"));
        assertThat(ppElement.attributeValue("name"), is("Name"));
        assertThat(ppElement.attributeValue("privateProject"), is("true"));
        assertThat(ppElement.attributeValue("reportPublic"), is("true"));
        assertThat(ppElement.attributeValue("repositoryIdentifier"), is("Repository ID"));

        Element reportElement = getElement(doc, "/plans/p:plan/p:properties/p:report");
        checkDigitalObject(reportElement, p.getPlanProperties().getReportUpload());

        assertThat(getElement(doc, "/plans/p:plan/p:properties/p:state").attributeValue("value"), is("0"));
        checkContentByName(ppElement, "p:description");
        checkContentByName(ppElement, "p:owner");
    }
View Full Code Here

        checkContentByName(ppElement, "p:owner");
    }

    @Test
    public void exportToXml_basis() throws PlanningException {
        Plan p = generateBasicPlan();
        p.setProjectBasis(generateBasis());

        Document doc = exporter.exportToXml(p);

        Element basisElement = (Element) getNode(doc, "/plans/p:plan/p:basis");
        assertThat(basisElement.attributeValue("identificationCode"), is("Identification code"));
View Full Code Here

        assertThat(ccpTriggerElement.attributeValue("active"), is("false"));
    }

    @Test
    public void exportToXml_alternative() throws PlanningException {
        Plan p = generateBasicPlan();

        AlternativesDefinition alternativesDefinition = new AlternativesDefinition();
        alternativesDefinition.setDescription("Description");
        Alternative alt1 = generateAlternative("Alternative 1");
        alternativesDefinition.addAlternative(alt1);
        Alternative alt2 = generateAlternative("Alternative 2");
        alternativesDefinition.addAlternative(alt2);
        p.setAlternativesDefinition(alternativesDefinition);

        Document doc = exporter.exportToXml(p);

        assertThat(getNodes(doc, "/plans/p:plan/p:alternatives/p:alternative").size(), is(2));
View Full Code Here

     * Generates a basic plan.
     *
     * @return the plan
     */
    private Plan generateBasicPlan() {
        Plan p = new Plan();

        PlanProperties planProperties = new PlanProperties();
        p.setPlanProperties(planProperties);

        return p;
    }
View Full Code Here

        Long planCount = q.getSingleResult();
        if (planCount != 1) {
            throw new PlanningException("This plan has not been loaded before, reload is not possible.");
        }

        Plan reloadedPlan = em.find(Plan.class, plan.getId());
        this.initializePlan(reloadedPlan);
        log.info("Plan " + reloadedPlan.getPlanProperties().getName() + " reloaded!");
        return reloadedPlan;

    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.Plan

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.