Skip to content

Commit

Permalink
Terracotta-OSS#191: Failover Galvan tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Dec 16, 2016
1 parent 6c395cc commit 0a69901
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.terracotta.management.integration.tests;

import org.junit.Ignore;
import org.junit.Test;
import org.terracotta.management.model.cluster.Cluster;
import org.terracotta.management.model.cluster.Server;
Expand All @@ -32,7 +31,6 @@
/**
* @author Mathieu Carbou
*/
@Ignore // TODO activate
public class FailoverIT extends AbstractHATest {

@Test
Expand All @@ -47,16 +45,22 @@ public void failover_management() throws Exception {
tmsAgentService.readMessages();

// kill active - passive should take the active role
System.out.printf("==> terminateActive()");
voltron.getClusterControl().terminateActive();
System.out.printf("==> waitForActive()");
voltron.getClusterControl().waitForActive();

System.out.printf("==> readTopology()");
cluster = tmsAgentService.readTopology();
Server newActive = cluster.serverStream().filter(Server::isActive).findFirst().get();
assertThat(newActive.getState(), equalTo(Server.State.ACTIVE));
assertThat(newActive.getServerName(), equalTo(passive.getServerName()));

// read messages
List<Message> messages = tmsAgentService.readMessages();

messages.forEach(System.out::println);

assertThat(messages.size(), equalTo(3));

List<ContextualNotification> notifs = messages.stream()
Expand Down

0 comments on commit 0a69901

Please sign in to comment.