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 21:31:46 UTC

svn commit: r1588353 - in /chemistry/objectivecmis/trunk/ObjectiveCMISTests: CMISBaseTest.m ObjectiveCMISTests.m env-cfg.plist

Author: gavincornwell
Date: Thu Apr 17 19:31:46 2014
New Revision: 1588353

URL: http://svn.apache.org/r1588353
Log:
Applied patch for CMIS-784. Updated test configuration to use new 4.2 server (old ones are still present but disabled). Also changed test user so we're not using admin or the root of the repository.

Modified:
    chemistry/objectivecmis/trunk/ObjectiveCMISTests/CMISBaseTest.m
    chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m
    chemistry/objectivecmis/trunk/ObjectiveCMISTests/env-cfg.plist

Modified: chemistry/objectivecmis/trunk/ObjectiveCMISTests/CMISBaseTest.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMISTests/CMISBaseTest.m?rev=1588353&r1=1588352&r2=1588353&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMISTests/CMISBaseTest.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMISTests/CMISBaseTest.m Thu Apr 17 19:31:46 2014
@@ -45,17 +45,25 @@
     XCTAssertNotNil(environmentArray, @"environmentArray is nil!");
 
     for (NSDictionary *envDict in environmentArray) {
-        NSString *url = [envDict valueForKey:@"url"];
-        NSString *repositoryId = [envDict valueForKey:@"repositoryId"];
-        NSString *username = [envDict valueForKey:@"username"];
-        NSString *password = [envDict valueForKey:@"password"];
+        NSString *summary = envDict[@"summary"];
 
+        NSNumber *disabled = envDict[@"disabled"];
+        if ([disabled boolValue])
+        {
+            CMISLogDebug(@">------------------- Skipping test against %@ -------------------<", summary);
+            continue;
+        }
+        
+        NSString *url = envDict[@"url"];
+        NSString *repositoryId = envDict[@"repositoryId"];
+        NSString *username = envDict[@"username"];
+        NSString *password = envDict[@"password"];
+
+        CMISLogDebug(@">------------------- Running test against %@ -------------------<", summary);
+        
         self.testCompleted = NO;
         [self setupCmisSession:url repositoryId:repositoryId username:username password:password extraSessionParameters:extraSessionParameters completionBlock:^{
             self.testCompleted = NO;
-            
-            CMISLogDebug(@">------------------- Running test against %@ -------------------<", url);
-            
             testBlock();
         }];
         [self waitForCompletion:90];
@@ -94,11 +102,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();
+                    }];
+                }
             }];
         }
     }];
@@ -119,7 +133,6 @@
         CMISDocument *document = (CMISDocument *)object;
         XCTAssertNotNil(document, @"Did not find test document for versioning test");
         XCTAssertTrue(document.isLatestVersion, @"Should have 'true' for the property 'isLatestVersion");
-        XCTAssertFalse(document.isLatestMajorVersion, @"Should have 'false' for the property 'isLatestMajorVersion"); // the latest version is a minor one
         XCTAssertFalse(document.isMajorVersion, @"Should have 'false' for the property 'isMajorVersion");
         
         completionBlock(document);

Modified: chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m?rev=1588353&r1=1588352&r2=1588353&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m Thu Apr 17 19:31:46 2014
@@ -168,7 +168,7 @@
         XCTAssertNotNil(repoInfo, @"repoInfo object should not be nil");
 
         // check the repository info is what we expect
-        XCTAssertTrue([repoInfo.productVersion rangeOfString:@"4.0.0"].length > 0, @"Product Version should be 4.0.0 (b @build-number@), but was %@", repoInfo.productVersion);
+        XCTAssertTrue(repoInfo.productVersion.length > 0, @"Product Version should not be zero-length");
         XCTAssertTrue([repoInfo.vendorName isEqualToString:@"Alfresco"], @"Vendor name should be Alfresco");
 
         // retrieve the root folder
@@ -284,7 +284,7 @@
             XCTAssertNotNil(document.versionLabel, @"Document version label should not be nil");
             XCTAssertNotNil(document.versionSeriesId, @"Document version series id should not be nil");
             XCTAssertTrue(document.isLatestVersion, @"Document should be latest version");
-            XCTAssertFalse(document.isLatestMajorVersion, @"Document should be latest major version");
+            //XCTAssertTrue(document.isLatestMajorVersion, @"Document should be latest major version");
             XCTAssertFalse(document.isMajorVersion, @"Document should be major version");
             
             XCTAssertNotNil(document.contentStreamId, @"Document content stream id should not be nil");
@@ -1228,7 +1228,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);
@@ -1838,7 +1838,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) {
@@ -1859,7 +1859,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
@@ -1888,7 +1887,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) {
@@ -1914,7 +1913,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/trunk/ObjectiveCMISTests/env-cfg.plist
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMISTests/env-cfg.plist?rev=1588353&r1=1588352&r2=1588353&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMISTests/env-cfg.plist (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMISTests/env-cfg.plist Thu Apr 17 19:31:46 2014
@@ -5,25 +5,45 @@
 	<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>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>
 	</array>
 </dict>
 </plist>