You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by ga...@apache.org on 2014/04/17 22:26:13 UTC

svn commit: r1588364 - in /chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests: CMISBaseTest.m ObjectiveCMISTests.m env-cfg.plist

Author: gavincornwell
Date: Thu Apr 17 20:26:12 2014
New Revision: 1588364

URL: http://svn.apache.org/r1588364
Log:
CMIS-784: Unit tests: New server env. for 1.1 browser binding. Tests run as non-admin user (applied patch, with some modifications).

Modified:
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/CMISBaseTest.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/ObjectiveCMISTests.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/env-cfg.plist

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/CMISBaseTest.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/CMISBaseTest.m?rev=1588364&r1=1588363&r2=1588364&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/CMISBaseTest.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/CMISBaseTest.m Thu Apr 17 20:26:12 2014
@@ -45,6 +45,14 @@
     XCTAssertNotNil(environmentArray, @"environmentArray is nil!");
 
     for (NSDictionary *envDict in environmentArray) {
+        NSString *summary = envDict[@"summary"];
+        NSNumber *disabled = envDict[@"disabled"];
+        if ([disabled boolValue])
+        {
+            CMISLogDebug(@">------------------- Skipping test against %@ -------------------<", summary);
+            continue;
+        }
+        
         NSString *binding = [envDict valueForKey:@"binding"];
         NSString *url = [envDict valueForKey:@"url"];
         NSString *repositoryId = [envDict valueForKey:@"repositoryId"];
@@ -63,7 +71,7 @@
                    extraSessionParameters:extraSessionParameters completionBlock:^{
             self.testCompleted = NO;
             
-            CMISLogDebug(@">------------------- Running test against %@ -------------------<", url);
+            CMISLogDebug(@">------------------- Running test against %@ -------------------<", summary);
             
             testBlock();
         }];
