Package com.microsoft.windowsazure.services.media.models

Examples of com.microsoft.windowsazure.services.media.models.LocatorInfo


    public void createLocatorSuccess() throws ServiceException {
        // Arrange
        LocatorType locatorType = LocatorType.SAS;

        // Act
        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfoRead.getId(), assetInfo.getId(), locatorType));

        // Assert
        verifyLocatorProperties("locatorInfo", accessPolicyInfoRead.getId(),
                assetInfo.getId(), locatorType, null, locatorInfo);
View Full Code Here


    public void createLocatorWithSpecifiedIdSuccess() throws ServiceException {
        // Arrange
        LocatorType locatorType = LocatorType.SAS;

        // Act
        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfoRead.getId(), assetInfo.getId(), locatorType)
                .setId(String.format("nb:lid:UUID:%s", UUID.randomUUID()
                        .toString())));

        // Assert
View Full Code Here

        expectedStartDateTime.setTime(expectedStartDateTime.getTime()
                + tenMinutesInMS);
        LocatorType locatorType = LocatorType.SAS;

        // Act
        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), locatorType)
                .setStartDateTime(expectedStartDateTime));

        // Assert
        verifyLocatorProperties("locatorInfo", accessPolicyInfo.getId(),
View Full Code Here

        LocatorType locatorType = LocatorType.SAS;
        Date expectedStartDateTime = new Date();
        expectedStartDateTime.setTime(expectedStartDateTime.getTime()
                + tenMinutesInMS);

        LocatorInfo expectedLocatorInfo = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), locatorType)
                .setStartDateTime(expectedStartDateTime));

        // Act
        LocatorInfo actualLocatorInfo = service.get(Locator
                .get(expectedLocatorInfo.getId()));

        // Assert
        verifyLocatorInfosEqual("actualLocatorInfo", expectedLocatorInfo,
                actualLocatorInfo);
View Full Code Here

    @Test
    public void updateLocatorSuccess() throws ServiceException {
        // Arrange
        LocatorType locatorType = LocatorType.OnDemandOrigin;
        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfoRead.getId(), assetInfo.getId(), locatorType));

        Date startTime = new Date();
        startTime.setTime(startTime.getTime() - tenMinutesInMS);

        // Act
        service.update(Locator.update(locatorInfo.getId()).setStartDateTime(
                startTime));
        LocatorInfo updatedLocatorInfo = service.get(Locator.get(locatorInfo
                .getId()));

        // Assert
        Date expectedExpiration = new Date();
        expectedExpiration.setTime(startTime.getTime()
View Full Code Here

        expirationDateTime.setTime(expirationDateTime.getTime()
                + tenMinutesInMS);
        Date startTime = new Date();
        startTime.setTime(startTime.getTime() - tenMinutesInMS);

        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfoRead.getId(), assetInfo.getId(), locatorType)
                .setStartDateTime(startTime));

        // Act
        service.update(Locator.update(locatorInfo.getId()));
        LocatorInfo updatedLocatorInfo = service.get(Locator.get(locatorInfo
                .getId()));

        // Assert
        verifyLocatorInfosEqual("updatedLocatorInfo", locatorInfo,
                updatedLocatorInfo);
View Full Code Here

    @Test
    public void deleteLocatorSuccess() throws ServiceException {
        // Arrange
        LocatorType locatorType = LocatorType.SAS;
        LocatorInfo locatorInfo = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), locatorType));
        ListResult<LocatorInfo> listLocatorsResult = service.list(Locator
                .list());
        int assetCountBaseline = listLocatorsResult.size();

        // Act
        service.delete(Locator.delete(locatorInfo.getId()));

        // Assert
        listLocatorsResult = service.list(Locator.list());
        assertEquals("listLocatorsResult.size", assetCountBaseline - 1,
                listLocatorsResult.size());

        expectedException.expect(ServiceException.class);
        expectedException.expect(new ServiceExceptionMatcher(404));
        service.get(Locator.get(locatorInfo.getId()));
    }
View Full Code Here

        service.delete(Locator.delete(invalidId));
    }

    @Test
    public void canGetLocatorBackFromAsset() throws Exception {
        LocatorInfo locator = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), LocatorType.SAS));

        ListResult<LocatorInfo> locators = service.list(Locator.list(assetInfo
                .getLocatorsLink()));

        assertEquals(1, locators.size());
        assertEquals(locator.getId(), locators.get(0).getId());

    }
View Full Code Here

    }

    @Test
    public void canGetAssetFromLocator() throws Exception {
        LocatorInfo locator = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), LocatorType.SAS));

        AssetInfo asset = service.get(Asset.get(locator.getAssetLink()));

        assertEquals(assetInfo.getId(), asset.getId());
    }
View Full Code Here

        assertEquals(assetInfo.getId(), asset.getId());
    }

    @Test
    public void canGetAccessPolicyFromLocator() throws Exception {
        LocatorInfo locator = service.create(Locator.create(
                accessPolicyInfo.getId(), assetInfo.getId(), LocatorType.SAS));

        AccessPolicyInfo accessPolicy = service.get(AccessPolicy.get(locator
                .getAccessPolicyLink()));

        assertEquals(accessPolicyInfo.getId(), accessPolicy.getId());

    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.models.LocatorInfo

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.