Stop more initiators in LeaderInitiatorTests

JIRA: https://jira.spring.io/browse/INT-4246

**Cherry-pick to master**
This commit is contained in:
Artem Bilan
2017-03-23 11:50:01 -04:00
parent 5ae2edb548
commit b86f90a69b

View File

@@ -29,9 +29,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Lock;
import org.apache.log4j.Level;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.integration.leader.Context;
@@ -39,7 +37,6 @@ import org.springframework.integration.leader.DefaultCandidate;
import org.springframework.integration.leader.event.LeaderEventPublisher;
import org.springframework.integration.support.locks.DefaultLockRegistry;
import org.springframework.integration.support.locks.LockRegistry;
import org.springframework.integration.test.rule.Log4jLevelAdjuster;
/**
* @author Dave Syer
@@ -50,9 +47,6 @@ import org.springframework.integration.test.rule.Log4jLevelAdjuster;
*/
public class LockRegistryLeaderInitiatorTests {
@Rule
public Log4jLevelAdjuster adjuster = new Log4jLevelAdjuster(Level.TRACE, "org.springframework.integration");
private CountDownLatch granted;
private CountDownLatch revoked;
@@ -92,6 +86,7 @@ public class LockRegistryLeaderInitiatorTests {
assertThat(this.initiator.getContext().isLeader(), is(true));
this.initiator.getContext().yield();
assertThat(this.revoked.await(10, TimeUnit.SECONDS), is(true));
this.initiator.stop();
}
@Test
@@ -106,6 +101,7 @@ public class LockRegistryLeaderInitiatorTests {
this.initiator.stop();
assertThat(other.await(10, TimeUnit.SECONDS), is(true));
assertThat(another.getContext().isLeader(), is(true));
another.stop();
}
@Test