Package com.impetus.client.twitter.entities

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


    @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


        twitter.createEntityManager();
        UserCassandra user1 = twitter.findUserById(userId1);
        assertUser1(user1);

        user1.setPersonalDetail(new PersonalDetailCassandra("Vivek", "unknown", "Married", 24));
        user1.addTweet(new TweetCassandra("My Third Tweet", "iPhone"));
        twitter.mergeUser(user1);

        UserCassandra user1AfterMerge = twitter.findUserById(userId1);

        assertUpdatedUser1(user1AfterMerge);
View Full Code Here

        Assert.assertFalse(user == null);
        Assert.assertEquals("0001", user.getUserId());
        List<TweetCassandra> tweets = user.getTweets();
        Assert.assertFalse(tweets == null);
        Assert.assertTrue(tweets.size() == 1);
        TweetCassandra tweet = tweets.get(0);
        Assert.assertNotNull(tweet);
        Assert.assertEquals("Web", tweet.getDevice());

        // Negative scenario, record doesn't exist for user who is single and
        // tweeted from mobile
        twitter.createEntityManager();
        List<UserCassandra> users2 = twitter.findByRelationshipAndDevice("single", "Mobile");
View Full Code Here

        user1.setPreference(new PreferenceCassandra("P1", "Motif", "2"));

        user1.addExternalLink(new ExternalLinkCassandra("L1", "Facebook", "http://facebook.com/coolnerd"));
        user1.addExternalLink(new ExternalLinkCassandra("L2", "LinkedIn", "http://linkedin.com/in/devilmate"));

        user1.addTweet(new TweetCassandra("Here is my first tweet", "Web"));
        user1.addTweet(new TweetCassandra("Second Tweet from me", "Mobile"));
        return user1;
    }
View Full Code Here

        user2.setPreference(new PreferenceCassandra("P2", "High Contrast", "3"));

        user2.addExternalLink(new ExternalLinkCassandra("L3", "GooglePlus", "http://plus.google.com/inviteme"));
        user2.addExternalLink(new ExternalLinkCassandra("L4", "Yahoo", "http://yahoo.com/profiles/itsmeamry"));

        user2.addTweet(new TweetCassandra("Saurabh tweets for the first time", "Phone"));
        user2.addTweet(new TweetCassandra("Another tweet from Saurabh", "text"));
        return user2;
    }
View Full Code Here

TOP

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

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.