From 63a215f73bcc9440860d7b9381dbc753888824ab 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 ++++++++--- .../http/hazelcast-custom-idle-time-map-name.xml | 13 ++----------- .../web/http/hazelcast-custom-map-name.xml | 13 ++----------- 3 files changed, 12 insertions(+), 25 deletions(-) rename spring-session-hazelcast/src/{test => integration-test}/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml (80%) rename spring-session-hazelcast/src/{test => integration-test}/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml (80%) diff --git a/spring-session-hazelcast/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java b/spring-session-hazelcast/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java index e7297022..7b2083ea 100644 --- a/spring-session-hazelcast/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java +++ b/spring-session-hazelcast/src/integration-test/java/org/springframework/session/hazelcast/HazelcastITestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 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(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME) .addMapAttributeConfig(attributeConfig) diff --git a/spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml b/spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml similarity index 80% rename from spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml rename to spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml index 025c9512..7761b74e 100644 --- a/spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml +++ b/spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time-map-name.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.9.xsd"> spring-session-it-test-idle-time-map-name @@ -14,16 +14,7 @@ 0 - - - - 127.0.0.1 - - 127.0.0.1 - - - - + diff --git a/spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml b/spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml similarity index 80% rename from spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml rename to spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml index da0a419a..caeb6358 100644 --- a/spring-session-hazelcast/src/test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml +++ b/spring-session-hazelcast/src/integration-test/resources/org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-map-name.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.9.xsd"> spring-session-it-test-map-name @@ -14,16 +14,7 @@ 0 - - - - 127.0.0.1 - - 127.0.0.1 - - - - +