Skip to main content

MockContainerRuntimeFactory Class

Factory to create MockContainerRuntime for testing basic submitting and processing of messages. This also acts as a very basic server that stores the messages from all the MockContainerRuntimes and processes them when asked. If test specific logic is required, extend this class and add the logic there. For an example, take a look at MockContainerRuntimeFactoryForReconnection.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/test-runtime-utils/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class MockContainerRuntimeFactory

Constructors

Constructor Alerts Description
(constructor)(mockContainerRuntimeOptions) Alpha Constructs a new instance of the MockContainerRuntimeFactory class

Properties

Property Alerts Modifiers Type Description
lastProcessedMessage Alpha ISequencedDocumentMessage | undefined
messages Alpha ISequencedDocumentMessage[] The MockContainerRuntimes we produce will push messages into this queue as they are submitted. This is playing the role of the orderer, establishing a single universal order for the messages generated. They are held in this queue until we explicitly choose to process them, at which time they are "broadcast" to each of the runtimes.
minSeq Alpha Map<string, number>
outstandingMessageCount Alpha readonly number
quorum Alpha readonly MockQuorumClients
runtimeOptions Alpha readonly Required<IMockContainerRuntimeOptions>

The container runtime options which will be provided to the all runtimes created by this factory and also drive the way the ops are processed.

See IMockContainerRuntimeOptions

runtimes Alpha readonly Set<MockContainerRuntime>
sequenceNumber Alpha number

Constructor Details

(constructor)

Constructs a new instance of the MockContainerRuntimeFactory class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

constructor(mockContainerRuntimeOptions?: IMockContainerRuntimeOptions);

Parameters

Parameter Modifiers Type Description
mockContainerRuntimeOptions optional IMockContainerRuntimeOptions

Property Details

lastProcessedMessage

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected lastProcessedMessage: ISequencedDocumentMessage | undefined;

Type: ISequencedDocumentMessage | undefined

messages

The MockContainerRuntimes we produce will push messages into this queue as they are submitted. This is playing the role of the orderer, establishing a single universal order for the messages generated. They are held in this queue until we explicitly choose to process them, at which time they are "broadcast" to each of the runtimes.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected messages: ISequencedDocumentMessage[];

Type: ISequencedDocumentMessage[]

minSeq

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

minSeq: Map<string, number>;

Type: Map<string, number>

outstandingMessageCount

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

get outstandingMessageCount(): number;

Type: number

quorum

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly quorum: MockQuorumClients;

Type: MockQuorumClients

runtimeOptions

The container runtime options which will be provided to the all runtimes created by this factory and also drive the way the ops are processed.

See IMockContainerRuntimeOptions

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly runtimeOptions: Required<IMockContainerRuntimeOptions>;

Type: Required<IMockContainerRuntimeOptions>

runtimes

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly runtimes: Set<MockContainerRuntime>;

Type: Set<MockContainerRuntime>

sequenceNumber

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

sequenceNumber: number;

Type: number