AliyunOSSiOSTests/OSSObjectTests.m [673:715]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NSString *filePath = [[NSString oss_documentDirectory] stringByAppendingPathComponent:_fileNames[2]];
    NSURL * fileURL = [NSURL fileURLWithPath:filePath];
    
    OSSPutObjectRequest * putObjectRequest = [OSSPutObjectRequest new];
    putObjectRequest.bucketName = _publicBucketName;
    putObjectRequest.objectKey = @"test-symlink-targetObjectName";
    putObjectRequest.uploadingFileURL = fileURL;
    putObjectRequest.objectMeta = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"test-symlink-target", @"x-oss-meta-name", nil];
    
    OSSTask * task = [_client putObject:putObjectRequest];
    [task waitUntilFinished];
    
    OSSPutSymlinkRequest * putSymlinkRequest = [OSSPutSymlinkRequest new];
    putSymlinkRequest.bucketName = _publicBucketName;
    putSymlinkRequest.objectKey = @"test-symlink-objectName";
    putSymlinkRequest.targetObjectName = @"test-symlink-targetObjectName";
    putSymlinkRequest.objectMeta = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"HONGKONG", @"x-oss-meta-location", nil];
    
    OSSTask * putSymlinktask = [_client putSymlink:putSymlinkRequest];
    
    [[putSymlinktask continueWithBlock:^id(OSSTask *task) {
        XCTAssertNil(task.error);
        
        return nil;
    }] waitUntilFinished];
    
    OSSGetSymlinkRequest * getSymlinkRequest = [OSSGetSymlinkRequest new];
    getSymlinkRequest.bucketName = _publicBucketName;
    getSymlinkRequest.objectKey = @"test-symlink-objectName";
    
    OSSTask * getSymlinktask = [_client getSymlink:getSymlinkRequest];
    
    [[getSymlinktask continueWithBlock:^id(OSSTask *task) {
        XCTAssertNil(task.error);
        OSSGetSymlinkResult *result = (OSSGetSymlinkResult *)task.result;
        NSString *targetObjectName = (NSString *)[result.httpResponseHeaderFields valueForKey:OSSHttpHeaderSymlinkTarget];
        NSString *metaLocation = (NSString *)[result.httpResponseHeaderFields valueForKey:@"x-oss-meta-location"];
        
        XCTAssertTrue([targetObjectName isEqualToString:@"test-symlink-targetObjectName"]);
        XCTAssertTrue([metaLocation isEqualToString:@"HONGKONG"]);
        
        return nil;
    }] waitUntilFinished];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



AliyunOSSiOSTests/OSSObjectTests.m [719:761]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NSString *filePath = [[NSString oss_documentDirectory] stringByAppendingPathComponent:_fileNames[2]];
    NSURL * fileURL = [NSURL fileURLWithPath:filePath];
    
    OSSPutObjectRequest * putObjectRequest = [OSSPutObjectRequest new];
    putObjectRequest.bucketName = _publicBucketName;
    putObjectRequest.objectKey = @"test-symlink-targetObjectName";
    putObjectRequest.uploadingFileURL = fileURL;
    putObjectRequest.objectMeta = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"test-symlink-target", @"x-oss-meta-name", nil];
    
    OSSTask * task = [_client putObject:putObjectRequest];
    [task waitUntilFinished];
    
    OSSPutSymlinkRequest * putSymlinkRequest = [OSSPutSymlinkRequest new];
    putSymlinkRequest.bucketName = _publicBucketName;
    putSymlinkRequest.objectKey = @"test-symlink-objectName";
    putSymlinkRequest.targetObjectName = @"test-symlink-targetObjectName";
    putSymlinkRequest.objectMeta = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"HONGKONG", @"x-oss-meta-location", nil];
    
    OSSTask * putSymlinktask = [_client putSymlink:putSymlinkRequest];
    
    [[putSymlinktask continueWithBlock:^id(OSSTask *task) {
        XCTAssertNil(task.error);
        
        return nil;
    }] waitUntilFinished];
    
    OSSGetSymlinkRequest * getSymlinkRequest = [OSSGetSymlinkRequest new];
    getSymlinkRequest.bucketName = _publicBucketName;
    getSymlinkRequest.objectKey = @"test-symlink-objectName";
    
    OSSTask * getSymlinktask = [_client getSymlink:getSymlinkRequest];
    
    [[getSymlinktask continueWithBlock:^id(OSSTask *task) {
        XCTAssertNil(task.error);
        OSSGetSymlinkResult *result = (OSSGetSymlinkResult *)task.result;
        NSString *targetObjectName = (NSString *)[result.httpResponseHeaderFields valueForKey:OSSHttpHeaderSymlinkTarget];
        NSString *metaLocation = (NSString *)[result.httpResponseHeaderFields valueForKey:@"x-oss-meta-location"];
        
        XCTAssertTrue([targetObjectName isEqualToString:@"test-symlink-targetObjectName"]);
        XCTAssertTrue([metaLocation isEqualToString:@"HONGKONG"]);
        
        return nil;
    }] waitUntilFinished];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



