Package org.openengsb.domain.userprojects.model

Examples of org.openengsb.domain.userprojects.model.Attribute


    public static void assertEqualUser(User user1, User user2) {
        assertEquals(user1.getUsername(), user2.getUsername());
        assertEquals(user1.getAttributes().size(), user2.getAttributes().size());

        for (int i = 0; i < user1.getAttributes().size(); i++) {
            Attribute attr1 = user1.getAttributes().get(i);
            Attribute attr2 = user2.getAttributes().get(i);

            assertEquals(attr1.getAttributeName(), attr2.getAttributeName());
            assertEquals(attr1.getUuid(), attr2.getUuid());
            assertEquals(attr1.getValues().size(), attr2.getValues().size());

            for (int n = 0; n < attr1.getValues().size(); n++) {
                assertEquals(attr1.getValues().get(n), attr2.getValues().get(n));
            }
        }
    }
View Full Code Here


            public Object call() throws Exception {
                authenticationContext.login("admin", new Password("password"));

                User user = new User(userName);

                Attribute attr = new Attribute();
                attr.setAttributeName(attrName);
                attr.getValues().add(attrValue);
                attr.generateUuid(user.getUsername());
                user.getAttributes().add(attr);

                impl.checkinUser(user);

                // Assert userManager-Content
View Full Code Here

            public Object call() throws Exception {

                authenticationContext.login("admin", new Password("password"));

                User user = new User(userName);
                Attribute attr = new Attribute();
                attr.setAttributeName(attrName);
                attr.getValues().add(attrValue);
                attr.generateUuid(user.getUsername());
                user.getAttributes().add(attr);

                impl.checkinUser(user);

                impl.checkinUser(user);
View Full Code Here

    }

    private List<Attribute> createAttributes(Map<String, String> attributeMap, String uuidGenerationKey) {
        List<Attribute> attributes = Lists.newArrayList();
        for (Entry<String, String> attributeEntry : attributeMap.entrySet()) {
            Attribute attribute = new Attribute();
            attribute.setAttributeName(attributeEntry.getKey());
            attribute.getValues().add(attributeEntry.getValue());
            attribute.generateUuid(uuidGenerationKey);
            attributes.add(attribute);
        }
        return attributes;
    }
View Full Code Here

    }

    private List<Attribute> createAttributes(List<Entry> attributeEntries, String owner) {
        List<Attribute> attributes = Lists.newArrayList();
        for (Entry attributeEntry : attributeEntries) {
            Attribute attribute = new Attribute();
            attribute.setAttributeName(attributeEntry.getDn().getRdn().getValue().getString());
            attribute.getValues().addAll(
                    Arrays.asList(StringUtils.split(getLdapAttributeValue(attributeEntry),
                            ServerConfig.multipleValueSeparator)));
            attribute.generateUuid(owner);
            attributes.add(attribute);
        }
        return attributes;
    }
View Full Code Here

        ldapService.updateUsers(Lists.newArrayList(user));

        Credential credential = user.getCredentials().iterator().next();
        credential.setValue(credential.getValue() + "new");

        Attribute attribute1 = user.getAttributes().iterator().next();
        attribute1.getValues().add("new");

        Attribute attribute2 = createTestAttribute("attribute2", "value");
        user.getAttributes().add(attribute2);

        ldapService.updateUsers(Lists.newArrayList(user));

        assertCredentialsCorrectlyStored(user);
View Full Code Here

        return user;
    }

    protected Attribute createTestAttribute(String name, String... values) {
        Attribute attribute = new Attribute();
        attribute.setAttributeName(name);
        List<Object> valueObjects = Lists.newArrayList();
        valueObjects.addAll(Lists.newArrayList(values));
        attribute.setValues(valueObjects);
        return attribute;
    }
View Full Code Here

TOP

Related Classes of org.openengsb.domain.userprojects.model.Attribute

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.