@Test public void testGetOfflinePublishQueueBound() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); assertEquals(100, (int) testClient.getOfflinePublishQueueBound()); }
@Test public void testSetOfflinePublishQueueBound() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setOfflinePublishQueueBound(50); assertEquals(50, (int) testClient.getOfflinePublishQueueBound()); }
@Test(expected = IllegalArgumentException.class) public void testSetOfflinePublishQueueBoundNegative() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setOfflinePublishQueueBound(-5); assertEquals(100, (int) testClient.getOfflinePublishQueueBound()); }
@Test public void testCreateClientWithEndpoint() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", "ABCDEFG.iot.us-east-1.amazonaws.com"); assertEquals(true, testClient.isAutoReconnect()); assertEquals(4, testClient.getReconnectTimeout()); assertEquals(4, testClient.getMinReconnectRetryTime()); assertEquals(64, testClient.getMaxReconnectRetryTime()); assertEquals(10, testClient.getMaxAutoReconnectAttempts()); assertEquals(300, testClient.getKeepAlive()); assertEquals(10, testClient.getConnectionStabilityTime()); assertTrue(testClient.isOfflinePublishQueueEnabled()); assertEquals(100L, (long)testClient.getOfflinePublishQueueBound()); assertEquals(Region.getRegion(Regions.US_EAST_1), testClient.getRegion()); assertEquals(MqttManagerConnectionState.Disconnected, testClient.getConnectionState()); }
assertEquals(10, testClient.getConnectionStabilityTime()); assertTrue(testClient.isOfflinePublishQueueEnabled()); assertEquals(100L, (long)testClient.getOfflinePublishQueueBound()); assertEquals(TEST_ENDPOINT_PREFIX, testClient.getAccountEndpointPrefix()); assertEquals(MqttManagerConnectionState.Disconnected, testClient.getConnectionState()); assertEquals(25, testClient.getConnectionStabilityTime()); assertFalse(testClient.isOfflinePublishQueueEnabled()); assertEquals(50L, (long)testClient.getOfflinePublishQueueBound());