|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2014 the original author or authors.
|
|
|
|
* Copyright 2012-2015 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -25,6 +25,7 @@ import static org.junit.Assert.assertNull;
|
|
|
|
* Tests for {@link RabbitProperties}.
|
|
|
|
* Tests for {@link RabbitProperties}.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Dave Syer
|
|
|
|
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class RabbitPropertiesTests {
|
|
|
|
public class RabbitPropertiesTests {
|
|
|
|
|
|
|
|
|
|
|
@ -85,6 +86,15 @@ public class RabbitPropertiesTests {
|
|
|
|
assertEquals("lemur.cloudamqp.com:5672", this.properties.getAddresses());
|
|
|
|
assertEquals("lemur.cloudamqp.com:5672", this.properties.getAddresses());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void addressWithTrailingSlash() {
|
|
|
|
|
|
|
|
this.properties.setAddresses("amqp://root:password@otherhost:1111/");
|
|
|
|
|
|
|
|
assertEquals("otherhost", this.properties.getHost());
|
|
|
|
|
|
|
|
assertEquals(1111, this.properties.getPort());
|
|
|
|
|
|
|
|
assertEquals("root", this.properties.getUsername());
|
|
|
|
|
|
|
|
assertEquals("/", this.properties.getVirtualHost());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testDefaultVirtualHost() {
|
|
|
|
public void testDefaultVirtualHost() {
|
|
|
|
this.properties.setVirtualHost("/");
|
|
|
|
this.properties.setVirtualHost("/");
|
|
|
@ -92,7 +102,7 @@ public class RabbitPropertiesTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testemptyVirtualHost() {
|
|
|
|
public void testEmptyVirtualHost() {
|
|
|
|
this.properties.setVirtualHost("");
|
|
|
|
this.properties.setVirtualHost("");
|
|
|
|
assertEquals("/", this.properties.getVirtualHost());
|
|
|
|
assertEquals("/", this.properties.getVirtualHost());
|
|
|
|
}
|
|
|
|
}
|
|
|
|