Package com.impetus.client.twitter.entities

Examples of com.impetus.client.twitter.entities.UserCassandra


        twitter.createEntityManager();
        List<UserCassandra> users = twitter.findUserByDigitalSignature((byte) 8);
        Assert.assertNotNull(users);
        Assert.assertFalse(users.isEmpty());
        Assert.assertTrue(users.size() == 1);
        UserCassandra user = users.get(0);
        Assert.assertNotNull(user);
        Assert.assertEquals(userId1, user.getUserId());
        ProfessionalDetailCassandra pd = user.getProfessionalDetail();
        Assert.assertNotNull(pd);
        Assert.assertEquals((byte) 8, pd.getDigitalSignature());
        twitter.closeEntityManager();

        twitter.createEntityManager();
        List<UserCassandra> users2 = twitter.findUserByDigitalSignature((byte) 10);
        Assert.assertNotNull(users2);
        Assert.assertFalse(users2.isEmpty());
        Assert.assertTrue(users2.size() == 1);
        UserCassandra user2 = users2.get(0);
        Assert.assertNotNull(user2);
        Assert.assertEquals(userId2, user2.getUserId());
        ProfessionalDetailCassandra pd2 = user2.getProfessionalDetail();
        Assert.assertNotNull(pd2);
        Assert.assertEquals((byte) 10, pd2.getDigitalSignature());
        twitter.closeEntityManager();
    }
View Full Code Here


    }

    @Override
    public void addUser(String userId, String name, String password, String relationshipStatus, int age)
    {
        UserCassandra user = new UserCassandra(userId, name, password, relationshipStatus, age);
        em.persist(user);

    }
View Full Code Here

    @Override
    public void savePreference(String userId, PreferenceCassandra preference)
    {

        UserCassandra user = em.find(UserCassandra.class, userId);
        user.setPreference(preference);
        em.persist(user);
    }
View Full Code Here

    }

    @Override
    public void addExternalLink(String userId, String linkId, String linkType, String linkAddress)
    {
        UserCassandra user = em.find(UserCassandra.class, userId);
        user.addExternalLink(new ExternalLinkCassandra(linkId, linkType, linkAddress));

        em.persist(user);
    }
View Full Code Here

    }

    @Override
    public void addTweet(String userId, String tweetBody, String device)
    {
        UserCassandra user = em.find(UserCassandra.class, userId);
        user.addTweet(new TweetCassandra(tweetBody, device));
        em.persist(user);
    }
View Full Code Here

    }

    @Override
    public void startFollowing(String userId, String friendUserId)
    {
        UserCassandra user = em.find(UserCassandra.class, userId);
        UserCassandra friend = em.find(UserCassandra.class, friendUserId);

        user.addFriend(friend);
        em.persist(user);

        friend.addFollower(user);
        em.persist(friend);
    }
View Full Code Here

    }

    @Override
    public void addFollower(String userId, String followerUserId)
    {
        UserCassandra user = em.find(UserCassandra.class, userId);
        UserCassandra follower = em.find(UserCassandra.class, followerUserId);

        user.addFollower(follower);
        em.persist(user);
    }
View Full Code Here

    @Override
    public UserCassandra findUserById(String userId)
    {
        em.clear();
        UserCassandra user = em.find(UserCassandra.class, userId);
        return user;
    }
View Full Code Here

        removeUsers();
    }

    protected void addAllUserInfo()
    {
        UserCassandra user1 = buildUser1();
        UserCassandra user2 = buildUser2();

        twitter.createEntityManager();
        twitter.addUser(user1);
        twitter.closeEntityManager();
View Full Code Here

    }

    protected void getUserById()
    {
        twitter.createEntityManager();
        UserCassandra user1 = twitter.findUserById(userId1);
        assertUser1(user1);

        UserCassandra user2 = twitter.findUserById(userId2);
        assertUser2(user2);
    }
View Full Code Here

TOP

Related Classes of com.impetus.client.twitter.entities.UserCassandra

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.