Package com.microsoft.windowsazure

Examples of com.microsoft.windowsazure.Configuration


    @Test
    public void createMediaContractWithSpecifiedProfileAndConfiguration() {
        // Arrange
        String profile = "testProfile";
        Configuration configuration = MediaConfiguration
                .configureWithOAuthAuthentication(profile, new Configuration(),
                        "mediaServiceBaseUri", "oAuthUri", "clientId",
                        "clientSecret", "testScope");

        // Act
        MediaContract mediaContract = MediaService.create(profile,
View Full Code Here


import com.microsoft.windowsazure.Configuration;

public abstract class IntegrationTestBase {
    protected static Configuration createConfiguration() {
        Configuration config = Configuration.getInstance();
        overrideWithEnv(config, BlobConfiguration.ACCOUNT_NAME);
        overrideWithEnv(config, BlobConfiguration.ACCOUNT_KEY);
        overrideWithEnv(config, BlobConfiguration.URI);
        return config;
    }
View Full Code Here

    @Test
    public void createMediaConfigurationTestSuccess() {
        // Arrange

        // Act
        Configuration configuration = MediaConfiguration
                .configureWithOAuthAuthentication(
                        "https://testMediaServiceBaseUri", "testOAuthUri",
                        "testClientId", "testClientSecret", "testScope");

        // Assert
        assertEquals("https://testMediaServiceBaseUri",
                configuration.getProperty("media.uri"));
        assertEquals("testOAuthUri",
                configuration.getProperty("media.oauth.uri"));
        assertEquals("testClientId",
                configuration.getProperty("media.oauth.client.id"));
        assertEquals("testClientSecret",
                configuration.getProperty("media.oauth.client.secret"));
        assertEquals("testScope",
                configuration.getProperty("media.oauth.scope"));
    }
View Full Code Here

    }

    @Test
    public void createMediaConfigurationPassingExistingConfigurationSuccess() {
        // Arrange
        Configuration preConfiguration = new Configuration();
        preConfiguration.setProperty("preexistingName", "preexistingValue");

        // Act
        Configuration configuration = MediaConfiguration
                .configureWithOAuthAuthentication(preConfiguration,
                        "https://testMediaServiceBaseUri", "testOAuthUri",
                        "testClientId", "testClientSecret", "testScope");

        // Assert
        assertEquals("preexistingValue",
                configuration.getProperty("preexistingName"));
        assertEquals("https://testMediaServiceBaseUri",
                configuration.getProperty("media.uri"));
        assertEquals("testOAuthUri",
                configuration.getProperty("media.oauth.uri"));
        assertEquals("testClientId",
                configuration.getProperty("media.oauth.client.id"));
        assertEquals("testClientSecret",
                configuration.getProperty("media.oauth.client.secret"));

    }
View Full Code Here

    }

    @Test
    public void createMediaConfigurationWithProfileConfigurationSuccess() {
        // Arrange
        Configuration preConfiguration = new Configuration();
        preConfiguration.setProperty("preexistingName", "preexistingValue");

        // Act
        Configuration configuration = MediaConfiguration
                .configureWithOAuthAuthentication("testProfile",
                        preConfiguration, "https://testMediaServiceBaseUri",
                        "testOAuthUri", "testClientId", "testClientSecret",
                        "testScope");

        // Assert
        assertEquals("preexistingValue",
                configuration.getProperty("preexistingName"));
        assertEquals("https://testMediaServiceBaseUri",
                configuration.getProperty("testProfile.media.uri"));
        assertEquals("testOAuthUri",
                configuration.getProperty("testProfile.media.oauth.uri"));
        assertEquals("testClientId",
                configuration.getProperty("testProfile.media.oauth.client.id"));
        assertEquals("testClientSecret",
                configuration
                        .getProperty("testProfile.media.oauth.client.secret"));
    }
View Full Code Here

        }

        CREATEABLE_CONTAINER_1 = creatableContainers[0];
        TEST_CONTAINER_FOR_BLOBS = testContainers[0];
        // Create all test containers and their content
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        createContainers(service, testContainersPrefix, testContainers);

        try {
View Full Code Here

        }
    }

    @AfterClass
    public static void cleanup() throws Exception {
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        deleteContainers(service, testContainersPrefix, testContainers);
        deleteContainers(service, createableContainersPrefix,
                creatableContainers);
View Full Code Here

    }

    @Test
    public void createContainerWorks() throws Exception {
        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        // Act
        service.createContainer(CREATEABLE_CONTAINER_1);
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void createNullContainerFail() throws Exception {
        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        // Act
        service.createContainer(null);
View Full Code Here

    }

    @Test
    public void deleteContainerWorks() throws Exception {
        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);
        String containerName = "deletecontainerworks";
        service.createContainer(containerName, new CreateContainerOptions()
                .setPublicAccess("blob").addMetadata("test", "bar")
                .addMetadata("blah", "bleah"));
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.