Search in sources :

Example 1 with SlaveUpdatePuller

use of org.neo4j.kernel.ha.SlaveUpdatePuller in project neo4j by neo4j.

the class UpdatePullerSwitcherTest method setUp.

@Before
public void setUp() {
    @SuppressWarnings("unchecked") DelegateInvocationHandler<UpdatePuller> invocationHandler = mock(DelegateInvocationHandler.class);
    PullerFactory pullerFactory = mock(PullerFactory.class);
    slaveUpdatePuller = mock(SlaveUpdatePuller.class);
    when(pullerFactory.createSlaveUpdatePuller()).thenReturn(slaveUpdatePuller);
    when(invocationHandler.setDelegate(slaveUpdatePuller)).thenReturn(slaveUpdatePuller);
    modeSwitcher = new UpdatePullerSwitcher(invocationHandler, pullerFactory);
}
Also used : MasterUpdatePuller(org.neo4j.kernel.ha.MasterUpdatePuller) UpdatePuller(org.neo4j.kernel.ha.UpdatePuller) SlaveUpdatePuller(org.neo4j.kernel.ha.SlaveUpdatePuller) PullerFactory(org.neo4j.kernel.ha.PullerFactory) SlaveUpdatePuller(org.neo4j.kernel.ha.SlaveUpdatePuller) Before(org.junit.Before)

Example 2 with SlaveUpdatePuller

use of org.neo4j.kernel.ha.SlaveUpdatePuller in project neo4j by neo4j.

the class UpdatePullerSwitcherTest method slaveUpdatePuller.

@Test
public void slaveUpdatePuller() throws Throwable {
    UpdatePuller updatePuller = modeSwitcher.getSlaveImpl();
    assertSame(slaveUpdatePuller, updatePuller);
    verifyZeroInteractions(slaveUpdatePuller);
}
Also used : MasterUpdatePuller(org.neo4j.kernel.ha.MasterUpdatePuller) UpdatePuller(org.neo4j.kernel.ha.UpdatePuller) SlaveUpdatePuller(org.neo4j.kernel.ha.SlaveUpdatePuller) Test(org.junit.Test)

Aggregations

MasterUpdatePuller (org.neo4j.kernel.ha.MasterUpdatePuller)2 SlaveUpdatePuller (org.neo4j.kernel.ha.SlaveUpdatePuller)2 UpdatePuller (org.neo4j.kernel.ha.UpdatePuller)2 Before (org.junit.Before)1 Test (org.junit.Test)1 PullerFactory (org.neo4j.kernel.ha.PullerFactory)1