use of org.neo4j.kernel.impl.core.DatabasePanicEventGenerator in project neo4j by neo4j.
the class DatabaseHealthTest method shouldGenerateKernelPanicEvents.
@Test
public void shouldGenerateKernelPanicEvents() throws Exception {
// GIVEN
DatabasePanicEventGenerator generator = mock(DatabasePanicEventGenerator.class);
DatabaseHealth databaseHealth = new DatabaseHealth(generator, NullLogProvider.getInstance().getLog(DatabaseHealth.class));
databaseHealth.healed();
// WHEN
Exception cause = new Exception("My own fault");
databaseHealth.panic(cause);
databaseHealth.panic(cause);
// THEN
verify(generator, times(1)).generateEvent(TX_MANAGER_NOT_OK, cause);
}
use of org.neo4j.kernel.impl.core.DatabasePanicEventGenerator in project neo4j by neo4j.
the class Runner method createBatchingTransactionAppender.
private BatchingTransactionAppender createBatchingTransactionAppender(TransactionIdStore transactionIdStore, TransactionMetadataCache transactionMetadataCache, LogFile logFile) {
Log log = NullLog.getInstance();
KernelEventHandlers kernelEventHandlers = new KernelEventHandlers(log);
DatabasePanicEventGenerator panicEventGenerator = new DatabasePanicEventGenerator(kernelEventHandlers);
DatabaseHealth databaseHealth = new DatabaseHealth(panicEventGenerator, log);
LogRotationImpl logRotation = new LogRotationImpl(NOOP_LOGROTATION_MONITOR, logFile, databaseHealth);
return new BatchingTransactionAppender(logFile, logRotation, transactionMetadataCache, transactionIdStore, IdOrderingQueue.BYPASS, databaseHealth);
}
Aggregations