Examples of ReportTO


Examples of org.apache.syncope.client.to.ReportTO

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
                ReportTO reportTO = (ReportTO) form.getModelObject();
                reportTO.setCronExpression(StringUtils.hasText(reportTO.getCronExpression())
                        ? crontab.getCronExpression()
                        : null);

                try {
                    if (reportTO.getId() > 0) {
                        restClient.update(reportTO);
                    } else {
                        restClient.create(reportTO);
                    }

                    ((BasePage) callerPageRef.getPage()).setModalResult(true);

                    window.close(target);
                } catch (SyncopeClientCompositeErrorException e) {
                    LOG.error("While creating or updating report", e);
                    error(getString("error") + ":" + e.getMessage());
                    target.add(feedbackPanel);
                }
            }

            @Override
            protected void onError(final AjaxRequestTarget target, final Form form) {
                target.add(feedbackPanel);
            }
        };

        if (reportTO.getId() > 0) {
            MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
                    "update"));
        } else {
            MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
                    "create"));
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertNotNull(reportExecTO);
    }

    @Test
    public void create() {
        ReportTO report = new ReportTO();
        report.setName("testReportForCreate");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);

        ReportTO actual = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class,
                report.getId());
        assertNotNull(actual);

        assertEquals(actual, report);
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertEquals(actual, report);
    }

    @Test
    public void update() {
        ReportTO report = new ReportTO();
        report.setName("testReportForUpdate");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);
        assertEquals(2, report.getReportletConfs().size());

        report.addReportletConf(new UserReportletConf("last"));

        ReportTO updated = restTemplate.postForObject(BASE_URL + "report/update", report, ReportTO.class);
        assertNotNull(updated);
        assertEquals(3, updated.getReportletConfs().size());
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertEquals(3, updated.getReportletConfs().size());
    }

    @Test
    public void delete() {
        ReportTO report = new ReportTO();
        report.setName("testReportForDelete");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);

        ReportTO deletedReport =
                restTemplate.getForObject(BASE_URL + "report/delete/{reportId}", ReportTO.class, report.getId());
        assertNotNull(deletedReport);

        try {
            restTemplate.getForObject(BASE_URL + "report/read/{reportId}", UserTO.class, report.getId());
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

    @Test
    public void executeAndExport()
            throws IOException {

        ReportTO reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);
        assertNotNull(reportTO);

        Set<Long> preExecIds = new HashSet<Long>();
        for (ReportExecTO exec : reportTO.getExecutions()) {
            preExecIds.add(exec.getId());
        }

        ReportExecTO execution = restTemplate.postForObject(BASE_URL + "report/execute/{reportId}", null,
                ReportExecTO.class, reportTO.getId());
        assertNotNull(execution);

        int maxit = 50;

        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);

            maxit--;
        } while (preExecIds.size() == reportTO.getExecutions().size() && maxit > 0);

        Set<Long> postExecIds = new HashSet<Long>();
        for (ReportExecTO exec : reportTO.getExecutions()) {
            postExecIds.add(exec.getId());
        }

        postExecIds.removeAll(preExecIds);
        assertEquals(1, postExecIds.size());
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertNotNull(export);
        assertFalse(export.isEmpty());
    }

    public void issueSYNCOPE43() {
        ReportTO reportTO = new ReportTO();
        reportTO.setName("issueSYNCOPE43");
        reportTO = restTemplate.postForObject(BASE_URL + "report/create", reportTO, ReportTO.class);
        assertNotNull(reportTO);

        ReportExecTO execution = restTemplate.postForObject(BASE_URL + "report/execute/{reportId}", null,
                ReportExecTO.class, reportTO.getId());
        assertNotNull(execution);

        int maxit = 50;

        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);

            maxit--;
        } while (reportTO.getExecutions().size() == 0 && maxit > 0);

        assertEquals(1, reportTO.getExecutions().size());
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        }
    }

    @Test
    public void read() {
        ReportTO reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);

        assertNotNull(reportTO);
        assertNotNull(reportTO.getExecutions());
        assertFalse(reportTO.getExecutions().isEmpty());
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertNotNull(reportExecTO);
    }

    @Test
    public void create() {
        ReportTO report = new ReportTO();
        report.setName("testReportForCreate");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);

        ReportTO actual = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class,
                report.getId());
        assertNotNull(actual);

        assertEquals(actual, report);
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertEquals(actual, report);
    }

    @Test
    public void update() {
        ReportTO report = new ReportTO();
        report.setName("testReportForUpdate");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);
        assertEquals(2, report.getReportletConfs().size());

        report.addReportletConf(new UserReportletConf("last"));

        ReportTO updated = restTemplate.postForObject(BASE_URL + "report/update", report, ReportTO.class);
        assertNotNull(updated);
        assertEquals(3, updated.getReportletConfs().size());
    }
View Full Code Here

Examples of org.apache.syncope.client.to.ReportTO

        assertEquals(3, updated.getReportletConfs().size());
    }

    @Test
    public void delete() {
        ReportTO report = new ReportTO();
        report.setName("testReportForDelete");
        report.addReportletConf(new UserReportletConf("first"));
        report.addReportletConf(new UserReportletConf("second"));

        report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
        assertNotNull(report);

        ReportTO deletedReport =
                restTemplate.getForObject(BASE_URL + "report/delete/{reportId}", ReportTO.class, report.getId());
        assertNotNull(deletedReport);

        try {
            restTemplate.getForObject(BASE_URL + "report/read/{reportId}", UserTO.class, report.getId());
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.