You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by aw...@apache.org on 2009/06/11 02:35:26 UTC

svn commit: r783591 - in /incubator/shindig/trunk: java/common/src/main/java/org/apache/shindig/protocol/ java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ java/social-api/src/test/java/org/apache/shindig/social/sample/spi/ ja...

Author: awiner
Date: Thu Jun 11 00:35:26 2009
New Revision: 783591

URL: http://svn.apache.org/viewvc?rev=783591&view=rev
Log:
Rollback of revision 782127: SHINDIG-1067: Return default appId when it is not specified in the request
- The patch defaulted RequestItem.getAppId() to the security token's app ID if absent
- However, a null app ID has an explicit meaning for activities.get, namely "return activities across all apps"
It might be valid to default app ID for the AppDataHandler, but the patch as is needs rethinking.

Modified:
    incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java
    incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ActivityHandlerTest.java
    incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java
    incubator/shindig/trunk/javascript/sampledata/canonicaldb.json

Modified: incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java?rev=783591&r1=783590&r2=783591&view=diff
==============================================================================
--- incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java (original)
+++ incubator/shindig/trunk/java/common/src/main/java/org/apache/shindig/protocol/BaseRequestItem.java Thu Jun 11 00:35:26 2009
@@ -101,7 +101,7 @@
 
   public String getAppId() {
     String appId = getParameter(APP_ID);
-    if (appId == null || appId.equals(APP_SUBSTITUTION_TOKEN)) {
+    if (appId != null && appId.equals(APP_SUBSTITUTION_TOKEN)) {
       return token.getAppId();
     } else {
       return appId;

Modified: incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ActivityHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ActivityHandlerTest.java?rev=783591&r1=783590&r2=783591&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ActivityHandlerTest.java (original)
+++ incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/opensocial/service/ActivityHandlerTest.java Thu Jun 11 00:35:26 2009
@@ -42,6 +42,7 @@
 import com.google.common.collect.Sets;
 
 import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.isNull;
 import org.json.JSONObject;
 
 import java.io.StringReader;
@@ -93,7 +94,7 @@
     List<Activity> activityList = ImmutableList.of();
     RestfulCollection<Activity> data = new RestfulCollection<Activity>(activityList);
     org.easymock.EasyMock.expect(activityService.getActivities(eq(JOHN_DOE),
-       eq(new GroupId(group, null)), eq("appId"), eq(Sets.<String>newHashSet()),
+       eq(new GroupId(group, null)), (String)isNull(), eq(Sets.<String>newHashSet()),
         org.easymock.EasyMock.isA(CollectionOptions.class), eq(token))).
         andReturn(ImmediateFuture.newInstance(data));
 

Modified: incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java?rev=783591&r1=783590&r2=783591&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java (original)
+++ incubator/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/sample/spi/JsonDbOpensocialServiceTest.java Thu Jun 11 00:35:26 2009
@@ -56,7 +56,7 @@
   private static final UserId JANE_DOE = new UserId(UserId.Type.userId, "jane.doe");
 
   private static final GroupId SELF_GROUP = new GroupId(GroupId.Type.self, null);
-  private static final String APP_ID = "test";
+  private static final String APP_ID = "1";
   private static final String CANONICAL_USER_ID = "canonical";
 
   private SecurityToken token = new FakeGadgetToken();
@@ -174,7 +174,7 @@
   public void testGetExpectedActivity() throws Exception {
     Activity activity = db.getActivity(
         CANON_USER, SELF_GROUP, APP_ID,
-        Sets.newHashSet("appId", "body", "mediaItems"), "1", new FakeGadgetToken()).get();
+        Sets.newHashSet("appId", "body", "mediaItems"), APP_ID, new FakeGadgetToken()).get();
     assertNotNull(activity);
     // Check that some fields are fetched and others are not
     assertNotNull(activity.getBody());

Modified: incubator/shindig/trunk/javascript/sampledata/canonicaldb.json
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/sampledata/canonicaldb.json?rev=783591&r1=783590&r2=783591&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/sampledata/canonicaldb.json (original)
+++ incubator/shindig/trunk/javascript/sampledata/canonicaldb.json Thu Jun 11 00:35:26 2009
@@ -247,7 +247,7 @@
 },
 "activities" : {
 "canonical" : [{
-"appId" : "test",
+"appId" : "1",
 "body" : "Went rafting",
 "bodyId" : "1",
 "externalId" : "http://www.example.org/123456",
@@ -277,7 +277,7 @@
 "url" : "http://www.example.org/canonical/activities/1",
 "userId" : "canonical"
 },{
-"appId" : "test",
+"appId" : "1",
 "body" : "Went skiing",
 "bodyId" : "1",
 "externalId" : "http://www.example.org/123457",