You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by lg...@apache.org on 2014/03/17 16:28:11 UTC

svn commit: r1578437 - in /chemistry/objectivecmis/trunk/ObjectiveCMIS: Bindings/AtomPub/CMISAtomPubObjectService.m Client/CMISDocument.m Client/CMISSession.m Utils/CMISDefaultNetworkProvider.m Utils/CMISObjectConverter.m

Author: lgross
Date: Mon Mar 17 15:28:11 2014
New Revision: 1578437

URL: http://svn.apache.org/r1578437
Log:
Added fixes so that all Unit Tests are green again

Modified:
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m?rev=1578437&r1=1578436&r2=1578437&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m Mon Mar 17 15:28:11 2014
@@ -94,7 +94,9 @@
                            length:nil
                   completionBlock:completionBlock
                     progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                        progressBlock(bytesDownloaded, bytesTotal);
+                        if (progressBlock) {
+                            progressBlock(bytesDownloaded, bytesTotal);
+                        }
                     }];
 }
 
@@ -129,7 +131,9 @@
                                   length:nil
                          completionBlock:completionBlock
                            progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                               progressBlock(bytesDownloaded, bytesTotal);
+                               if (progressBlock) {
+                                   progressBlock(bytesDownloaded, bytesTotal);
+                               }
                            }];
 }
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m?rev=1578437&r1=1578436&r2=1578437&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m Mon Mar 17 15:28:11 2014
@@ -161,7 +161,9 @@
                                 length:nil
                        completionBlock:completionBlock
                          progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                             progressBlock(bytesDownloaded, bytesTotal);
+                             if (progressBlock) {
+                                 progressBlock(bytesDownloaded, bytesTotal);
+                             }
                          }];
 }
 
@@ -175,7 +177,9 @@
                                         length:nil
                                completionBlock:completionBlock
                                  progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                                     progressBlock(bytesDownloaded, bytesTotal);
+                                     if (progressBlock) {
+                                         progressBlock(bytesDownloaded, bytesTotal);
+                                     }
                                  }];
 }
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m?rev=1578437&r1=1578436&r2=1578437&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m Mon Mar 17 15:28:11 2014
@@ -449,7 +449,9 @@
                                       length:nil
                              completionBlock:completionBlock
                                progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                                   progressBlock(bytesDownloaded, bytesTotal);
+                                   if (progressBlock) {
+                                       progressBlock(bytesDownloaded, bytesTotal);
+                                   }
                                }];
 }
 
@@ -480,7 +482,9 @@
                                       length:nil
                              completionBlock:completionBlock
                                progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-                                   progressBlock(bytesDownloaded, bytesTotal);
+                                   if (progressBlock) {
+                                       progressBlock(bytesDownloaded, bytesTotal);
+                                   }
                                }];
 }
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m?rev=1578437&r1=1578436&r2=1578437&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m Mon Mar 17 15:28:11 2014
@@ -176,7 +176,9 @@ completionBlock:(void (^)(CMISHttpRespon
  progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     [self invoke:url httpMethod:httpRequestMethod session:session outputStream:outputStream bytesExpected:bytesExpected offset:nil length:nil cmisRequest:cmisRequest completionBlock:completionBlock progressBlock:^(unsigned long long bytesDownloaded, unsigned long long bytesTotal, BOOL *stop) {
-        progressBlock(bytesDownloaded, bytesTotal);
+        if (progressBlock) {
+            progressBlock(bytesDownloaded, bytesTotal);
+        }
     }];
 }
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m?rev=1578437&r1=1578436&r2=1578437&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m Mon Mar 17 15:28:11 2014
@@ -108,7 +108,11 @@
                          typeDefinition:(CMISTypeDefinition *)typeDefinition
                         completionBlock:(void (^)(CMISProperties *convertedProperties, NSError *error))completionBlock
 {
-    [self internalNormalConvertProperties:properties typeDefinitions:[NSArray arrayWithObject:typeDefinition] completionBlock:completionBlock];
+    NSArray *typeDefinitions = nil;
+    if (typeDefinition) {
+        typeDefinitions = [NSArray arrayWithObject:typeDefinition];
+    }
+    [self internalNormalConvertProperties:properties typeDefinitions:typeDefinitions completionBlock:completionBlock];
 }
 
 - (void)internalNormalConvertProperties:(NSDictionary *)properties