@@ -113,11 +121,17 @@
             self.session = session;
             XCTAssertTrue(self.session.isAuthenticated, @"Session should be authenticated");
             [self.session retrieveRootFolderWithCompletionBlock:^(CMISFolder *rootFolder, NSError *error) {
-                self.rootFolder = rootFolder;
                 XCTAssertNil(error, @"Error while retrieving root folder: %@", [error description]);
-                XCTAssertNotNil(self.rootFolder, @"rootFolder object should not be nil");
-                
-                completionBlock();
+                XCTAssertNotNil(rootFolder, @"rootFolder object should not be nil");
+                if (rootFolder)
+                {
+                    [self.session retrieveObjectByPath:@"/ios-test" completionBlock:^(CMISObject *object, NSError *error) {
+                        self.rootFolder = (CMISFolder *)object;
+                        XCTAssertNil(error, @"Error while retrieving root folder: %@", [error description]);
+                        XCTAssertNotNil(self.rootFolder, @"/ios-test rootFolder object should not be nil");
+                        completionBlock();
+                    }];
+                }
             }];
         }
     }];

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/ObjectiveCMISTests.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/ObjectiveCMISTests.m?rev=1588364&r1=1588363&r2=1588364&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/ObjectiveCMISTests.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/ObjectiveCMISTests.m Thu Apr 17 20:26:12 2014
@@ -1055,7 +1055,7 @@
 {
     [self runTest:^ {
          // Use a document that has spaces in them (should be correctly encoded)
-         NSString *path = [NSString stringWithFormat:@"%@ios-test/activiti logo big.png", self.rootFolder.path];
+         NSString *path = [NSString stringWithFormat:@"%@/activiti logo big.png", self.rootFolder.path];
          [self.session retrieveObjectByPath:path completionBlock:^(CMISObject *object, NSError *error) {
              CMISDocument *document = (CMISDocument *)object;
              XCTAssertNil(error, @"Error while retrieving object with path %@", path);
@@ -1665,7 +1665,7 @@
 {
     [self runTest:^ {
          // Fetch test document
-         NSString *path = [NSString stringWithFormat:@"%@ios-test/millenium-dome-exif.jpg", self.rootFolder.path];
+         NSString *path = [NSString stringWithFormat:@"%@/millenium-dome-exif.jpg", self.rootFolder.path];
          CMISOperationContext *operationContext = [CMISOperationContext defaultOperationContext];
          operationContext.renditionFilterString = @"*";
          [self.session retrieveObjectByPath:path operationContext:operationContext completionBlock:^(CMISObject *object, NSError *error) {
@@ -1686,7 +1686,6 @@
              
              // Get content
              NSString *filePath = [NSString stringWithFormat:@"%@/testfile.pdf" , NSTemporaryDirectory()];
-//             NSString *filePath = @"testfile.pdf";
              [thumbnailRendition downloadRenditionContentToFile:filePath completionBlock:^(NSError *error) {
                  if (error == nil) {
                      // Assert File exists and check file length
@@ -1715,7 +1714,7 @@
 {
     [self runTest:^ {
          // Fetch test document
-         NSString *path = [NSString stringWithFormat:@"%@ios-test/millenium-dome-exif.jpg", self.rootFolder.path];
+         NSString *path = [NSString stringWithFormat:@"%@/millenium-dome-exif.jpg", self.rootFolder.path];
          CMISOperationContext *operationContext = [CMISOperationContext defaultOperationContext];
          operationContext.renditionFilterString = @"*";
          [self.session retrieveObjectByPath:path operationContext:operationContext completionBlock:^(CMISObject *object, NSError *error) {
@@ -1741,7 +1740,6 @@
                   
                   // Download content through objectService
                   NSString *filePath = [NSString stringWithFormat:@"%@/testfile-rendition-through-objectservice.pdf", NSTemporaryDirectory()];
-//                  NSString *filePath = @"testfile-rendition-through-objectservice.pdf";
                   [self.session.binding.objectService downloadContentOfObject:document.identifier
                                                                      streamId:thumbnailRendition.streamId
                                                                        toFile:filePath

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/env-cfg.plist
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/env-cfg.plist?rev=1588364&r1=1588363&r2=1588364&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/env-cfg.plist (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMISTests/env-cfg.plist Thu Apr 17 20:26:12 2014
@@ -5,25 +5,63 @@
 	<key>environments</key>
 	<array>
 		<dict>
+			<key>disabled</key>
+			<true/>
+			<key>summary</key>
+			<string>Alfresco v4.0.0 Enterprise. Legacy (Webscript)</string>
 			<key>username</key>
-			<string>admin</string>
+			<string>cmis</string>
 			<key>password</key>
-			<string>alzheimer</string>
+			<string>unittest</string>
 			<key>url</key>
 			<string>http://ec2-54-247-141-218.eu-west-1.compute.amazonaws.com/alfresco/service/api/cmis</string>
 			<key>repositoryId</key>
 			<string>368eca28-be2b-4a8d-8bbb-1d7997af7930</string>
 		</dict>
 		<dict>
+			<key>disabled</key>
+			<true/>
+			<key>summary</key>
+			<string>Alfresco v4.0.0 Enterprise. OpenCMIS AtomPub 1.0</string>
 			<key>username</key>
-			<string>admin</string>
+			<string>cmis</string>
 			<key>password</key>
-			<string>alzheimer</string>
+			<string>unittest</string>
 			<key>url</key>
 			<string>http://ec2-54-247-141-218.eu-west-1.compute.amazonaws.com/alfresco/cmisatom</string>
 			<key>repositoryId</key>
 			<string>368eca28-be2b-4a8d-8bbb-1d7997af7930</string>
 		</dict>
+		<dict>
+			<key>disabled</key>
+			<true/>
+			<key>summary</key>
+			<string>Alfresco v4.2.0 Enterprise. OpenCMIS (PublicAPI) AtomPub 1.0</string>
+			<key>username</key>
+			<string>cmis</string>
+			<key>password</key>
+			<string>unittest</string>
+			<key>url</key>
+			<string>http://ec2-54-195-83-189.eu-west-1.compute.amazonaws.com/alfresco/api/-default-/public/cmis/versions/1.0/atom</string>
+			<key>repositoryId</key>
+			<string>-default-</string>
+		</dict>
+		<dict>
+			<key>disabled</key>
+			<false/>
+			<key>summary</key>
+			<string>Alfresco v4.2.0 Enterprise. OpenCMIS (PublicAPI) Browser 1.1</string>
+			<key>binding</key>
+			<string>browser</string>
+			<key>username</key>
+			<string>cmis</string>
+			<key>password</key>
+			<string>unittest</string>
+			<key>url</key>
+			<string>http://ec2-54-195-83-189.eu-west-1.compute.amazonaws.com/alfresco/api/-default-/public/cmis/versions/1.1/browser</string>
+			<key>repositoryId</key>
+			<string>-default-</string>
+		</dict>
 	</array>
 </dict>
 </plist>