Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.Person


    public final void testPersistWithChangingDisplayName() throws Exception
    {
        final String originalDisplayedName = "Preferred";
        final Long personId = 89348L;

        final Person testPerson = new Person("accountid", "First", "Middle", "Last", "New-Preferred");
        EntityTestHelper.setPersonId(testPerson, personId);

        final List<Person> attribMembers = new ArrayList<Person>();
        attribMembers.add(new Person("id", "Homer", "Jay", "Simpson", "Homey"));
        attribMembers.add(new Person("id", "Max", "X", "Power", "Homer"));

        final List<Person> groupMembers = new ArrayList<Person>();
        groupMembers.add(new Person("id", "Homer", "Jay", "Simpson", "Homey"));
        groupMembers.add(new Person("id", "Max", "X", "Power", "Homer"));

        final long id = 1L;
        String newName = "NEW org name here";

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
View Full Code Here


     */
    @Test
    public void testInsert()
    {
        final long personId = 142L;
        Person person = jpaPersonMapper.findById(personId);
        Background background = new Background(person);
        jpaBackgroundMapper.insert(background);
        long backgroundId = background.getId();
        jpaBackgroundMapper.getEntityManager().clear();

View Full Code Here

    @Test
    public void persistSuccessButPending() throws Exception
    {
        final List<Long> adminIds = new ArrayList<Long>();
        final List<Person> coordinators = new ArrayList<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        coordinators.add(new Person("id3", "Max", "X", "Power", "Homer"));

        personMock = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        final long id = 1L;
View Full Code Here

    @Test
    public void testfindPersonBackgroundItems()
    {
        final long personId = 142L;
        final String openSocialId = "2d359911-0977-418a-9490-57e8252b1142";
        Person person = jpaPersonMapper.findById(personId);
        Background background = new Background(person);

        jpaBackgroundMapper.insert(background);

        List<BackgroundItem> expectedBackgroundItems = new ArrayList<BackgroundItem>();
View Full Code Here

    public void persistSuccessRequiresPermissionButSystemAdmin() throws Exception
    {
        final List<Long> adminIds = new ArrayList<Long>();
        adminIds.add(personId);
        final List<Person> coordinators = new ArrayList<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        coordinators.add(new Person("id3", "Max", "X", "Power", "Homer"));

        personMock = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        final long id = 1L;
View Full Code Here

    public void voidTestFlushAndIndex()
    {

        final long personId = 142L;
        final String openSocialId = "2d359911-0977-418a-9490-57e8252b1142";
        Person person = jpaPersonMapper.findById(personId);
        Background background = new Background(person);

        jpaBackgroundMapper.insert(background);

        List<BackgroundItem> expectedBackgroundItems = new ArrayList<BackgroundItem>();
View Full Code Here

     */
    @Test
    public void persistSuccessNotPending() throws Exception
    {
        final List<Person> coordinators = new ArrayList<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        coordinators.add(new Person("id3", "Max", "X", "Power", "Homer"));

        personMock = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        final long id = 1L;
View Full Code Here

    {
        final String name = "org name here";
        final long id = 1L;
        String newName = "NEW org name here";
        final DomainGroup newGroup = new DomainGroup();
        final Person coordinatorMock = context.mock(Person.class);

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
        formData.put("id", Long.toString(id));
        formData.put("name", newName);
        formData.put("membershipcriteria", "somegroup");
        Set<Person> requestedCoordinators = new HashSet<Person>();
        final Person requestedCoordinator = new Person("aperson", "A", "Simple", "Person", "A");
        requestedCoordinators.add(requestedCoordinator);
        formData.put("coordinators", (Serializable) requestedCoordinators);

        context.checking(new Expectations()
        {
            {
                oneOf(personMapperMock).findByAccountId(with(requestedCoordinator.getAccountId()));
                will(returnValue(coordinatorMock));

                oneOf(persistStrategyMock).get(with(any(TaskHandlerActionContext.class)), with(any(HashMap.class)));
                will(returnValue(newGroup));
View Full Code Here

     */
    @Test(expected = ValidationException.class)
    public void persistFailedDupGroup() throws Exception
    {
        final Set<Person> coordinators = new HashSet<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        final DomainGroup dupGroup = context.mock(DomainGroup.class, "dupGroup");
        final long id = 1L;
        String newName = "NEW org name here";

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
View Full Code Here

    {
        final String name = "org name here";
        final long id = 1L;
        String newName = "NEW org name here";
        final DomainGroup newGroup = new DomainGroup();
        final Person coordinatorMock = context.mock(Person.class);

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
        formData.put("id", Long.toString(id));
        formData.put("name", newName);
        formData.put("memberbershipcriteria", "someattrib=something");
        Set<Person> requestedCoordinators = new HashSet<Person>();
        final Person requestedCoordinator = new Person("aperson", "A", "Simple", "Person", "A");
        requestedCoordinators.add(requestedCoordinator);
        formData.put("coordinators", (Serializable) requestedCoordinators);

        context.checking(new Expectations()
        {
            {
                oneOf(personMapperMock).findByAccountId(with(requestedCoordinator.getAccountId()));
                will(returnValue(null));

                oneOf(factoryMock).getCreatePersonAction(personMapperMock, updaterMock);
                will(returnValue(personCreatorMock));
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.Person

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.