Search in sources :

Example 1 with CoreState

use of org.neo4j.causalclustering.core.state.CoreState in project neo4j by neo4j.

the class ConnectionInfoIT method catchupServerMessage.

@Test
public void catchupServerMessage() throws Throwable {
    // given
    testSocket = bindPort("localhost", 4242);
    // when
    AssertableLogProvider logProvider = new AssertableLogProvider();
    AssertableLogProvider userLogProvider = new AssertableLogProvider();
    CoreState coreState = mock(CoreState.class);
    Config config = Config.defaults().with(singletonMap(transaction_listen_address.name(), ":" + testSocket.getLocalPort()));
    CatchupServer catchupServer = new CatchupServer(logProvider, userLogProvider, mockSupplier(), mockSupplier(), mockSupplier(), mockSupplier(), mock(BooleanSupplier.class), coreState, config, new Monitors(), mockSupplier(), mock(FileSystemAbstraction.class), mock(PageCache.class), new StoreCopyCheckPointMutex());
    //then
    try {
        catchupServer.start();
    } catch (Throwable throwable) {
    //expected.
    }
    logProvider.assertContainsMessageContaining("Address is already bound for setting");
    userLogProvider.assertContainsMessageContaining("Address is already bound for setting");
}
Also used : CatchupServer(org.neo4j.causalclustering.catchup.CatchupServer) CoreState(org.neo4j.causalclustering.core.state.CoreState) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) Config(org.neo4j.kernel.configuration.Config) Monitors(org.neo4j.kernel.monitoring.Monitors) StoreCopyCheckPointMutex(org.neo4j.kernel.impl.transaction.log.checkpoint.StoreCopyCheckPointMutex) BooleanSupplier(java.util.function.BooleanSupplier) PageCache(org.neo4j.io.pagecache.PageCache) AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.Test)

Aggregations

BooleanSupplier (java.util.function.BooleanSupplier)1 Test (org.junit.Test)1 CatchupServer (org.neo4j.causalclustering.catchup.CatchupServer)1 CoreState (org.neo4j.causalclustering.core.state.CoreState)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 PageCache (org.neo4j.io.pagecache.PageCache)1 Config (org.neo4j.kernel.configuration.Config)1 StoreCopyCheckPointMutex (org.neo4j.kernel.impl.transaction.log.checkpoint.StoreCopyCheckPointMutex)1 Monitors (org.neo4j.kernel.monitoring.Monitors)1 AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)1