Search in sources :

Example 96 with AssertableLogProvider

use of org.neo4j.logging.AssertableLogProvider in project neo4j by neo4j.

the class DefaultFileDeletionEventListenerTest method noNotificationAboutAnotherDatabaseDirectoryRemoval.

@Test
void noNotificationAboutAnotherDatabaseDirectoryRemoval() {
    AssertableLogProvider internalLogProvider = new AssertableLogProvider(false);
    DefaultFileDeletionEventListener listener = buildListener(internalLogProvider);
    listener.fileDeleted(databaseRootKey, "foo");
    assertThat(internalLogProvider).doesNotHaveAnyLogs();
}
Also used : AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.jupiter.api.Test)

Example 97 with AssertableLogProvider

use of org.neo4j.logging.AssertableLogProvider in project neo4j by neo4j.

the class DefaultFileDeletionEventListenerTest method notificationInLogAboutFileDeletion.

@Test
void notificationInLogAboutFileDeletion() {
    AssertableLogProvider internalLogProvider = new AssertableLogProvider(false);
    DefaultFileDeletionEventListener listener = buildListener(internalLogProvider);
    listener.fileDeleted(databaseDirKey, "testFile");
    listener.fileDeleted(databaseDirKey, "anotherDirectory");
    var databaseName = databaseLayout.getDatabaseName();
    assertThat(internalLogProvider).containsMessages("'testFile' which belongs to the '" + databaseName + "' database was deleted while it was running.", "'anotherDirectory' which belongs to the '" + databaseName + "' database was deleted while it was running.");
}
Also used : AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.jupiter.api.Test)

Example 98 with AssertableLogProvider

use of org.neo4j.logging.AssertableLogProvider in project neo4j by neo4j.

the class DefaultFileDeletionEventListenerTest method notificationAboutAnotherDatabaseLogsDirectoryRemoval.

@Test
void notificationAboutAnotherDatabaseLogsDirectoryRemoval() {
    AssertableLogProvider internalLogProvider = new AssertableLogProvider(false);
    DefaultFileDeletionEventListener listener = buildListener(internalLogProvider);
    listener.fileDeleted(databaseLogsRootKey, "bar");
    assertThat(internalLogProvider).doesNotHaveAnyLogs();
}
Also used : AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.jupiter.api.Test)

Example 99 with AssertableLogProvider

use of org.neo4j.logging.AssertableLogProvider in project neo4j by neo4j.

the class DefaultFileDeletionEventListenerTest method notificationAboutLogsDirectoryRemoval.

@Test
void notificationAboutLogsDirectoryRemoval() {
    AssertableLogProvider internalLogProvider = new AssertableLogProvider(false);
    DefaultFileDeletionEventListener listener = buildListener(internalLogProvider);
    String databaseName = databaseLayout.getDatabaseName();
    listener.fileDeleted(databaseLogsRootKey, databaseName);
    assertThat(internalLogProvider).containsMessages("'" + databaseName + "' which belongs to the '" + databaseName + "' database was deleted while it was running.");
}
Also used : AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.jupiter.api.Test)

Example 100 with AssertableLogProvider

use of org.neo4j.logging.AssertableLogProvider in project neo4j by neo4j.

the class DefaultFileDeletionEventListenerTest method notificationAboutDatabaseDirectoryRemoval.

@Test
void notificationAboutDatabaseDirectoryRemoval() {
    AssertableLogProvider internalLogProvider = new AssertableLogProvider(false);
    DefaultFileDeletionEventListener listener = buildListener(internalLogProvider);
    String databaseName = databaseLayout.getDatabaseName();
    listener.fileDeleted(databaseRootKey, databaseName);
    assertThat(internalLogProvider).containsMessages("'" + databaseName + "' which belongs to the '" + databaseName + "' database was deleted while it was running.");
}
Also used : AssertableLogProvider(org.neo4j.logging.AssertableLogProvider) Test(org.junit.jupiter.api.Test)

Aggregations

AssertableLogProvider (org.neo4j.logging.AssertableLogProvider)202 Test (org.junit.jupiter.api.Test)98 Test (org.junit.Test)63 Path (java.nio.file.Path)29 Log (org.neo4j.logging.Log)24 FakeClock (org.neo4j.time.FakeClock)20 SslPolicyConfig (org.neo4j.configuration.ssl.SslPolicyConfig)14 IOException (java.io.IOException)13 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)13 DynamicTest (org.junit.jupiter.api.DynamicTest)12 DynamicTest.dynamicTest (org.junit.jupiter.api.DynamicTest.dynamicTest)12 SocketAddress (org.neo4j.configuration.helpers.SocketAddress)11 NullLog (org.neo4j.logging.NullLog)11 TestDatabaseManagementServiceBuilder (org.neo4j.test.TestDatabaseManagementServiceBuilder)10 BeforeEach (org.junit.jupiter.api.BeforeEach)9 ExecutingQuery (org.neo4j.kernel.api.query.ExecutingQuery)9 QueryLogger (org.neo4j.kernel.impl.query.QueryLoggerKernelExtension.QueryLogger)9 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)8 ServerSocket (java.net.ServerSocket)8 Before (org.junit.Before)8