throws Exception { Activity activity = new Activity(); activity.setVerb( verb ); activity.setCategory( category ); activity.setContent( content ); activity.setTitle( title ); actor.setUuid( user.getUuid() ); activity.setActor( actor ); obj.setContent( content ); activity.setObject( obj );
public void add( Activity activity ) { this.properties.putAll( activity.getProperties() ); }
@Test public void testKeyValue() throws Exception { User user = new User(); user.setUsername( "edanuff" ); user.setEmail( "ed@anuff.com" ); Activity activity = Activity.newActivity( Activity.VERB_POST, null, "I ate another sammich", null, user, null, "tweet", null, null ); List<Entry<String, Object>> l = IndexUtils.getKeyValueList( activity, false ); for ( Entry<String, Object> e : l ) { logger.info( e.getKey() + " = " + e.getValue() ); } assertEquals( 7, l.size() ); } }
app.add( Activity.newActivity( Activity.VERB_POST, null, "I ate a sammich", null, userA, null, "tweet", null, null ) ); app.add( Activity.newActivity( Activity.VERB_POST, null, "I ate another sammich", null, userA, null, "tweet", null, null ) ); assertNotNull( activity ); app.add( Activity.newActivity( Activity.VERB_POST, null, "I ate a cookie", null, userA, null, "tweet", null, null ) ); assertNotNull( activity ); app.add( Activity.newActivity( Activity.VERB_CHECKIN, null, "I'm at the cookie shop", null, userA, null, Activity.OBJECT_TYPE_PLACE, "Cookie Shop", null ) );