Browse Source

Merge branch '1.5.x'

pull/6883/merge
Stephane Nicoll 9 years ago
parent
commit
cb40ea485b
  1. 7
      spring-boot-actuator/src/test/resources/cache/test-hazelcast.xml
  2. 7
      spring-boot-actuator/src/test/resources/hazelcast.xml
  3. 17
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java
  4. 7
      spring-boot-autoconfigure/src/test/resources/hazelcast.xml
  5. 7
      spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml
  6. 7
      spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml
  7. 7
      spring-boot-samples/spring-boot-sample-cache/src/main/resources/hazelcast.xml

7
spring-boot-actuator/src/test/resources/cache/test-hazelcast.xml vendored

@ -5,4 +5,11 @@ @@ -5,4 +5,11 @@
<map name="books"/>
<map name="players"/>
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

7
spring-boot-actuator/src/test/resources/hazelcast.xml

@ -5,4 +5,11 @@ @@ -5,4 +5,11 @@
<map name="defaultCache" />
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

17
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java vendored

@ -438,7 +438,7 @@ public class CacheAutoConfigurationTests { @@ -438,7 +438,7 @@ public class CacheAutoConfigurationTests {
cacheManager.getCache("defaultCache");
assertThat(cacheManager.getCacheNames()).containsOnly("defaultCache");
assertThat(this.context.getBean(HazelcastInstance.class))
.isEqualTo(getHazelcastInstance(cacheManager));
.isEqualTo(cacheManager.getHazelcastInstance());
}
@Test
@ -455,7 +455,7 @@ public class CacheAutoConfigurationTests { @@ -455,7 +455,7 @@ public class CacheAutoConfigurationTests {
.getBean(HazelcastInstance.class);
HazelcastCacheManager cacheManager = validateCacheManager(
HazelcastCacheManager.class);
HazelcastInstance actual = getHazelcastInstance(cacheManager);
HazelcastInstance actual = cacheManager.getHazelcastInstance();
assertThat(actual).isSameAs(hazelcastInstance);
assertThat(actual.getConfig().getConfigurationUrl())
.isEqualTo(new ClassPathResource(
@ -478,7 +478,7 @@ public class CacheAutoConfigurationTests { @@ -478,7 +478,7 @@ public class CacheAutoConfigurationTests {
load(HazelcastCustomHazelcastInstance.class, "spring.cache.type=hazelcast");
HazelcastCacheManager cacheManager = validateCacheManager(
HazelcastCacheManager.class);
assertThat(getHazelcastInstance(cacheManager))
assertThat(cacheManager.getHazelcastInstance())
.isEqualTo(this.context.getBean("customHazelcastInstance"));
}
@ -496,7 +496,7 @@ public class CacheAutoConfigurationTests { @@ -496,7 +496,7 @@ public class CacheAutoConfigurationTests {
HazelcastCacheManager.class);
HazelcastInstance hazelcastInstance = this.context
.getBean(HazelcastInstance.class);
assertThat(getHazelcastInstance(cacheManager)).isEqualTo(hazelcastInstance);
assertThat(cacheManager.getHazelcastInstance()).isEqualTo(hazelcastInstance);
assertThat(hazelcastInstance.getConfig().getConfigurationFile())
.isEqualTo(new ClassPathResource(mainConfig).getFile());
}
@ -519,8 +519,7 @@ public class CacheAutoConfigurationTests { @@ -519,8 +519,7 @@ public class CacheAutoConfigurationTests {
.getBean(HazelcastInstance.class);
HazelcastCacheManager cacheManager = validateCacheManager(
HazelcastCacheManager.class);
HazelcastInstance cacheHazelcastInstance = (HazelcastInstance) new DirectFieldAccessor(
cacheManager).getPropertyValue("hazelcastInstance");
HazelcastInstance cacheHazelcastInstance = cacheManager.getHazelcastInstance();
assertThat(cacheHazelcastInstance).isNotEqualTo(hazelcastInstance); // Our custom
assertThat(hazelcastInstance.getConfig().getConfigurationFile())
.isEqualTo(new ClassPathResource(mainConfig).getFile());
@ -717,12 +716,6 @@ public class CacheAutoConfigurationTests { @@ -717,12 +716,6 @@ public class CacheAutoConfigurationTests {
this.context = applicationContext;
}
private static HazelcastInstance getHazelcastInstance(
HazelcastCacheManager cacheManager) {
return (HazelcastInstance) new DirectFieldAccessor(cacheManager)
.getPropertyValue("hazelcastInstance");
}
@Configuration
static class EmptyConfiguration {

7
spring-boot-autoconfigure/src/test/resources/hazelcast.xml

@ -5,4 +5,11 @@ @@ -5,4 +5,11 @@
<map name="defaultCache" />
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

7
spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml vendored

@ -7,4 +7,11 @@ @@ -7,4 +7,11 @@
<max-idle-seconds>600</max-idle-seconds>
</map>
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

7
spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/hazelcast/hazelcast-specific.xml

@ -4,4 +4,11 @@ @@ -4,4 +4,11 @@
<queue name="foobar"/>
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

7
spring-boot-samples/spring-boot-sample-cache/src/main/resources/hazelcast.xml vendored

@ -14,4 +14,11 @@ @@ -14,4 +14,11 @@
<management-enabled>true</management-enabled>
</cache>
<network>
<join>
<tcp-ip enabled="false"/>
<multicast enabled="false"/>
</join>
</network>
</hazelcast>

Loading…
Cancel
Save