Package org.apache.syncope.common.to

Examples of org.apache.syncope.common.to.SyncPolicyTO


    @Test
    public void issueSYNCOPE258() {
        // -----------------------------
        // Add a custom correlation rule
        // -----------------------------
        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 9L);
        policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());

        policyService.update(PolicyType.SYNC, policyTO.getId(), policyTO);
        // -----------------------------

        SyncTaskTO task = new SyncTaskTO();
        task.setName("Test Sync Rule");
        task.setResource(RESOURCE_NAME_WS2);
View Full Code Here


            case PASSWORD:
                policyTO = new PasswordPolicyTO();
                break;

            case GLOBAL_SYNC:
                policyTO = new SyncPolicyTO(true);
                break;

            case SYNC:
            default:
                policyTO = new SyncPolicyTO();
        }

        return policyTO;
    }
View Full Code Here

        assertFalse(policyTOs.isEmpty());
    }

    @Test
    public void read() {
        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 1L);

        assertNotNull(policyTO);
    }
View Full Code Here

        }
    }

    @Test
    public void createMissingDescription() {
        SyncPolicyTO policy = new SyncPolicyTO();
        policy.setSpecification(new SyncPolicySpec());

        try {
            createPolicy(PolicyType.SYNC, policy);
            fail();
        } catch (SyncopeClientCompositeErrorException sccee) {
View Full Code Here

        }
    }

    @Test
    public void create() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);

        assertNotNull(policyTO);
        assertEquals(PolicyType.SYNC, policyTO.getType());
        assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
    }
View Full Code Here

        assertEquals(8, policy.getSpecification().getMinLength());
    }

    @Test
    public void delete() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);
        assertNotNull(policyTO);

        policyService.delete(PolicyType.SYNC, policyTO.getId());

        Throwable t = null;
        try {
            policyService.read(PolicyType.SYNC, policyTO.getId());
        } catch (SyncopeClientCompositeErrorException e) {
            t = e;
        }

        assertNotNull(t);
View Full Code Here

    public void getCorrelationRules() {
        assertEquals(1, policyService.getSyncCorrelationRuleClasses(PolicyType.SYNC).size());
    }

    private SyncPolicyTO buildSyncPolicyTO() {
        SyncPolicyTO policy = new SyncPolicyTO();

        SyncPolicySpec spec = new SyncPolicySpec();
        spec.setUserJavaRule(TestSyncRule.class.getName());

        policy.setSpecification(spec);
        policy.setDescription("Sync policy");

        return policy;
    }
View Full Code Here

    @Test
    public void issueSYNCOPE258() {
        // -----------------------------
        // Add a custom correlation rule
        // -----------------------------
        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 9L);
        policyTO.getSpecification().setUserJavaRule(TestSyncRule.class.getName());

        policyService.update(PolicyType.SYNC, policyTO.getId(), policyTO);
        // -----------------------------

        SyncTaskTO task = new SyncTaskTO();
        task.setName("Test Sync Rule");
        task.setResource("ws-target-resource-2");
View Full Code Here

                if (!(policy.getSpecification() instanceof SyncPolicySpec)) {
                    throw new ClassCastException("Expected " + SyncPolicySpec.class.getName()
                            + ", found " + policy.getSpecification().getClass().getName());

                }
                policyTO = new SyncPolicyTO(isGlobal);
                ((SyncPolicyTO) policyTO).setSpecification((SyncPolicySpec) policy.getSpecification());
        }

        policyTO.setId(policy.getId());
        policyTO.setDescription(policy.getDescription());
View Full Code Here

            case PASSWORD:
                policyTO = new PasswordPolicyTO();
                break;

            case GLOBAL_SYNC:
                policyTO = new SyncPolicyTO(true);
                break;

            case SYNC:
            default:
                policyTO = new SyncPolicyTO();
        }

        return policyTO;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.to.SyncPolicyTO

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.