@Test(expected = IllegalArgumentException.class) public void testReconnectTimeoutException() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setReconnectRetryLimits(10, 5); }
@Test(expected = IllegalArgumentException.class) public void testIllegalReconnectTimes() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), null); assertEquals(64, testClient.getMaxReconnectRetryTime()); testClient.setReconnectRetryLimits(16, 15); }
public void testLegalReconnectTimeEqual() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), null); assertEquals(4, testClient.getMaxReconnectRetryTime()); testClient.setReconnectRetryLimits(16, 16); assertEquals(16, testClient.getMinReconnectRetryTime()); assertEquals(16, testClient.getMaxReconnectRetryTime()); }
@Test public void testReconnectTimeout() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); assertEquals(4, testClient.getReconnectTimeout()); testClient.setReconnectTimeout(10); assertEquals(10, testClient.getReconnectTimeout()); testClient.setReconnectRetryLimits(20, 30); assertEquals(20, testClient.getMinReconnectRetryTime()); assertEquals(30, testClient.getMaxReconnectRetryTime()); }
testClient.setMqttClient(mockClient); testClient.setAutoReconnect(true); testClient.setReconnectRetryLimits(16, 16);
testClient.setReconnectRetryLimits(64, 128); testClient.setMaxAutoReconnectAttepts(5); testClient.setKeepAlive(20);