usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject usergrid git commit: Added some comments and deleting found commented out code.
Date Wed, 13 Jan 2016 17:59:48 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-144 818343c9c -> 03c14cf01


Added some comments and deleting found commented out code.


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

Branch: refs/heads/USERGRID-144
Commit: 03c14cf01cbd277615631c9ccdbd13e447a054d5
Parents: 818343c
Author: George Reyes <grey@apache.org>
Authored: Wed Jan 13 09:59:46 2016 -0800
Committer: George Reyes <grey@apache.org>
Committed: Wed Jan 13 09:59:46 2016 -0800

----------------------------------------------------------------------
 .../apache/usergrid/rest/applications/ServiceResource.java    | 7 +++----
 .../usergrid/rest/applications/assets/AssetResourceIT.java    | 5 ++---
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/03c14cf0/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
index 2809eb7..251ad90 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/applications/ServiceResource.java
@@ -657,20 +657,19 @@ public class ServiceResource extends AbstractContextResource {
 
         FormDataBodyPart fileBodyPart = multiPart.getField( FILE_FIELD_NAME );
 
-       // if ( data.isEmpty() && fileBodyPart != null ) { // ensure entity is created
even if there are no properties
-            data.put( AssetUtils.FILE_METADATA, new HashMap() );
-       // }
+        data.put( AssetUtils.FILE_METADATA, new HashMap() );
 
         // process entity
         ApiResponse response = createApiResponse();
         response.setAction( serviceAction.name().toLowerCase() );
         response.setApplication( services.getApplication() );
         response.setParams( ui.getQueryParameters() );
+
+        //Updates entity with fields that are in text/plain as per loop above
         if(data.get( FILE_FIELD_NAME )==null){
             data.put( FILE_FIELD_NAME,null );
         }
         ServicePayload payload = getPayload( data );
-
         ServiceResults serviceResults = executeServiceRequest( ui, response, serviceAction,
payload );
 
         // process file part

http://git-wip-us.apache.org/repos/asf/usergrid/blob/03c14cf0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
index 9569d05..82fc999 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/assets/AssetResourceIT.java
@@ -155,9 +155,8 @@ public class AssetResourceIT extends AbstractRestIT {
         form = new FormDataMultiPart()
             .field( "name", "verifyMetadataChangedTest" )
             .field( "file", this.getClass().getResourceAsStream( "/test.txt" ) ,MediaType.TEXT_PLAIN_TYPE);
-
-
         pathResource( getOrgAppPath( "foos/" + assetId ) ).put( form );
+
         //re-get to verify data was saved to backend
         getResponse = pathResource( getOrgAppPath( "foos/" + assetId ) ).get( ApiResponse.class
);
         entity = getResponse.getEntities().get( 0 );
@@ -178,7 +177,7 @@ public class AssetResourceIT extends AbstractRestIT {
         putResponse = pathResource( getOrgAppPath( "foos/" + assetId ) ).put( form );
         this.refreshIndex();
 
-
+        //verify that data was correctly written to backend
         getResponse = pathResource( getOrgAppPath( "foos/" + assetId ) ).get( ApiResponse.class
);
         entity = getResponse.getEntities().get( 0 );
         fileMetadata = (Map<String, Object>)entity.get("file-metadata");


Mime
View raw message