//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldFlushErrorAndCloseConnectionIfFailedToSchedule() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldFlushErrorAndCloseConnectionIfFailedToSchedule() { // Given BoltConnection connection = NewConnection(); // When RejectedExecutionException error = new RejectedExecutionException("Failed to schedule"); connection.HandleSchedulingError(error); // Then verify(_stateMachine).markFailed(argThat(e => e.status().Equals(Org.Neo4j.Kernel.Api.Exceptions.Status_Request.NoThreadsAvailable))); verify(_stateMachine).close(); verify(_output).flush(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldNotifyListenerOnRotationErrorDuringJobExecution() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ShouldNotifyListenerOnRotationErrorDuringJobExecution() { RotationListener rotationListener = mock(typeof(RotationListener)); Executor executor = mock(typeof(Executor)); RotatingFileOutputStreamSupplier supplier = new RotatingFileOutputStreamSupplier(_fileSystem, _logFile, 10, 0, 10, executor, rotationListener); Stream outputStream = supplier.Get(); RejectedExecutionException exception = new RejectedExecutionException("text exception"); doThrow(exception).when(executor).execute(any(typeof(ThreadStart))); Write(supplier, "A string longer than 10 bytes"); assertThat(supplier.Get(), @is(outputStream)); verify(rotationListener).rotationError(exception, outputStream); }
private Future <Void> handleLoadRejected(string identifier, AudioLoadResultHandler resultHandler, RejectedExecutionException e) { FriendlyException exception = new FriendlyException("Cannot queue loading a track, queue is full.", SUSPICIOUS, e); ExceptionTools.log(log, exception, "queueing item " + identifier); resultHandler.loadFailed(exception); return(ExecutorTools.COMPLETED_VOID); }
public static void CannotInvokeTaskLaterAsEventLoopRejectedIt(this IInternalLogger logger, RejectedExecutionException e) { logger.Warn("Can't invoke task later as EventLoop rejected it", e); }
public virtual void debugRejectedExecutionException(RejectedExecutionException e) { logDebug("045", "RejectedExecutionException while scheduling work", e); }