Search in sources :

Example 21 with AvailabilityGuard

use of org.neo4j.kernel.AvailabilityGuard in project neo4j by neo4j.

the class SlaveLocksClientConcurrentTest method setUp.

@Before
public void setUp() {
    master = mock(Master.class, new LockedOnMasterAnswer());
    lockManager = new ForsetiLockManager(Config.defaults(), Clocks.systemClock(), ResourceTypes.values());
    requestContextFactory = mock(RequestContextFactory.class);
    availabilityGuard = new AvailabilityGuard(Clocks.systemClock(), mock(Log.class));
    when(requestContextFactory.newRequestContext(Mockito.anyInt())).thenReturn(RequestContext.anonymous(1));
}
Also used : Master(org.neo4j.kernel.ha.com.master.Master) ForsetiLockManager(org.neo4j.kernel.impl.enterprise.lock.forseti.ForsetiLockManager) RequestContextFactory(org.neo4j.kernel.ha.com.RequestContextFactory) AvailabilityGuard(org.neo4j.kernel.AvailabilityGuard) Before(org.junit.Before)

Aggregations

AvailabilityGuard (org.neo4j.kernel.AvailabilityGuard)21 Test (org.junit.Test)15 InstanceId (org.neo4j.cluster.InstanceId)8 ObservedClusterMembers (org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers)8 ClusterMemberEvents (org.neo4j.cluster.member.ClusterMemberEvents)7 ClusterMemberListener (org.neo4j.cluster.member.ClusterMemberListener)7 AvailabilityRequirement (org.neo4j.kernel.AvailabilityGuard.AvailabilityRequirement)5 TransactionIdStore (org.neo4j.kernel.impl.transaction.log.TransactionIdStore)5 Master (org.neo4j.kernel.ha.com.master.Master)4 Before (org.junit.Before)3 InOrder (org.mockito.InOrder)2 DependencyResolver (org.neo4j.graphdb.DependencyResolver)2 NeoStoreDataSource (org.neo4j.kernel.NeoStoreDataSource)2 RequestContextFactory (org.neo4j.kernel.ha.com.RequestContextFactory)2 DataSourceManager (org.neo4j.kernel.impl.transaction.state.DataSourceManager)2 Monitors (org.neo4j.kernel.monitoring.Monitors)2 File (java.io.File)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 Duration (java.time.Duration)1