Created
September 21, 2015 12:31
-
-
Save YannRobert/f1d6a90803888df7fc3a to your computer and use it in GitHub Desktop.
report an issue with commit https://github.com/rabbitmq/rabbitmq-java-client/commit/49d291103ebcf4df80cafa8c4d0c1c594301f398
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.rabbitmq.client.ConnectionFactory; | |
import org.junit.Test; | |
public class ConnectionFactorySettersTest { | |
// considering the default value for handshakeTimeout is 10000 and the default value for connectionTimeout is 0 | |
// this test is failing | |
// if we set the connectionTimeout to a higher value than the default value of handshakeTimeout, the test will fail | |
@Test | |
public void shouldBeAbleToSetConnectionTimeoutBeforeHandshakeTimeout_high_values() { | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
connectionFactory.setConnectionTimeout(20 * 1000); | |
connectionFactory.setHandshakeTimeout(40 * 1000); | |
} | |
// this test is successful | |
// we can set the connectionTimeout before the handshakeTimeout if the connectionTimeout is lower than the previous value of the handshakeTimeout | |
@Test | |
public void shouldBeAbleToSetConnectionTimeoutBeforeHandshakeTimeout_low_values() { | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
connectionFactory.setConnectionTimeout(2 * 1000); | |
connectionFactory.setHandshakeTimeout(4 * 1000); | |
} | |
// this test is successful | |
// we have to first set the handshakeTimeout, then set the connectionTimeout | |
@Test | |
public void shouldBeAbleToSetConnectionTimeoutAfterHandshakeTimeout() { | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
connectionFactory.setHandshakeTimeout(40 * 1000); | |
connectionFactory.setConnectionTimeout(20 * 1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment