/**
 * Copyright Microsoft Corporation
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.microsoft.windowsazure.management.storage;

import java.util.Map;

import com.microsoft.windowsazure.management.configuration.ManagementConfiguration;
import com.microsoft.windowsazure.management.configuration.PublishSettingsLoader;
import com.microsoft.windowsazure.core.Builder;
import com.microsoft.windowsazure.core.Builder.Alteration;
import com.microsoft.windowsazure.core.Builder.Registry;
import com.microsoft.windowsazure.Configuration;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.filter.LoggingFilter;

public abstract class StorageManagementIntegrationTestBase {

    protected static StorageManagementClient storageManagementClient;

    protected static void createService() throws Exception {
        // reinitialize configuration from known state
        Configuration config = createConfiguration();

        // add LoggingFilter to any pipeline that is created
        Registry builder = (Registry) config.getBuilder();
        builder.alter(StorageManagementClient.class, Client.class, new Alteration<Client>() {
            @Override
            public Client alter(String profile, Client client, Builder builder, Map<String, Object> properties) {
                client.addFilter(new LoggingFilter());
                return client;
            }
        });

        storageManagementClient = StorageManagementService.create(config);
    }
  
    protected static Configuration createConfiguration() throws Exception {
//        return ManagementConfiguration.configure(
//                System.getenv(ManagementConfiguration.SUBSCRIPTION_ID),
//                System.getenv(ManagementConfiguration.KEYSTORE_PATH),
//                System.getenv(ManagementConfiguration.KEYSTORE_PASSWORD)
//        ); 
		// Act
		Configuration config = PublishSettingsLoader.createManagementConfiguration("C:\\Users\\xuezhain\\Downloads\\Azure SDK sandbox-1-25-2014-credentials.publishsettings", "db1ab6f0-4769-4b27-930e-01e2ef9c123c");
		return config;
    }
}
@@ -2071,18 +2071,16 @@
 ption %7B%0A
-//
         
@@ -2121,18 +2121,16 @@
 figure(%0A
-//
         
@@ -2193,18 +2193,16 @@
 ON_ID),%0A
-//
         
@@ -2263,18 +2263,16 @@
 _PATH),%0A
-//
         
@@ -2336,18 +2336,16 @@
 SSWORD)%0A
-//
         
@@ -2352,243 +2352,8 @@
 ); %0A
-%09%09// Act%0A%09%09Configuration config = PublishSettingsLoader.createManagementConfiguration(%22C:%5C%5CUsers%5C%5Cxuezhain%5C%5CDownloads%5C%5CAzure SDK sandbox-1-25-2014-credentials.publishsettings%22, %22db1ab6f0-4769-4b27-930e-01e2ef9c123c%22);%0A%09%09return config;%0A
     

remove the publishing setting inside the storage base test