C# Class Apache.NMS.Test.NMSTestSupport

useful base class for test cases
Show file Open project: ThorTech/apache-nms Class Usage Examples

Protected Properties

Property Type Description
clientId string
idCounter int
passWord string
receiveTimeout System.TimeSpan
testRun int
userName string

Public Methods

Method Description
CreateConnection ( ) : IConnection

Create a new connection to the broker.

CreateConnection ( string newClientId ) : IConnection

Create a new connection to the broker.

CreateDestination ( ISession session, DestinationType type ) : IDestination
CreateDestination ( ISession session, DestinationType type, string name ) : IDestination
CreateDestination ( ISession session, string destinationName ) : IDestination

Create a destination. This will delete an existing destination and re-create it.

GetEnvVar ( string varName, string defaultValue ) : string

Get environment variable value.

GetTestClientId ( ) : string
ReplaceEnvVar ( string srcText ) : string

Replace embedded variable markups with environment variable values. Variable markups are of the following form: ${varname}

ReplaceEnvVar ( string srcText, string varName, string defaultValue ) : string

Replace the variable with environment variable.

SendMessages ( IConnection connection, IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
SendMessages ( IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
SendMessages ( ISession session, IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
ToHex ( long value ) : string

Protected Methods

Method Description
AssertEquals ( IMessage m1, IMessage m2 ) : void
AssertEquals ( IMessage m1, IMessage m2, string message ) : void
AssertEquals ( ITextMessage m1, ITextMessage m2 ) : void
AssertTextMessageEqual ( ITextMessage m1, ITextMessage m2, string message ) : void
AssertTextMessagesEqual ( IMessage firstSet, IMessage secondSet ) : void
AssertTextMessagesEqual ( IMessage firstSet, IMessage secondSet, string messsage ) : void
CreateNMSFactory ( ) : bool

Create the NMS Factory that can create NMS Connections.

CreateNMSFactory ( string nameTestURI ) : bool

Create the NMS Factory that can create NMS Connections. This function loads the connection settings from the configuration file.

GetConfiguredConnectionURI ( ) : string

Return the configured URI String. This function loads the connection settings from the configuration file.

GetConnectionConfigFileName ( ) : string

Name of the connection configuration filename.

GetFactoryParams ( XmlElement uriNode ) : object[]

Get the parameters for the ConnectionFactory from the configuration file.

GetNameTestURI ( ) : string

The name of the connection configuration that CreateNMSFactory() will load.

GetNodeValueAttribute ( XmlElement parentNode, string nodeName, string dflt ) : string

RegisterDurableConsumer ( string connectionID, string destination, string consumerID, string selector, bool noLocal ) : void

Register a durable consumer

UnregisterDurableConsumer ( string connectionID, string consumerID ) : void

Unregister a durable consumer for the given connection ID.

Private Methods

Method Description
GetConfigSearchPaths ( ) : string[]
NMSTestSupport ( ) : System
SetUp ( ) : void
TearDown ( ) : void

Method Details

AssertEquals() protected method

protected AssertEquals ( IMessage m1, IMessage m2 ) : void
m1 IMessage
m2 IMessage
return void

AssertEquals() protected method

protected AssertEquals ( IMessage m1, IMessage m2, string message ) : void
m1 IMessage
m2 IMessage
message string
return void

AssertEquals() protected method

protected AssertEquals ( ITextMessage m1, ITextMessage m2 ) : void
m1 ITextMessage
m2 ITextMessage
return void

AssertTextMessageEqual() protected method

protected AssertTextMessageEqual ( ITextMessage m1, ITextMessage m2, string message ) : void
m1 ITextMessage
m2 ITextMessage
message string
return void

AssertTextMessagesEqual() protected method

protected AssertTextMessagesEqual ( IMessage firstSet, IMessage secondSet ) : void
firstSet IMessage
secondSet IMessage
return void

AssertTextMessagesEqual() protected method

protected AssertTextMessagesEqual ( IMessage firstSet, IMessage secondSet, string messsage ) : void
firstSet IMessage
secondSet IMessage
messsage string
return void

CreateConnection() public method

Create a new connection to the broker.
public CreateConnection ( ) : IConnection
return IConnection

CreateConnection() public method

Create a new connection to the broker.
public CreateConnection ( string newClientId ) : IConnection
newClientId string Client ID of the new connection.
return IConnection

CreateDestination() public method

public CreateDestination ( ISession session, DestinationType type ) : IDestination
session ISession
type DestinationType
return IDestination

CreateDestination() public method

public CreateDestination ( ISession session, DestinationType type, string name ) : IDestination
session ISession
type DestinationType
name string
return IDestination

CreateDestination() public method

Create a destination. This will delete an existing destination and re-create it.
public CreateDestination ( ISession session, string destinationName ) : IDestination
session ISession
destinationName string
return IDestination

CreateNMSFactory() protected method

Create the NMS Factory that can create NMS Connections.
protected CreateNMSFactory ( ) : bool
return bool

CreateNMSFactory() protected method

Create the NMS Factory that can create NMS Connections. This function loads the connection settings from the configuration file.
protected CreateNMSFactory ( string nameTestURI ) : bool
nameTestURI string The named connection configuration.
return bool

GetConfiguredConnectionURI() protected method

Return the configured URI String. This function loads the connection settings from the configuration file.
protected GetConfiguredConnectionURI ( ) : string
return string

GetConnectionConfigFileName() protected method

Name of the connection configuration filename.
protected GetConnectionConfigFileName ( ) : string
return string

GetEnvVar() public static method

Get environment variable value.
public static GetEnvVar ( string varName, string defaultValue ) : string
varName string
defaultValue string
return string

GetFactoryParams() protected method

Get the parameters for the ConnectionFactory from the configuration file.
protected GetFactoryParams ( XmlElement uriNode ) : object[]
uriNode System.Xml.XmlElement Parent node of the factoryParams node.
return object[]

GetNameTestURI() protected method

The name of the connection configuration that CreateNMSFactory() will load.
protected GetNameTestURI ( ) : string
return string

GetNodeValueAttribute() protected static method

protected static GetNodeValueAttribute ( XmlElement parentNode, string nodeName, string dflt ) : string
parentNode System.Xml.XmlElement
nodeName string
dflt string
return string

GetTestClientId() public method

public GetTestClientId ( ) : string
return string

RegisterDurableConsumer() protected method

Register a durable consumer
protected RegisterDurableConsumer ( string connectionID, string destination, string consumerID, string selector, bool noLocal ) : void
connectionID string Connection ID of the consumer.
destination string Destination name to register. Supports embedded prefix names.
consumerID string Name of the durable consumer.
selector string Selector parameters for consumer.
noLocal bool
return void

ReplaceEnvVar() public static method

Replace embedded variable markups with environment variable values. Variable markups are of the following form: ${varname}
public static ReplaceEnvVar ( string srcText ) : string
srcText string
return string

ReplaceEnvVar() public static method

Replace the variable with environment variable.
public static ReplaceEnvVar ( string srcText, string varName, string defaultValue ) : string
srcText string
varName string
defaultValue string
return string

SendMessages() public method

public SendMessages ( IConnection connection, IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
connection IConnection
destination IDestination
deliveryMode MsgDeliveryMode
count int
return void

SendMessages() public method

public SendMessages ( IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
destination IDestination
deliveryMode MsgDeliveryMode
count int
return void

SendMessages() public method

public SendMessages ( ISession session, IDestination destination, MsgDeliveryMode deliveryMode, int count ) : void
session ISession
destination IDestination
deliveryMode MsgDeliveryMode
count int
return void

ToHex() public static method

public static ToHex ( long value ) : string
value long
return string

UnregisterDurableConsumer() protected method

Unregister a durable consumer for the given connection ID.
protected UnregisterDurableConsumer ( string connectionID, string consumerID ) : void
connectionID string Connection ID of the consumer.
consumerID string Name of the durable consumer.
return void

Property Details

clientId protected property

protected string clientId
return string

idCounter protected property

protected int idCounter
return int

passWord protected property

protected string passWord
return string

receiveTimeout protected property

protected TimeSpan,System receiveTimeout
return System.TimeSpan

testRun protected property

protected int testRun
return int

userName protected property

protected string userName
return string