Examples of USchema


Examples of org.apache.syncope.core.persistence.beans.user.USchema

        assertEquals(attributeSchema, actual);
    }

    @Test(expected = InvalidEntityException.class)
    public void saveNonValid() {
        USchema attributeSchema = new USchema();
        attributeSchema.setName("secondaryEmail");
        attributeSchema.setType(AttributeSchemaType.String);
        attributeSchema.setValidatorClass("org.apache.syncope.core.validation.EmailAddressValidator");
        attributeSchema.setMandatoryCondition("false");
        attributeSchema.setMultivalue(true);
        attributeSchema.setUniqueConstraint(true);

        schemaDAO.save(attributeSchema);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        assertFalse(actual.getEnumerationKeys().isEmpty());
    }

    @Test(expected = InvalidEntityException.class)
    public void saveInvalidSchema() {
        USchema schema = new USchema();
        schema.setName("username");
        schemaDAO.save(schema);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        schemaDAO.save(schema);
    }

    @Test
    public void delete() {
        USchema schema = schemaDAO.find("fullname", USchema.class);

        schemaDAO.delete(schema.getName(), AttributableUtil.getInstance(AttributableType.USER));

        USchema actual = schemaDAO.find("fullname", USchema.class);
        assertNull("delete did not work", actual);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        assertNull("delete did not work", actual);
    }

    @Test
    public void issueSYNCOPE418() {
        USchema schema = new USchema();
        schema.setName("http://schemas.examples.org/security/authorization/organizationUnit");

        try {
            schemaDAO.save(schema);
            fail();
        } catch (InvalidEntityException e) {
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

    @Test
    public void save() throws ClassNotFoundException {
        SyncopeUser user = userDAO.find(1L);

        USchema emailSchema = userSchemaDAO.find("email", USchema.class);
        assertNotNull(emailSchema);

        UAttr attribute = new UAttr();
        attribute.setSchema(emailSchema);
        attribute.setOwner(user);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

    @Test
    public void checkForEnumType() throws ClassNotFoundException {
        SyncopeUser user = userDAO.find(1L);

        USchema gender = userSchemaDAO.find("gender", USchema.class);
        assertNotNull(gender);
        assertNotNull(gender.getType());
        assertNotNull(gender.getEnumerationValues());

        UAttr attribute = new UAttr();
        attribute.setSchema(gender);
        attribute.setOwner(user);
        user.addAttribute(attribute);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        assertEquals(actual.getValues().size(), 1);
    }

    @Test
    public void validateAndSave() {
        final USchema emailSchema = userSchemaDAO.find("email", USchema.class);
        assertNotNull(emailSchema);

        final USchema fullnameSchema = userSchemaDAO.find("fullname", USchema.class);
        assertNotNull(fullnameSchema);

        UAttr attribute = new UAttr();
        attribute.setSchema(emailSchema);
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        UAttr attribute = attrDAO.find(104L, UAttr.class);
        String attrSchemaName = attribute.getSchema().getName();

        attrDAO.delete(attribute.getId(), UAttr.class);

        USchema schema = userSchemaDAO.find(attrSchemaName, USchema.class);
        assertNotNull("user attribute schema deleted when deleting values", schema);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        assertEquals(5, roleList.size());
    }

    @Test
    public void findByName() {
        USchema attributeSchema = schemaDAO.find("fullname", USchema.class);
        assertNotNull("did not find expected attribute schema", attributeSchema);
    }
View Full Code Here

Examples of org.apache.syncope.core.persistence.beans.user.USchema

        }
    }

    @Test
    public void save() {
        USchema attributeSchema = new USchema();
        attributeSchema.setName("secondaryEmail");
        attributeSchema.setType(SchemaType.String);
        attributeSchema.setValidatorClass("org.apache.syncope.core.validation.EmailAddressValidator");
        attributeSchema.setMandatoryCondition("false");
        attributeSchema.setMultivalue(true);

        schemaDAO.save(attributeSchema);

        USchema actual = schemaDAO.find("secondaryEmail", USchema.class);
        assertNotNull("expected save to work", actual);
        assertEquals(attributeSchema, actual);
    }
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.