Commit 2b8bc3fb by Dennis Schulte

Fix HazelcastTest with proper network-config for CI

parent c8a27d08
......@@ -31,6 +31,11 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</dependency>
......
......@@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
......@@ -51,6 +52,7 @@ public class AdminApplicationHazelcastTest {
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
@ImportResource("classpath:hazelcast-test.xml")
public static class TestAdminApplication {
}
......@@ -59,11 +61,12 @@ public class AdminApplicationHazelcastTest {
private EmbeddedWebApplicationContext instance2;
@Before
public void setup() {
public void setup() throws InterruptedException {
System.setProperty("hazelcast.wait.seconds.before.join", "0");
instance1 = (EmbeddedWebApplicationContext) SpringApplication.run(TestAdminApplication.class, new String[] {
"--server.port=0", "--spring.jmx.enabled=false" });
"--server.port=0", "--spring.jmx.enabled=false", "--spring.boot.admin.hazelcast.enable=true" });
instance2 = (EmbeddedWebApplicationContext) SpringApplication.run(TestAdminApplication.class, new String[] {
"--server.port=0", "--spring.jmx.enabled=false" });
"--server.port=0", "--spring.jmx.enabled=false", "--spring.boot.admin.hazelcast.enable=true" });
}
@After
......@@ -73,7 +76,6 @@ public class AdminApplicationHazelcastTest {
}
@Test
@Ignore("Testcase does not work properly in all environments, so it's ignored in the build.")
public void test() {
Application app = new Application("http://127.0.0.1", "Hazelcast Test");
Application app2 = new Application("http://127.0.0.1:2", "Hazelcast Test");
......
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hz="http://www.hazelcast.com/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.hazelcast.com/schema/spring
http://www.hazelcast.com/schema/spring/hazelcast-spring-3.3.xsd">
<hz:config id="hazelcastConfig">
<hz:network port="5701">
<hz:join>
<hz:multicast enabled="false"/>
<hz:tcp-ip enabled="true">
<hz:member>localhost</hz:member>
</hz:tcp-ip>
</hz:join>
</hz:network>
</hz:config>
</beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment