From 6b3d78ac099d9db505c766b983f298aad06534ba Mon Sep 17 00:00:00 2001 From: Vedran Pavic Date: Wed, 13 Jun 2018 17:01:57 +0200 Subject: [PATCH] Disable network join in Hazelcast integration tests --- .../session/hazelcast/HazelcastITestUtils.java | 11 ++++++++--- .../web/http/hazelcast-custom-idle-time-map-name.xml | 11 +---------- .../annotation/web/http/hazelcast-custom-map-name.xml | 11 +---------- 3 files changed, 10 insertions(+), 23 deletions(-) rename spring-session/src/{test => integration-test}/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml (82%) rename spring-session/src/{test => integration-test}/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml (82%) diff --git a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java index 119232cd..2bd25f07 100644 --- a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java +++ b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package org.springframework.session.hazelcast; import com.hazelcast.config.Config; import com.hazelcast.config.MapAttributeConfig; import com.hazelcast.config.MapIndexConfig; +import com.hazelcast.config.NetworkConfig; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; @@ -46,8 +47,12 @@ public final class HazelcastITestUtils { Config config = new Config(); - config.getNetworkConfig() - .setPort(port); + NetworkConfig networkConfig = config.getNetworkConfig(); + + networkConfig.setPort(port); + + networkConfig.getJoin() + .getMulticastConfig().setEnabled(false); config.getMapConfig("spring:session:sessions") .addMapAttributeConfig(attributeConfig) diff --git a/spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml b/spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml similarity index 82% rename from spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml rename to spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml index ab14415c..53ef5898 100644 --- a/spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml +++ b/spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml @@ -14,16 +14,7 @@ 0 - - - - 127.0.0.1 - - 127.0.0.1 - - - - + diff --git a/spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml b/spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml similarity index 82% rename from spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml rename to spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml index 919fc2fb..663194d8 100644 --- a/spring-session/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml +++ b/spring-session/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml @@ -14,16 +14,7 @@ 0 - - - - 127.0.0.1 - - 127.0.0.1 - - - - +