Show / Hide Table of Contents

# Class MockTransport

Transport used for testing, mimics the behaviour of a normal Transport and allows messages to be sent and received

##### Inheritance

System.Object
MockTransport

##### Implements

ITransport
Apache.NMS.IStartable
System.IDisposable
Apache.NMS.IStoppable

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Apache.NMS.ActiveMQ.Transport.Mock

###### Assembly: Apache.NMS.ActiveMQ.dll

##### Syntax

    public class MockTransport : ITransport, IStartable, IDisposable, IStoppable

### Constructors

| Improve this Doc View Source

#### MockTransport(Uri)

##### Declaration

    public MockTransport(Uri uri)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Uri | uri |

### Properties

| Improve this Doc View Source

#### AsyncTimeout

Timeout in milliseconds to wait for sending asynchronous messages or commands. Set to -1 for infinite timeout.

##### Declaration

    public int AsyncTimeout { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### Command

##### Declaration

    public CommandHandler Command { get; set; }

##### Property Value

Type | Description
--- | ---
CommandHandler |

| Improve this Doc View Source

#### Exception

##### Declaration

    public ExceptionHandler Exception { get; set; }

##### Property Value

Type | Description
--- | ---
ExceptionHandler |

| Improve this Doc View Source

#### FailOnKeepAliveInfoSends

##### Declaration

    public bool FailOnKeepAliveInfoSends { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### FailOnReceiveMessage

##### Declaration

    public bool FailOnReceiveMessage { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### FailOnSendMessage

##### Declaration

    public bool FailOnSendMessage { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### Interrupted

##### Declaration

    public InterruptedHandler Interrupted { get; set; }

##### Property Value

Type | Description
--- | ---
InterruptedHandler |

| Improve this Doc View Source

#### IsConnected

##### Declaration

    public bool IsConnected { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsDisposed

##### Declaration

    public bool IsDisposed { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsFaultTolerant

##### Declaration

    public bool IsFaultTolerant { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsReconnectSupported

##### Declaration

    public bool IsReconnectSupported { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsStarted

##### Declaration

    public bool IsStarted { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsUpdateURIsSupported

##### Declaration

    public bool IsUpdateURIsSupported { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### Name

##### Declaration

    public string Name { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### NumMessagesRespondedTo

##### Declaration

    public int NumMessagesRespondedTo { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumMessagesToRespondTo

##### Declaration

    public int NumMessagesToRespondTo { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumReceivedMessages

##### Declaration

    public int NumReceivedMessages { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumReceivedMessagesBeforeFail

##### Declaration

    public int NumReceivedMessagesBeforeFail { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumSentKeepAliveInfosBeforeFail

##### Declaration

    public int NumSentKeepAliveInfosBeforeFail { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumSentKeppAliveInfos

##### Declaration

    public int NumSentKeppAliveInfos { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumSentMessages

##### Declaration

    public int NumSentMessages { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### NumSentMessagesBeforeFail

##### Declaration

    public int NumSentMessagesBeforeFail { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### OutgoingCommand

##### Declaration

    public CommandHandler OutgoingCommand { get; set; }

##### Property Value

Type | Description
--- | ---
CommandHandler |

| Improve this Doc View Source

#### RemoteAddress

##### Declaration

    public Uri RemoteAddress { get; }

##### Property Value

Type | Description
--- | ---
System.Uri |

| Improve this Doc View Source

#### RespondToMessages

##### Declaration

    public bool RespondToMessages { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### Resumed

##### Declaration

    public ResumedHandler Resumed { get; set; }

##### Property Value

Type | Description
--- | ---
ResumedHandler |

| Improve this Doc View Source

#### Timeout

Timeout in milliseconds to wait for sending synchronous messages or commands. Set to -1 for infinite timeout.

##### Declaration

    public int Timeout { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### WireFormat

##### Declaration

    public IWireFormat WireFormat { get; }

##### Property Value

Type | Description
--- | ---
IWireFormat |

### Methods

| Improve this Doc View Source

#### AsyncRequest(Command)

##### Declaration

    public FutureResponse AsyncRequest(Command command)

##### Parameters

Type | Name | Description
--- | --- | ---
Command | command |

##### Returns

Type | Description
--- | ---
FutureResponse |

| Improve this Doc View Source

#### Dispose()

##### Declaration

    public void Dispose()

| Improve this Doc View Source

#### Dispose(Boolean)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | disposing |

| Improve this Doc View Source

#### Finalize()

##### Declaration

    protected void Finalize()

| Improve this Doc View Source

#### InjectCommand(Command)

Injects a Command into the Transports inbound message queue, the Commands in the inbound Queue are dispatched to the registered CommnadHandler instance for processing, this simulates receiving a message from an external source, e.g. receiving a new message from the Broker.

##### Declaration

    public void InjectCommand(Command command)

##### Parameters

Type | Name | Description
--- | --- | ---
Command | command | A Command

| Improve this Doc View Source

#### Narrow(Type)

##### Declaration

    public object Narrow(Type type)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Type | type |

##### Returns

Type | Description
--- | ---
System.Object |

| Improve this Doc View Source

#### Oneway(Command)

##### Declaration

    public void Oneway(Command command)

##### Parameters

Type | Name | Description
--- | --- | ---
Command | command |

| Improve this Doc View Source

#### Request(Command)

##### Declaration

    public Response Request(Command command)

##### Parameters

Type | Name | Description
--- | --- | ---
Command | command |

##### Returns

Type | Description
--- | ---
Response |

| Improve this Doc View Source

#### Request(Command, TimeSpan)

##### Declaration

    public Response Request(Command command, TimeSpan timeout)

##### Parameters

Type | Name | Description
--- | --- | ---
Command | command |
System.TimeSpan | timeout |

##### Returns

Type | Description
--- | ---
Response |

| Improve this Doc View Source

#### Start()

##### Declaration

    public void Start()

| Improve this Doc View Source

#### Stop()

##### Declaration

    public void Stop()

| Improve this Doc View Source

#### UpdateURIs(Boolean, Uri[])

##### Declaration

    public void UpdateURIs(bool rebalance, Uri[] updatedURIs)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | rebalance |
System.Uri[] | updatedURIs |

### Implements

ITransport
Apache.NMS.IStartable
System.IDisposable
Apache.NMS.IStoppable