Module |
|
Header |
/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/ClientUnitTest.h |
Include |
#include "ClientUnitTest.h" |
[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Abstract)
class UClientUnitTest : public UProcessUnitTest
Base class for all unit tests depending upon a MinimalClient connecting to a server. The MinimalClient handles creation/cleanup of an entire new UWorld, UNetDriver and UNetConnection, for fast unit testing.
NOTE: See NUTEnum.h, for important flags for configuring unit tests and the minimal client.
In subclasses, implement the unit test within the ExecuteClientUnitTest function (remembering to call parent)
Name | Description | ||
---|---|---|---|
|
AllowedClientActors |
Actors the server is allowed replicate to client (requires AllowActors flag). |
|
|
AllowedClientRPCs |
Clientside RPC's that should be allowed to execute (requires minimal client NotifyProcessNetEvent flag) |
|
|
BaseClientParameters |
The (non-URL) commandline parameters clients should be launched with |
|
|
BaseClientURL |
The base URL clients should start with |
|
|
BaseServerParameters |
The (non-URL) commandline parameters the server should be launched with |
|
|
BaseServerURL |
The base URL the server should start with |
|
|
bBlockingClientDelay |
Whether or not there is a blocking event/process preventing setup of a client |
|
|
bBlockingMinClientDelay |
Whether or not there is a blocking event/process preventing the minimal client from connecting |
|
|
bBlockingServerDelay |
Whether or not there is a blocking event/process preventing setup of the server |
|
|
BeaconAddress |
The address of the server beacon (if UnitTestFlags are set to connect to a beacon) |
|
|
bPendingNetworkFailure |
An expected network failure occurred, which will be handled during the next tick instead of immediately |
|
|
bReceivedPong |
If EUnitTestFlags::RequirePing is true, whether or not we have already received the pong |
|
|
bTriggerredInitialConnect |
Whether or not the initial connect of the minimal client was triggered |
|
|
bUnitNUTActorSetup |
Whether or not UnitNUTActor is fully setup, i.e. has replicated its Owner |
|
|
bUnitPawnSetup |
Whether or not the UnitPC Pawn was fully setup (requires EUnitTestFlags::RequirePawn) |
|
|
bUnitPlayerStateSetup |
Whether or not the UnitPC PlayerState was fully setup (requires EUnitTestFlags::RequirePlayerState) |
|
|
ClientHandle |
Reference to the created client process handling struct (if enabled) |
|
|
UMinimalClient ... |
MinClient |
The object which handles implementation of the minimal client |
|
TSubclassOf< UM... |
MinClientClass |
The class to use for the MinimalClient |
|
MinClientFlags |
Flags for configuring the minimal client - lots of interdependencies between these and UnitTestFlags |
|
|
double |
NextBlockingTimeout |
When a server is launched after a blocking event/process, this delays the launch of any clients, in case of more blockages |
|
ServerAddress |
The address of the launched server |
|
|
ServerBeaconType |
If connecting to a beacon, the beacon type name we are connecting to |
|
|
ServerHandle |
Runtime variables Reference to the created server process handling struct |
|
|
TWeakObjectPtr<... |
UnitBeacon |
If EUnitTestFlags::RequireBeacon is set, stores a reference to the replicated beacon |
|
TWeakObjectPtr<... |
UnitNUTActor |
If EUnitTestFlags::RequireNUTActor is set, stores a reference to the replicated NUTActor |
|
TWeakObjectPtr<... |
UnitPC |
Client state variables Stores a reference to the replicated PlayerController (if set to wait for this), after NotifyHandleClientPlayer |
|
UnitTestFlags |
Variables which should be specified by every subclass (some depending upon flags) All of the internal unit test parameters/flags, for controlling state and execution |
Name | Description | |
---|---|---|
|
UClientUnitTest ( |
Name | Description | ||
---|---|---|---|
|
CleanupMinimalClient() |
Cleans up the minimal client |
|
|
ConnectMinimalClient ( |
Connects a minimal client, to the launched/launching server |
|
|
ConstructClientParameters ( |
Puts together the commandline parameters clients should use, based upon the unit test settings |
|
|
ConstructServerParameters() |
Puts together the commandline parameters the server should use, based upon the unit test settings |
|
|
ExecuteClientUnitTest() |
Interface and hooked events for client unit tests Override this, to implement the client unit test NOTE: Should be called last, in overridden functions IMPORTANT: EndUnitTest should be triggered, upon completion of the unit test (which may be delayed, for many unit tests) |
|
|
GetBeaconAddress() |
Accessor for BeaconAddress |
|
|
const TCHAR ... |
GetGenericExploitFailLog() |
Gets the generic log message that is used to indicate unit test failure |
|
EUnitTestFla... |
GetMetRequirements() |
Returns the requirements flags, that this unit test currently meets |
|
GetNextServerPorts |
Determine the next unique server ports to use - incremented to a new unique number, internally |
|
|
GetServerHandle() |
Accessor for ServerHandle |
|
|
EUnitTestFla... |
GetUnitTestFlags() |
Accessor for UnitTestFlags |
|
HasAllCustomRequirements() |
Optionally, if the 'RequireCustom' flag is set, this returns whether custom conditions have been met. |
|
|
HasAllRequirements ( |
Whether or not all 'requirements' flag conditions have been met |
|
|
NotifyAllowNetActor |
Notification triggered BEFORE a replicated actor has been created (allowing you to block creation, based on class) |
|
|
NotifyAlterMinClient ( |
Gives subclass UnitTest's an opportunity to alter the MinimalClient setup parameters |
|
|
NotifyControlMessage |
Override this, to receive notification of all other non-NMT_NUTControl control messages |
|
|
NotifyHandleClientPlayer ( |
Notification that the local net connections PlayerController has been replicated and is being setup |
|
|
NotifyMinClientConnected() |
Notification from the minimal client, that it has fully connected |
|
|
NotifyNetActor ( |
Override this, to receive notification AFTER an actor channel actor has been created |
|
|
NotifyNetworkFailure ( |
Triggered upon a network connection failure |
|
|
NotifyNUTControl ( |
Override this, to receive notification of NMT_NUTControl messages, from the server |
|
|
NotifyProcessEvent |
Overridable in subclasses - can be used to control/block any script events, other than receiving of RPC's (see NotifyReceiveRPC) |
|
|
NotifyReceivedRawPacket |
If EUnitTestFlags::CaptureReceiveRaw is set, this is triggered for every packet received from the server NOTE: Data is a uint8 array, of size 'NETWORK_MAX_PACKET', and elements can safely be modified |
|
|
NotifyReceiveRPC |
Overridable in subclasses - can be used to control/block receiving of RPC's |
|
|
NotifySendRPC |
Overridable in subclasses - can be used to control/block sending of RPC's |
|
|
NotifySocketSendRawPacket |
Triggered for every packet sent to the server, when LowLevelSend is called. |
|
|
OnRPCFailure() |
Callback for when an RPC send fails on the minimal client |
|
|
ReceivedControlBunch ( |
Bunches received on the control channel. |
|
|
SendGenericExploitFailLog() |
Sends a generic log message to the server, which (if successfully logged) indicates unit test failure. |
|
|
SendNUTControl ( |
Utility functions for use by subclasses Sends an NMT_NUTControl control channel message, for the server NUTActor. |
|
|
SendRPCChecked ( |
See UMinimalClient |
|
|
SendRPCChecked |
See UMinimalClient |
|
|
SendUnitRPCChecked ( |
As above, except executes a static UFunction in the unit test (must be prefixed with UnitTestServer_), on the unit test server, allowing unit tests to define and contain their own 'pseudo'-RPC's. |
|
|
SendUnitRPCChecked ( |
As above, except allows 'UnitTestServer' RPC's to be located in an arbitrary class (e.g. if shared between unit tests), specified as the delegate parameter. |
|
|
SetFlags() |
Sets and validates at compile time, that the specified flags are valid. |
|
|
StartUnitTestClient |
Starts a client process tied to the unit test, and connects to the specified server address |
|
|
StartUnitTestServer() |
Starts the server process for a particular unit test |
|
|
TriggerAutoReconnect() |
Triggers an auto-reconnect (disconnect/reconnect) of the minimal client |
|
|
ValidateUnitFlags ( |
Internal base implementation and utility functions for client unit tests Validates, both at compile time (template params) or at runtime (function params), that the specified flags are valid. |
Name | Description | ||
---|---|---|---|
|
NotifyProcessFinished ( |
Notifies when a running process is detected as having finished/closed NOTE: This will not get called, when ShutdownUnitTestProcess is used, only when a program ends by itself |
|
|
NotifyProcessLog ( |
Interface for process unit tests For implementation in subclasses, for helping to verify success/fail upon completion of unit tests NOTE: Not called again once VerificationState is set WARNING: Be careful when iterating InLogLines in multiple different for loops, if the sequence of detected logs is important |
|
|
NotifyProcessSuspendState ( |
Notifies when the suspend state of a process changes |
|
|
NotifySuspendRequest() |
Notifies that there was a request to suspend/resume the unit test |
|
|
PrintUnitTestProcessErrors ( |
If any errors logs were detected upon ShutdownUnitTestProcess, this is called to print them out |
Name | Description | ||
---|---|---|---|
|
CleanupUnitTest ( |
Cleans up all items needing destruction, and removes the unit test from tracking, before deleting the unit test itself |
|
|
ExecuteUnitTest() |
Executes the main unit test |
|
|
GetCommandContextList ( |
Outputs the list of console command contexts, that this unit test supports (which can include custom contexts in subclasses) |
|
|
GetExpectedLogTypes() |
Returns the type of log entries that this unit expects to output, for setting up log window filters (only needs to return values which affect what tabs are shown) |
|
|
LogComplete() |
Triggered upon unit test completion, for outputting that the unit test has completed - plus other unit test state information |
|
|
NotifyConsoleCommandRequest |
Notifies that there was a request to execute a console command for the unit test, which can occur in a specific context, e.g. for a unit test server, for a local minimal-client (within the unit test), or for a separate unit test client process |
|
|
ResetTimeout |
Resets the unit test timeout code - should be used liberally, within every unit test, when progress is made during execution |
|
|
UnblockEvents ( |
When events that were pending but blocked by a UnitTask, are unblocked, this function triggers them. |
|
|
ValidateUnitTestSettings ( |
Validate that the unit test settings/flags specified for this unit test, are compatible with one another, and that the engine settings/environment, support running the unit test. |
Name | Description | ||
---|---|---|---|
|
IsTickable() |
Must override in subclasses, that need ticking. |
|
|
UnitTick ( |
Main tick function for the unit test |
Name | Description | ||
---|---|---|---|
|
IsConnectionLogSource ( |
Whether or not this log interface is the source of a UNetConnection - used for deciding where to direct, UNetConnection log hooks |
Name |
Description |
---|---|
OnlineBeaconClass |
Static variables Static reference to the OnlineBeaconClient static class |