@Test public void testSetMaxAutoReconnectAttempts() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setMaxAutoReconnectAttepts(5); assertEquals(5, testClient.getMaxAutoReconnectAttempts()); }
@Test public void testSetMaxAutoReconnectAttemptsForever() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setMaxAutoReconnectAttepts(-1); // -1 = retry forever assertEquals(-1, testClient.getMaxAutoReconnectAttempts()); }
@Test(expected = IllegalArgumentException.class) public void testSetMaxAutoReconnectAttemptsIllegalValue() throws Exception { AWSIotMqttManager testClient = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); testClient.setMaxAutoReconnectAttepts(-5); assertEquals(6, testClient.getMaxAutoReconnectAttempts()); }
testClient.setMaxAutoReconnectAttepts(5); testClient.setKeepAlive(20); testClient.setConnectionStabilityTime(25);