use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFileUploadNotificationReceive in project azure-iot-sdk-java by Azure.
the class AmqpFileUploadNotificationReceiveTest method receiveWithTimeoutNonZeroCallOk.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_005: [The function shall initialize the Proton reactor object]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_006: [The function shall start the Proton reactor object]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_008: [The function shall stop and free the Proton reactor object ]
@Test
public void receiveWithTimeoutNonZeroCallOk() throws IOException, InterruptedException {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
int timeoutMs = 1;
AmqpFileUploadNotificationReceive amqpFileUploadNotificationReceive = new AmqpFileUploadNotificationReceive(hostName, userName, sasToken, iotHubServiceClientProtocol);
amqpFileUploadNotificationReceive.open();
// Assert
new Expectations() {
{
reactor = proton.reactor(amqpFileUploadNotificationReceive);
reactor.start();
reactor.stop();
reactor.process();
reactor.free();
}
};
// Act
amqpFileUploadNotificationReceive.receive(timeoutMs);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFileUploadNotificationReceive in project azure-iot-sdk-java by Azure.
the class AmqpFileUploadNotificationReceiveTest method receiveWithTimoutZeroCallFlowOk.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_005: [The function shall initialize the Proton reactor object]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_006: [The function shall start the Proton reactor object]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_008: [The function shall stop and free the Proton reactor object ]
@Test
public void receiveWithTimoutZeroCallFlowOk() throws IOException, InterruptedException {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
int timeoutMs = 0;
AmqpFileUploadNotificationReceive amqpFileUploadNotificationReceive = new AmqpFileUploadNotificationReceive(hostName, userName, sasToken, iotHubServiceClientProtocol);
amqpFileUploadNotificationReceive.open();
// Assert
new Expectations() {
{
reactor = proton.reactor(amqpFileUploadNotificationReceive);
reactor.start();
reactor.stop();
reactor.process();
reactor.free();
}
};
// Act
amqpFileUploadNotificationReceive.receive(timeoutMs);
}
Aggregations