Package com.microsoft.windowsazure

Examples of com.microsoft.windowsazure.Configuration


    protected static String testWebsitePrefix = "azuresdktestwebsite";
    protected static WebSiteManagementClient webSiteManagementClient;

    protected static void createService() throws Exception {
        // reinitialize configuration from known state
        Configuration config = createConfiguration();
        config.setProperty(ApacheConfigurationProperties.PROPERTY_RETRY_HANDLER, new DefaultHttpRequestRetryHandler());

        // add LoggingFilter to any pipeline that is created
        Registry builder = (Registry) config.getBuilder();
        builder.alter(WebSiteManagementClient.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;
View Full Code Here


public class WrapRestProxyIntegrationTest {
    @Test
    public void serviceCanBeCalledToCreateAccessToken() throws Exception {
        // Arrange
        Configuration config = Configuration.getInstance();
        overrideWithEnv(config, ServiceBusConfiguration.URI);
        overrideWithEnv(config, ServiceBusConfiguration.WRAP_URI);
        overrideWithEnv(config, ServiceBusConfiguration.WRAP_NAME);
        overrideWithEnv(config, ServiceBusConfiguration.WRAP_PASSWORD);
        WrapContract contract = new WrapRestProxy(config.create(Client.class),
                new UserAgentFilter());

        // Act
        String serviceBusUri = (String) config
                .getProperty(ServiceBusConfiguration.URI);
        String uri = (String) config
                .getProperty(ServiceBusConfiguration.WRAP_URI);
        String name = (String) config
                .getProperty(ServiceBusConfiguration.WRAP_NAME);
        String password = (String) config
                .getProperty(ServiceBusConfiguration.WRAP_PASSWORD);
        String scope = new URI("http", new URI(serviceBusUri).getAuthority(),
                new URI(serviceBusUri).getPath(), null, null).toString();
        WrapAccessTokenResult result = contract.wrapAccessToken(uri, name,
                password, scope);
View Full Code Here

                        ns, issuer, secret, stsEndpoint);
    }

    @Test
    public void settingsAreUsedFromConnectionStringInConfig() throws Exception {
        Configuration config = Configuration.load();
        ServiceBusConfiguration.configureWithConnectionString(null, config,
                getConnectionString("myNamespace", "owner", "secret"));

        ServiceBusConnectionSettings settings = config
                .create(ServiceBusConnectionSettings.class);

        assertEquals("https://myNamespace.servicebus.windows.net/",
                settings.getUri());
        assertEquals(
View Full Code Here

    }

    @Test
    public void settingsAreUsedFromIndividualSettingsInConfiguration()
            throws Exception {
        Configuration config = Configuration.load();

        ServiceBusConfiguration.configureWithWrapAuthentication(config,
                "myNamespace", "owner", "secret", ".servicebus.windows.net/",
                "-sb.accesscontrol.windows.net/WRAPv0.9");

        ServiceBusConnectionSettings settings = config
                .create(ServiceBusConnectionSettings.class);

        assertEquals("https://myNamespace.servicebus.windows.net/",
                settings.getUri());
        assertEquals(
View Full Code Here

    }

    @Test
    public void settingsPreferConnectionStringIfBothPresentInConfiguration()
            throws Exception {
        Configuration config = Configuration.load();

        ServiceBusConfiguration.configureWithWrapAuthentication(config,
                "myIndividualNamespace", "individualowner", "individualsecret",
                ".servicebus.windows.net/",
                "-sb.accesscontrol.windows.net/WRAPv0.9");

        ServiceBusConfiguration.configureWithConnectionString(null, config,
                getConnectionString("myNamespaceCS", "ownerCS", "secretCS"));

        ServiceBusConnectionSettings settings = config
                .create(ServiceBusConnectionSettings.class);

        assertEquals("https://myNamespaceCS.servicebus.windows.net/",
                settings.getUri());
        assertEquals(
View Full Code Here

public class WrapTokenManagerIntegrationTest {
    @Test
    public void wrapClientWillAcquireAccessToken() throws Exception {
        // Arrange
        Configuration config = Configuration.load();
        overrideWithEnv(config, ServiceBusConfiguration.CONNECTION_STRING);
        WrapTokenManager client = config.create(WrapTokenManager.class);
        ServiceBusConnectionSettings settings = config
                .create(ServiceBusConnectionSettings.class);
        // Act
        URI serviceBusURI = new URI(settings.getUri());
        String accessToken = client.getAccessToken(serviceBusURI);
View Full Code Here

    protected static StorageManagementClient storageManagementClient;
    protected static ManagementClient managementClient;

    protected static void createService() throws Exception {
        // reinitialize configuration from known state
        Configuration config = createConfiguration();
        config.setProperty(ApacheConfigurationProperties.PROPERTY_RETRY_HANDLER, new DefaultHttpRequestRetryHandler());

        storageManagementClient = StorageManagementService.create(config);
    }
View Full Code Here

        storageManagementClient = StorageManagementService.create(config);
    }
   
    protected static void createManagementClient() throws Exception {
        Configuration config = createConfiguration();
        config.setProperty(ApacheConfigurationProperties.PROPERTY_RETRY_HANDLER, new DefaultHttpRequestRetryHandler());
        managementClient = ManagementService.create(config);
    }      
View Full Code Here

public class MediaServiceTest {

    @Test
    public void createMediaContractSuccessTest() {
        // Arrange
        Configuration configurationInstance = Configuration.getInstance();
        configurationInstance = MediaConfiguration
                .configureWithOAuthAuthentication(configurationInstance,
                        "mediaServiceBaseUri", "oAuthUri", "clientId",
                        "clientSecret", "testScope");
View Full Code Here

    }

    @Test
    public void createMediaContractWithSpecifiedConfigurationTest() {
        // Arrange
        Configuration configuration = MediaConfiguration
                .configureWithOAuthAuthentication("mediaServiceBaseUri",
                        "oAuthUri", "clientId", "clientSecret", "testScope");

        // Act
        MediaContract mediaContract = MediaService.create(configuration);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.