コード例 #1
0
    protected function createStorageInstance()
    {
        $storageClient = null;
        if (TESTS_SESSIONHANDLER_RUNONPROD) {
            $storageClient = new Microsoft_WindowsAzure_Storage_Blob(TESTS_BLOB_HOST_PROD, TESTS_STORAGE_ACCOUNT_PROD, TESTS_STORAGE_KEY_PROD, false, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
        } else {
            $storageClient = new Microsoft_WindowsAzure_Storage_Blob(TESTS_BLOB_HOST_DEV, TESTS_STORAGE_ACCOUNT_DEV, TESTS_STORAGE_KEY_DEV, true, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
        }
        
        if (TESTS_STORAGE_USEPROXY) {
            $storageClient->setProxy(TESTS_STORAGE_USEPROXY, TESTS_STORAGE_PROXY, TESTS_STORAGE_PROXY_PORT, TESTS_STORAGE_PROXY_CREDENTIALS);
        }

        return $storageClient;
    }
コード例 #2
0
 /**
  * Test retry policy - retryN
  */
 public function testRetryN()
 {
     $this->_executedRetries = 0;
     $this->_exceptionCount = 9;
     
     $policy = Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 100);
     $retries = $policy->execute(
         array($this, '_countRetriesAndThrowExceptions')
     );
     $this->assertEquals(10, $retries);
 }
コード例 #3
0
 protected function createStorageInstance()
 {
     return new Microsoft_WindowsAzure_Storage_Blob(TESTS_BLOB_HOST_PROD, TESTS_STORAGE_ACCOUNT_PROD, TESTS_STORAGE_KEY_PROD, false, Microsoft_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
 }