Search in sources :

Example 1 with RegistryStatistics

use of com.microsoft.azure.sdk.iot.service.RegistryStatistics in project azure-iot-sdk-java by Azure.

the class RegistryStatisticsTests method constructorSucceeds.

@Test
public void constructorSucceeds(@Mocked RegistryManager mockedRegistryManager) throws IOException, IotHubException {
    //arrange
    String connectionString = "HostName=aaa.bbb.ccc;SharedAccessKeyName=XXX;SharedAccessKey=YYY";
    RegistryManager registryManager = RegistryManager.createFromConnectionString(connectionString);
    // act
    RegistryStatistics statistics = registryManager.getStatistics();
}
Also used : RegistryStatistics(com.microsoft.azure.sdk.iot.service.RegistryStatistics) RegistryManager(com.microsoft.azure.sdk.iot.service.RegistryManager) Test(org.junit.Test)

Example 2 with RegistryStatistics

use of com.microsoft.azure.sdk.iot.service.RegistryStatistics in project azure-iot-sdk-java by Azure.

the class RegistryStatisticsTests method gettersSucceeds.

@Test
public void gettersSucceeds(@Mocked RegistryManager mockedRegistryManager) throws IOException, IotHubException {
    //arrange
    String connectionString = "HostName=aaa.bbb.ccc;SharedAccessKeyName=XXX;SharedAccessKey=YYY";
    RegistryManager registryManager = RegistryManager.createFromConnectionString(connectionString);
    RegistryStatistics statistics = registryManager.getStatistics();
    //act
    final long disabledDeviceCount = statistics.getDisabledDeviceCount();
    final long enabledDeviceCount = statistics.getEnabledDeviceCount();
    final long totalDeviceCount = statistics.getTotalDeviceCount();
    //assert
    assertEquals(disabledDeviceCount, 0);
    assertEquals(enabledDeviceCount, 0);
    assertEquals(totalDeviceCount, 0);
}
Also used : RegistryStatistics(com.microsoft.azure.sdk.iot.service.RegistryStatistics) RegistryManager(com.microsoft.azure.sdk.iot.service.RegistryManager) Test(org.junit.Test)

Aggregations

RegistryManager (com.microsoft.azure.sdk.iot.service.RegistryManager)2 RegistryStatistics (com.microsoft.azure.sdk.iot.service.RegistryStatistics)2 Test (org.junit.Test)2