@Override public Log getLog( String name ) { return NullLog.getInstance(); } }
@Override public Log getLog( Class loggingClass ) { return NullLog.getInstance(); }
public OnDemandDetailsExecutionMonitor( PrintStream out, InputStream in, Monitor monitor, JobScheduler jobScheduler ) { this.out = out; this.in = in; this.monitor = monitor; this.actions.put( "i", Pair.of( "Print more detailed information", this::printDetails ) ); this.actions.put( "c", Pair.of( "Print more detailed information about current stage", this::printDetailsForCurrentStage ) ); this.vmPauseMonitor = new VmPauseMonitor( Duration.ofMillis( 100 ), Duration.ofMillis( 100 ), NullLog.getInstance(), jobScheduler, vmPauseTimeAccumulator ); }
private static PageCache getOrCreatePageCache( Config config, FileSystemAbstraction fs, JobScheduler jobScheduler ) { Log log = NullLog.getInstance(); ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory( fs, config, NULL, PageCursorTracerSupplier.NULL, log, EmptyVersionContextSupplier.EMPTY, jobScheduler ); return pageCacheFactory.getOrCreatePageCache(); } }
private static TransactionStateMachineV1SPI createTxSpi( Supplier<TransactionIdStore> txIdStore, Duration txAwaitDuration, Clock clock ) { DatabaseAvailabilityGuard databaseAvailabilityGuard = new DatabaseAvailabilityGuard( DEFAULT_DATABASE_NAME, clock, NullLog.getInstance() ); return createTxSpi( txIdStore, txAwaitDuration, databaseAvailabilityGuard, clock ); }
@Before public void setUp() { databaseAvailabilityGuard = new DatabaseAvailabilityGuard( DEFAULT_DATABASE_NAME, clock, NullLog.getInstance() ); }
private static DatabaseHealth getDatabaseHealth() { DatabasePanicEventGenerator databasePanicEventGenerator = new DatabasePanicEventGenerator( new KernelEventHandlers( NullLog.getInstance() ) ); return new DatabaseHealth( databasePanicEventGenerator, NullLog.getInstance() ); }
@Test public void shouldNotPropagateExceptionCaught() throws Exception { ChannelInboundHandler next = mock( ChannelInboundHandler.class ); BoltConnection connection = mock( BoltConnection.class ); channel = new EmbeddedChannel( new HouseKeeper( connection, NullLog.getInstance() ), next ); channel.pipeline().fireExceptionCaught( new RuntimeException( "some exception" ) ); verify( next, never() ).exceptionCaught( any(), any() ); }
@Test public void shouldNotPropagateChannelInactive() throws Exception { ChannelInboundHandler next = mock( ChannelInboundHandler.class ); BoltConnection connection = mock( BoltConnection.class ); channel = new EmbeddedChannel( new HouseKeeper( connection, NullLog.getInstance() ), next ); channel.pipeline().fireChannelInactive(); verify( next, never() ).channelInactive( any() ); }
@Test public void shouldStopConnectionOnExceptionCaught() { BoltConnection connection = mock( BoltConnection.class ); channel = new EmbeddedChannel( new HouseKeeper( connection, NullLog.getInstance() ) ); channel.pipeline().fireExceptionCaught( new RuntimeException( "some exception" ) ); verify( connection ).stop(); }
@Test public void givenAccessGuardWithConditionWhenShutdownThenInstantlyDenyAccess() { // Given Clock clock = Mockito.mock( Clock.class ); final DatabaseAvailabilityGuard databaseAvailabilityGuard = getDatabaseAvailabilityGuard( clock, NullLog.getInstance() ); databaseAvailabilityGuard.require( REQUIREMENT_1 ); // When databaseAvailabilityGuard.shutdown(); // Then assertFalse( databaseAvailabilityGuard.isAvailable( 1000 ) ); verifyZeroInteractions( clock ); }
@Test public void testNoMigration() { assertThat( migrator.apply( stringMap( "foo", "bar" ), NullLog.getInstance() ), equalTo( stringMap( "foo", "bar" ) ) ); logProvider.assertNoLoggingOccurred(); }
@Test public void shouldStopConnectionOnChannelInactive() { BoltConnection connection = mock( BoltConnection.class ); channel = new EmbeddedChannel( new HouseKeeper( connection, NullLog.getInstance() ) ); channel.pipeline().fireChannelInactive(); verify( connection ).stop(); }
@Before public void setUp() { components = new ComponentRegistry(); procedureCompiler = new ReflectiveProcedureCompiler( new TypeMappers(), components, components, NullLog.getInstance(), ProcedureConfig.DEFAULT ); }
@Before public void setUp() { components = new ComponentRegistry(); procedureCompiler = new ReflectiveProcedureCompiler( new TypeMappers(), components, components, NullLog.getInstance(), ProcedureConfig.DEFAULT ); }
@Before public void setUp() { components = new ComponentRegistry(); procedureCompiler = new ReflectiveProcedureCompiler( new TypeMappers(), components, components, NullLog.getInstance(), ProcedureConfig.DEFAULT ); }
@Test public void shouldLoadWhiteListedFunction() throws Throwable { // Given procedureCompiler = new ReflectiveProcedureCompiler( new TypeMappers(), components, new ComponentRegistry(), NullLog.getInstance(), new ProcedureConfig( Config.defaults( GraphDatabaseSettings.procedure_whitelist, "org.neo4j.kernel.impl.proc.listCoolPeople" ) ) ); CallableUserFunction method = compile( SingleReadOnlyFunction.class ).get( 0 ); // Expect Object out = method.apply( new BasicContext(), new AnyValue[0] ); assertThat(out, equalTo( ValueUtils.of( Arrays.asList("Bonnie", "Clyde") ) ) ); }
private List<CallableProcedure> compile( Class<?> clazz ) throws KernelException { return new ReflectiveProcedureCompiler( new TypeMappers(), new ComponentRegistry(), new ComponentRegistry(), NullLog.getInstance(), ProcedureConfig.DEFAULT ).compileProcedure( clazz, null, true ); } }
@Test public void shouldReturnEmptySetOnNullArgument() throws Exception { // given ProcedureJarLoader jarloader = new ProcedureJarLoader( new ReflectiveProcedureCompiler( new TypeMappers(), new ComponentRegistry(), registryWithUnsafeAPI(), log, procedureConfig() ), NullLog.getInstance() ); // when ProcedureJarLoader.Callables callables = jarloader.loadProceduresFromDir( null ); // then assertEquals( 0, callables.procedures().size() + callables.functions().size() ); }
@Test( expected = IllegalArgumentException.class ) public void mustThrowIfConfiguredPageSwapperCannotBeFound() { // Given Config config = Config.defaults( stringMap( pagecache_memory.name(), "8m", pagecache_swapper.name(), "non-existing" ) ); // When new ConfiguringPageCacheFactory( fsRule.get(), config, PageCacheTracer.NULL, PageCursorTracerSupplier.NULL, NullLog.getInstance(), EmptyVersionContextSupplier.EMPTY, jobScheduler ).getOrCreatePageCache().close(); } }