Package org.apache.syncope.core.persistence.beans.user

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


        assertEquals(membership.getAttribute(schema.getName()).getValues().size(), 1);
    }

    public void derAttrFromSpecialAttrs() {
        UDerSchema sderived = new UDerSchema();
        sderived.setName("sderived");
        sderived.setExpression("username - creationDate[failedLogins]");

        derSchemaDAO.save(sderived);
        derSchemaDAO.flush();

        UDerSchema actual = derSchemaDAO.find("sderived", UDerSchema.class);
        assertNotNull("expected save to work", actual);
        assertEquals(sderived, actual);

        SyncopeUser owner = userDAO.find(3L);
        assertNotNull("did not get expected user", owner);
View Full Code Here


    @Autowired
    private DerAttrDAO derAttrDAO;

    @Test
    public void test() {
        UDerSchema schema = derSchemaDAO.find("cn", UDerSchema.class);

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

        derSchemaDAO.flush();

        assertNull(derSchemaDAO.find(schema.getName(), UDerSchema.class));
        assertNull(derAttrDAO.find(100L, UDerAttr.class));
        assertNull(userDAO.find(3L).getDerivedAttribute(schema.getName()));
    }
View Full Code Here

        assertNotNull("did not find expected attribute schema", attribute);
    }

    @Test
    public void saveUDerAttribute() throws ClassNotFoundException {
        UDerSchema cnSchema = derSchemaDAO.find("cn", UDerSchema.class);
        assertNotNull(cnSchema);

        SyncopeUser owner = userDAO.find(3L);
        assertNotNull("did not get expected user", owner);
View Full Code Here

        derAttrDAO.delete(attribute.getId(), UDerAttr.class);

        UDerAttr actual = derAttrDAO.find(100L, UDerAttr.class);
        assertNull("delete did not work", actual);

        UDerSchema attributeSchema = derSchemaDAO.find(attributeSchemaName, UDerSchema.class);
        assertNotNull("user derived attribute schema deleted " + "when deleting values", attributeSchema);
    }
View Full Code Here

     */
    @Override
    public List<SyncopeUser> findByDerAttrValue(final String schemaName, final String value)
            throws InvalidSearchConditionException {

        UDerSchema schema = derSchemaDAO.find(schemaName, UDerSchema.class);
        if (schema == null) {
            LOG.error("Invalid schema name '{}'", schemaName);
            return Collections.EMPTY_LIST;
        }

        // query string
        final StringBuilder querystring = new StringBuilder();

        boolean subquery = false;
        for (String clause : getWhereClause(schema.getExpression(), value)) {
            if (querystring.length() > 0) {
                subquery = true;
                querystring.append(" AND a.owner_id IN ( ");
            }

View Full Code Here

        assertEquals(3, list.size());
    }

    @Test
    public void findByName() {
        UDerSchema attributeSchema = derSchemaDAO.find("cn", UDerSchema.class);
        assertNotNull("did not find expected derived attribute schema", attributeSchema);
    }
View Full Code Here

        assertNotNull("did not find expected derived attribute schema", attributeSchema);
    }

    @Test
    public void save() {
        UDerSchema derivedAttributeSchema = new UDerSchema();
        derivedAttributeSchema.setName("cn2");
        derivedAttributeSchema.setExpression("firstname surname");

        derSchemaDAO.save(derivedAttributeSchema);

        UDerSchema actual = derSchemaDAO.find("cn2", UDerSchema.class);
        assertNotNull("expected save to work", actual);
        assertEquals(derivedAttributeSchema, actual);
    }
View Full Code Here

        assertEquals(derivedAttributeSchema, actual);
    }

    @Test
    public void delete() {
        UDerSchema attributeSchema = derSchemaDAO.find("cn", UDerSchema.class);

        derSchemaDAO.delete(attributeSchema.getName(), AttributableUtil.getInstance(AttributableType.USER));

        UDerSchema actual = derSchemaDAO.find("cn", UDerSchema.class);
        assertNull("delete did not work", actual);
    }
View Full Code Here

        assertEquals(membership.getAttr(schema.getName()).getValues().size(), 1);
    }

    @Test
    public void derAttrFromSpecialAttrs() {
        UDerSchema sderived = new UDerSchema();
        sderived.setName("sderived");
        sderived.setExpression("username + ' - ' + creationDate + '[' + failedLogins + ']'");

        sderived = derSchemaDAO.save(sderived);
        derSchemaDAO.flush();

        UDerSchema actual = derSchemaDAO.find("sderived", UDerSchema.class);
        assertNotNull("expected save to work", actual);
        assertEquals(sderived, actual);

        SyncopeUser owner = userDAO.find(3L);
        assertNotNull("did not get expected user", owner);
View Full Code Here

    @Autowired
    private DerAttrDAO derAttrDAO;

    @Test
    public void test() {
        UDerSchema schema = derSchemaDAO.find("cn", UDerSchema.class);

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

        derSchemaDAO.flush();

        assertNull(derSchemaDAO.find(schema.getName(), UDerSchema.class));
        assertNull(derAttrDAO.find(100L, UDerAttr.class));
        assertNull(userDAO.find(3L).getDerAttr(schema.getName()));
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.beans.user.UDerSchema

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.