Skip to content

Commit c4bd954

Browse files
authored
[TestKit] Enable nullability for Akka.TestKit.EventFilter.Internal (#7779)
* [TestKit] Enable nullability for Akka.TestKit.EventFilter.Internal * Update API Approval list
1 parent b02a3f6 commit c4bd954

17 files changed

+1085
-1055
lines changed

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveTestKit.DotNet.verified.txt

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -636,43 +636,51 @@ namespace Akka.TestKit.Extensions
636636
}
637637
namespace Akka.TestKit.Internal
638638
{
639+
[System.Runtime.CompilerServices.NullableAttribute(0)]
639640
public class CustomEventFilter : Akka.TestKit.Internal.EventFilterBase
640641
{
641642
public CustomEventFilter(System.Predicate<Akka.Event.LogEvent> predicate) { }
642643
protected override string FilterDescriptiveName { get; }
643644
protected override bool IsMatch(Akka.Event.LogEvent evt) { }
644645
}
646+
[System.Runtime.CompilerServices.NullableAttribute(0)]
645647
public class DebugFilter : Akka.TestKit.Internal.EventFilterBase
646648
{
647649
public DebugFilter(Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher = null, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher = null) { }
648650
protected override string FilterDescriptiveName { get; }
649651
protected override bool IsMatch(Akka.Event.LogEvent evt) { }
650652
}
653+
[System.Runtime.CompilerServices.NullableAttribute(0)]
651654
public class ErrorFilter : Akka.TestKit.Internal.EventFilterBase
652655
{
653656
public ErrorFilter(Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher = null, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher = null) { }
654657
public ErrorFilter(System.Type exceptionType, Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher = null, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher = null, bool recurseInnerExceptions = False) { }
658+
[System.Runtime.CompilerServices.NullableAttribute(1)]
655659
protected override string FilterDescriptiveName { get; }
656660
protected override bool IsMatch(Akka.Event.LogEvent evt) { }
657661
}
662+
[System.Runtime.CompilerServices.NullableAttribute(0)]
658663
public abstract class EventFilterBase : Akka.TestKit.IEventFilter
659664
{
660665
protected EventFilterBase(Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher) { }
661666
protected abstract string FilterDescriptiveName { get; }
667+
[System.Runtime.CompilerServices.NullableAttribute(2)]
662668
public event Akka.TestKit.Internal.EventMatched EventMatched;
663669
public bool Apply(Akka.Event.LogEvent logEvent) { }
664-
protected bool InternalDoMatch(string src, object msg) { }
670+
protected bool InternalDoMatch(string src, [System.Runtime.CompilerServices.NullableAttribute(2)] object msg) { }
665671
protected abstract bool IsMatch(Akka.Event.LogEvent evt);
666672
protected virtual void OnEventMatched(Akka.Event.LogEvent logEvent) { }
667673
public override string ToString() { }
668674
}
669675
public delegate void EventMatched(Akka.TestKit.Internal.EventFilterBase eventFilter, Akka.Event.LogEvent logEvent);
676+
[System.Runtime.CompilerServices.NullableAttribute(0)]
670677
public class InfoFilter : Akka.TestKit.Internal.EventFilterBase
671678
{
672679
public InfoFilter(Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher = null, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher = null) { }
673680
protected override string FilterDescriptiveName { get; }
674681
protected override bool IsMatch(Akka.Event.LogEvent evt) { }
675682
}
683+
[System.Runtime.CompilerServices.NullableAttribute(0)]
676684
public class InternalEventFilterApplier : Akka.TestKit.IEventFilterApplier
677685
{
678686
public InternalEventFilterApplier(Akka.TestKit.TestKitBase testkit, Akka.Actor.ActorSystem system, System.Collections.Generic.IReadOnlyList<Akka.TestKit.Internal.EventFilterBase> filters) { }
@@ -681,32 +689,32 @@ namespace Akka.TestKit.Internal
681689
protected System.Threading.Tasks.Task<bool> AwaitDoneAsync(System.TimeSpan timeout, System.Nullable<int> expectedOccurrences, Akka.TestKit.Internal.InternalEventFilterApplier.MatchedEventHandler matchedEventHandler, System.Threading.CancellationToken cancellationToken = null) { }
682690
public void Expect(int expectedCount, System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
683691
public void Expect(int expectedCount, System.TimeSpan timeout, System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
684-
public T Expect<T>(int expectedCount, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
685-
public T Expect<T>(int expectedCount, System.TimeSpan timeout, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
692+
public T Expect<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(int expectedCount, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
693+
public T Expect<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(int expectedCount, System.TimeSpan timeout, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
686694
public System.Threading.Tasks.Task ExpectAsync(int expectedCount, System.Func<System.Threading.Tasks.Task> actionAsync, System.Threading.CancellationToken cancellationToken = null) { }
687695
public System.Threading.Tasks.Task ExpectAsync(int expectedCount, System.Func<System.Threading.Tasks.Task> actionAsync, System.Nullable<System.TimeSpan> timeout, System.Threading.CancellationToken cancellationToken = null) { }
688696
public System.Threading.Tasks.Task ExpectAsync(int expectedCount, System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task> action, System.Threading.CancellationToken cancellationToken = null) { }
689697
public System.Threading.Tasks.Task ExpectAsync(int expectedCount, System.TimeSpan timeout, System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
690-
public System.Threading.Tasks.Task<T> ExpectAsync<T>(int expectedCount, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
691-
public System.Threading.Tasks.Task<T> ExpectAsync<T>(int expectedCount, System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
698+
public System.Threading.Tasks.Task<T> ExpectAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(int expectedCount, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
699+
public System.Threading.Tasks.Task<T> ExpectAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(int expectedCount, System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
692700
public void ExpectOne(System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
693701
public void ExpectOne(System.TimeSpan timeout, System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
694-
public T ExpectOne<T>(System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
695-
public T ExpectOne<T>(System.TimeSpan timeout, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
702+
public T ExpectOne<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
703+
public T ExpectOne<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.TimeSpan timeout, System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
696704
[System.ObsoleteAttribute("Only for backwards compat. Use ExpectOneAsync(Func<Task>, CancellationToken) inst" +
697705
"ead beginning in Akka.NET v1.5")]
698706
public System.Threading.Tasks.Task ExpectOneAsync(System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
699707
public System.Threading.Tasks.Task ExpectOneAsync(System.Func<System.Threading.Tasks.Task> action, System.Threading.CancellationToken cancellationToken = null) { }
700708
public System.Threading.Tasks.Task ExpectOneAsync(System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task> action, System.Threading.CancellationToken cancellationToken = null) { }
701-
public System.Threading.Tasks.Task<T> ExpectOneAsync<T>(System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
702-
public System.Threading.Tasks.Task<T> ExpectOneAsync<T>(System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
709+
public System.Threading.Tasks.Task<T> ExpectOneAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
710+
public System.Threading.Tasks.Task<T> ExpectOneAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.TimeSpan timeout, System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
703711
protected static string GetMessageString(int number) { }
704-
protected T Intercept<T>(System.Func<T> func, Akka.Actor.ActorSystem system, System.Nullable<System.TimeSpan> timeout, System.Nullable<int> expectedOccurrences, Akka.TestKit.Internal.InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, System.Threading.CancellationToken cancellationToken = null) { }
705-
protected System.Threading.Tasks.Task<T> InterceptAsync<T>(System.Func<System.Threading.Tasks.Task<T>> func, Akka.Actor.ActorSystem system, System.Nullable<System.TimeSpan> timeout, System.Nullable<int> expectedOccurrences, Akka.TestKit.Internal.InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, System.Threading.CancellationToken cancellationToken = null) { }
706-
public T Mute<T>(System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
712+
protected T Intercept<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<T> func, Akka.Actor.ActorSystem system, System.Nullable<System.TimeSpan> timeout, System.Nullable<int> expectedOccurrences, [System.Runtime.CompilerServices.NullableAttribute(2)] Akka.TestKit.Internal.InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, System.Threading.CancellationToken cancellationToken = null) { }
713+
protected System.Threading.Tasks.Task<T> InterceptAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<System.Threading.Tasks.Task<T>> func, Akka.Actor.ActorSystem system, System.Nullable<System.TimeSpan> timeout, System.Nullable<int> expectedOccurrences, [System.Runtime.CompilerServices.NullableAttribute(2)] Akka.TestKit.Internal.InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, System.Threading.CancellationToken cancellationToken = null) { }
714+
public T Mute<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<T> func, System.Threading.CancellationToken cancellationToken = null) { }
707715
public void Mute(System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
708716
public Akka.TestKit.IUnmutableFilter Mute() { }
709-
public System.Threading.Tasks.Task<T> MuteAsync<T>(System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
717+
public System.Threading.Tasks.Task<T> MuteAsync<[System.Runtime.CompilerServices.NullableAttribute(2)] T>(System.Func<System.Threading.Tasks.Task<T>> func, System.Threading.CancellationToken cancellationToken = null) { }
710718
public System.Threading.Tasks.Task MuteAsync(System.Func<System.Threading.Tasks.Task> action, System.Threading.CancellationToken cancellationToken = null) { }
711719
public System.Threading.Tasks.Task MuteAsync(System.Action action, System.Threading.CancellationToken cancellationToken = null) { }
712720
protected class InternalUnmutableFilter : Akka.TestKit.IUnmutableFilter, System.IDisposable
@@ -763,6 +771,7 @@ namespace Akka.TestKit.Internal
763771
public static bool IsZero(this System.Nullable<System.TimeSpan> timeSpan) { }
764772
public static System.TimeSpan Min(this System.TimeSpan a, System.Nullable<System.TimeSpan> b) { }
765773
}
774+
[System.Runtime.CompilerServices.NullableAttribute(0)]
766775
public class WarningFilter : Akka.TestKit.Internal.EventFilterBase
767776
{
768777
public WarningFilter(Akka.TestKit.Internal.StringMatcher.IStringMatcher messageMatcher = null, Akka.TestKit.Internal.StringMatcher.IStringMatcher sourceMatcher = null) { }
@@ -772,18 +781,21 @@ namespace Akka.TestKit.Internal
772781
}
773782
namespace Akka.TestKit.Internal.StringMatcher
774783
{
784+
[System.Runtime.CompilerServices.NullableAttribute(0)]
775785
public class ContainsString : Akka.TestKit.Internal.StringMatcher.IStringMatcher
776786
{
777787
public ContainsString(string part) { }
778788
public bool IsMatch(string s) { }
779789
public override string ToString() { }
780790
}
791+
[System.Runtime.CompilerServices.NullableAttribute(0)]
781792
public class EqualsString : Akka.TestKit.Internal.StringMatcher.IStringMatcher
782793
{
783794
public EqualsString(string s) { }
784795
public bool IsMatch(string s) { }
785796
public override string ToString() { }
786797
}
798+
[System.Runtime.CompilerServices.NullableAttribute(0)]
787799
public class EqualsStringAndPathMatcher : Akka.TestKit.Internal.StringMatcher.IStringMatcher
788800
{
789801
public EqualsStringAndPathMatcher(string path, bool canBeRelative = True) { }
@@ -794,24 +806,28 @@ namespace Akka.TestKit.Internal.StringMatcher
794806
{
795807
bool IsMatch(string s);
796808
}
809+
[System.Runtime.CompilerServices.NullableAttribute(0)]
797810
public class MatchesAll : Akka.TestKit.Internal.StringMatcher.IStringMatcher
798811
{
799812
public static Akka.TestKit.Internal.StringMatcher.IStringMatcher Instance { get; }
800813
public bool IsMatch(string s) { }
801814
public override string ToString() { }
802815
}
816+
[System.Runtime.CompilerServices.NullableAttribute(0)]
803817
public class PredicateMatcher : Akka.TestKit.Internal.StringMatcher.IStringMatcher
804818
{
805819
public PredicateMatcher(System.Predicate<string> predicate, string hint = "") { }
806820
public bool IsMatch(string s) { }
807821
public override string ToString() { }
808822
}
823+
[System.Runtime.CompilerServices.NullableAttribute(0)]
809824
public class RegexMatcher : Akka.TestKit.Internal.StringMatcher.IStringMatcher
810825
{
811826
public RegexMatcher(System.Text.RegularExpressions.Regex regex) { }
812827
public bool IsMatch(string s) { }
813828
public override string ToString() { }
814829
}
830+
[System.Runtime.CompilerServices.NullableAttribute(0)]
815831
public class StartsWithString : Akka.TestKit.Internal.StringMatcher.IStringMatcher
816832
{
817833
public StartsWithString(string start) { }

0 commit comments

Comments
 (0)