You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/02/26 18:27:06 UTC

[04/16] incubator-usergrid git commit: fixed comments, added withprop to entity

fixed comments, added withprop to entity


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b6cbc3d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b6cbc3d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b6cbc3d7

Branch: refs/heads/USERGRID-273-indexbuffer
Commit: b6cbc3d7b8e20520dcc2c0bc76c815a2b4135c54
Parents: 17e12c4
Author: Rod Simpson <ro...@apigee.com>
Authored: Thu Jan 22 18:24:20 2015 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Thu Jan 22 18:24:20 2015 -0700

----------------------------------------------------------------------
 .../collection/BrowserCompatibilityTest.java    | 23 ++++++--------------
 .../rest/test/resource2point0/model/Entity.java |  5 +++++
 2 files changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6cbc3d7/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
index d0d436d..841d98b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/BrowserCompatibilityTest.java
@@ -35,10 +35,8 @@ import static org.junit.Assert.assertEquals;
 public class BrowserCompatibilityTest extends AbstractRestIT {
 
 
-    /***
-     *
+    /**
      * Test to check chrome type accept headers
-     *
      */
     @Test
     public void testChromeHtmlTypes() throws Exception {
@@ -46,43 +44,36 @@ public class BrowserCompatibilityTest extends AbstractRestIT {
     }
 
 
-    /***
-     *
+    /**
      * Test to check firefox type accept headers
-     *
      */
     @Test
     public void testFireFoxHtmlTypes() throws Exception {
         testBrowserAccept( "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" );
     }
 
-
-    /***
-     *
+    /**
      * Test to check safari type accept headers
-     *
      */
     @Test
     public void testSafariTypes() throws Exception {
         testBrowserAccept( "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" );
     }
 
-
-    /***
-     *
+    /**
      * Helper method to run browser accept header tests
-     *
      */
     private void testBrowserAccept( String acceptHeader ) throws IOException {
 
         //make anew entity and verify that it is accurate
         String name = "thing1";
-        Entity payload = new Entity().chainPut("name", name);
+        Entity payload = new Entity();
+        payload.put("name", name);
         Entity entity = this.app().collection("things").post(payload);
         assertEquals(entity.get("name"), name);
         String uuid = entity.getAsString("uuid");
         this.refreshIndex();
-        
+
         //now get this new entity with "text/html" in the accept header
         Entity returnedEntity = this.app().collection("things").withAcceptHeader(acceptHeader).entity(entity).get();
         String returnedUUID = returnedEntity.getAsString("uuid");

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6cbc3d7/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
index 12a99de..d7fd09a 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
@@ -198,6 +198,11 @@ public class Entity implements Serializable, Map<String,Object> {
         return this;
     }
 
+    public Entity withProp(final String key, final Object value){
+        put(key,value);
+        return this;
+    }
+
     public ApiResponse getResponse(){
         return response;
     }