fix DTC tests - automate created database for DTC unit tests.
diff --git a/src/Threads/PooledTaskRunner.cs b/src/Threads/PooledTaskRunner.cs
index 1964e51..ad405b8 100644
--- a/src/Threads/PooledTaskRunner.cs
+++ b/src/Threads/PooledTaskRunner.cs
@@ -16,7 +16,9 @@
*/
using System;
+using System.Collections.Concurrent;
using System.Threading;
+using System.Threading.Tasks;
namespace Apache.NMS.ActiveMQ.Threads
{
@@ -116,22 +118,22 @@
{
_shutdown = true;
- if(runningThread != System.Threading.Thread.CurrentThread)
+ if (runningThread != Thread.CurrentThread)
{
if(iterating)
{
- System.Threading.Thread.Sleep(timeout);
+ Thread.Sleep(timeout);
}
if(iterating)
{
runningThread.Abort();
- }
+ }
}
}
}
- public void Shutdown()
+ public void Shutdown()
{
Shutdown(new TimeSpan(Timeout.Infinite));
}
diff --git a/src/nms-openwire.csproj b/src/nms-openwire.csproj
index bc386ec..324e5c2 100644
--- a/src/nms-openwire.csproj
+++ b/src/nms-openwire.csproj
@@ -49,4 +49,10 @@
</None>
</ItemGroup>
+ <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
+ <PackageReference Include="System.Runtime">
+ <Version>4.3.1</Version>
+ </PackageReference>
+ </ItemGroup>
+
</Project>
diff --git a/test/DtcBasicTransactionsTest.cs b/test/DtcBasicTransactionsTest.cs
index 229c5bf..4d06bbe 100644
--- a/test/DtcBasicTransactionsTest.cs
+++ b/test/DtcBasicTransactionsTest.cs
@@ -31,7 +31,7 @@
{
base.SetUp();
- this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+ this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionUri));
this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
}
diff --git a/test/DtcConsumerTransactionsTest.cs b/test/DtcConsumerTransactionsTest.cs
index 9615456..3128b94 100644
--- a/test/DtcConsumerTransactionsTest.cs
+++ b/test/DtcConsumerTransactionsTest.cs
@@ -36,7 +36,7 @@
{
base.SetUp();
- this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+ this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionUri));
this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
}
@@ -60,7 +60,7 @@
using (IMessageConsumer consumer = session.CreateConsumer(queue))
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
@@ -80,7 +80,7 @@
}
// check that others message have status redelivered = false
- IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = checkFactory.CreateConnection())
{
@@ -126,7 +126,7 @@
using (IMessageConsumer consumer = session.CreateConsumer(queue))
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
@@ -151,7 +151,7 @@
}
// check that others message have status redelivered = false
- IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = checkFactory.CreateConnection())
{
@@ -197,7 +197,7 @@
for (int i = 0; i < receiveCount; i++)
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
@@ -221,7 +221,7 @@
Tracer.Debug("First stage ok");
// check that others message have status redelivered = false
- IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = checkFactory.CreateConnection())
{
@@ -269,7 +269,7 @@
for (int i = 0; i < receiveCount; i++)
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
@@ -292,7 +292,7 @@
Tracer.Debug("First stage ok");
// check that others message have status redelivered = false
- IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory checkFactory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = checkFactory.CreateConnection())
{
@@ -409,7 +409,7 @@
{
const string logLocation = @".\RecoveryDir";
string newConnectionUri =
- connectionURI + "?nms.RecoveryPolicy.RecoveryLogger.Location=" + logLocation +
+ connectionUri + "?nms.RecoveryPolicy.RecoveryLogger.Location=" + logLocation +
"&nms.configuredResourceManagerId=" +
dtcFactory.ConfiguredResourceManagerId;
@@ -712,7 +712,7 @@
try
{
using (TransactionScope scoped = new TransactionScope(batchTxControl))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
diff --git a/test/DtcProducerTransactionsTest.cs b/test/DtcProducerTransactionsTest.cs
index 443ccf4..5569343 100644
--- a/test/DtcProducerTransactionsTest.cs
+++ b/test/DtcProducerTransactionsTest.cs
@@ -34,7 +34,7 @@
{
base.SetUp();
- this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+ this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionUri));
this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
}
@@ -149,7 +149,7 @@
PrepareDatabase();
string newConnectionUri =
- connectionURI + "?nms.RecoveryPolicy.RecoveryLoggerType=harness" +
+ connectionUri + "?nms.RecoveryPolicy.RecoveryLoggerType=harness" +
"&nms.configuredResourceManagerId=" +
dtcFactory.ConfiguredResourceManagerId;
diff --git a/test/DtcTransactionsTestSupport.cs b/test/DtcTransactionsTestSupport.cs
index 07d3155..88331cf 100644
--- a/test/DtcTransactionsTestSupport.cs
+++ b/test/DtcTransactionsTestSupport.cs
@@ -19,13 +19,14 @@
using System.IO;
using System.Transactions;
using System.Threading;
-
+using System.Xml.Linq;
using NUnit.Framework;
using Apache.NMS.Test;
using Apache.NMS.ActiveMQ.Commands;
using Apache.NMS.ActiveMQ.Transport;
using System.Data.SqlClient;
using System.Collections;
+using System.Data;
namespace Apache.NMS.ActiveMQ.Test
{
@@ -52,22 +53,57 @@
private ITrace oldTracer;
- protected const string sqlConnectionString =
- // "Data Source=localhost;Initial Catalog=TestDB;User ID=user;Password=password";
- "Data Source=.\\SQLEXPRESS;Initial Catalog=TestDB;Integrated Security = true";
- protected const string testTable = "TestTable";
- protected const string testColumn = "TestID";
- protected const string testQueueName = "TestQueue";
- protected const string connectionURI = "tcpfaulty://${activemqhost}:61616";
+ protected static string createDbConnectionString = string.Empty;
+ protected static string createTableConnectionString = string.Empty;
+ protected static string testDbName = string.Empty;
+ protected static string testTable = string.Empty;
+ protected static string testColumn = string.Empty;
+ protected static string testQueueName = string.Empty;
+ protected static string testDbFileNameLocation = string.Empty;
+ protected static string connectionUri = string.Empty;
[SetUp]
public override void SetUp()
{
+ var currentFilePath = Directory.GetCurrentDirectory();
+ var xElement = XElement.Load(currentFilePath + "\\test\\TestDbConfig.xml");
+
+ var testDbConnectionString = xElement.Element("createDbConnectionString");
+ if (testDbConnectionString != null) createDbConnectionString = testDbConnectionString.Attribute("name")?.Value;
+
+ var testTableConnectionString = xElement.Element("createTableConnectionString");
+ if (testTableConnectionString != null) createTableConnectionString = testTableConnectionString.Attribute("name")?.Value;
+
+ var table = xElement.Element("testSqlTable");
+ if (table != null) testTable = table.Attribute("name")?.Value;
+
+ var column = xElement.Element("testSqlColumn");
+ if (column != null) testColumn = column.Attribute("name")?.Value;
+
+ var dbName = xElement.Element("testDbName");
+ if (dbName != null) testDbName = dbName.Attribute("name")?.Value;
+
+ var queueName = xElement.Element("testSqlQueueName");
+ if (queueName != null) testQueueName = queueName.Attribute("name")?.Value;
+
+ var fileName = xElement.Element("dbFileNameLocation");
+ if (fileName != null) testDbFileNameLocation = fileName.Attribute("name")?.Value;
+
+ var conUri = xElement.Element("connectionURI");
+ if (conUri != null) connectionUri = conUri.Attribute("name")?.Value;
+
this.oldTracer = Tracer.Trace;
this.nonExistantPath = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid().ToString());
base.SetUp();
+ if (!CheckDatabaseExists(createDbConnectionString, testDbName))
+ {
+ CreateTestDb();
+ CreateTestTable();
+ }
+
+
PurgeDestination();
}
@@ -81,6 +117,104 @@
Tracer.Trace = this.oldTracer;
}
+ private bool CheckDatabaseExists(string sqlTmpConnectionString, string databaseName)
+ {
+ bool result;
+ try
+ {
+ var tmpConn = new SqlConnection(sqlTmpConnectionString);
+
+ var sqlCreateDbQuery = $"SELECT database_id FROM sys.databases WHERE Name = '{databaseName}'";
+
+ using (tmpConn)
+ {
+ using (var sqlCmd = new SqlCommand(sqlCreateDbQuery, tmpConn))
+ {
+ tmpConn.Open();
+
+ var resultObj = sqlCmd.ExecuteScalar();
+
+ var databaseId = 0;
+
+ if (resultObj != null)
+ {
+ int.TryParse(resultObj.ToString(), out databaseId);
+ }
+
+ tmpConn.Close();
+
+ result = (databaseId > 0);
+ }
+ }
+ }
+ catch (Exception)
+ {
+ result = false;
+ }
+
+ return result;
+ }
+
+ private void CreateTestDb()
+ {
+ //var createConnection = new SqlConnection("Data Source=WKRKL-F1493EW;Trusted_Connection=yes;User ID=Rafal.Bak;Password=Miesiac*2");
+ var createConnection = new SqlConnection(createDbConnectionString);
+
+ var createDb = "CREATE DATABASE " + testDbName + " ON PRIMARY " +
+ "(NAME = " + testDbName + ", " +
+ "FILENAME = '" + testDbFileNameLocation + "\\MyDatabaseData.mdf', " +
+ "SIZE = 8192KB, MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB) " +
+ "LOG ON (NAME = TestDB_log, " +
+ "FILENAME = '" + testDbFileNameLocation + "\\MyDatabaseLog.ldf', " +
+ "SIZE = 8192KB, " +
+ "MAXSIZE = 2048GB," +
+ "FILEGROWTH = 65536KB) ";
+
+ var createDbCommand = new SqlCommand(createDb, createConnection);
+ try
+ {
+ createConnection.Open();
+ createDbCommand.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ finally
+ {
+ if (createConnection.State == ConnectionState.Open)
+ {
+ createConnection.Close();
+ }
+ }
+ }
+
+ private void CreateTestTable()
+ {
+ var createConnection = new SqlConnection(createTableConnectionString);
+
+ var createTable = "CREATE TABLE [dbo].[" + testTable + "]([" + testColumn +
+ "][nchar](10) NULL ) ON [PRIMARY]";
+
+ var createTableCommand = new SqlCommand(createTable, createConnection);
+ try
+ {
+ createConnection.Open();
+ createTableCommand.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ finally
+ {
+ if (createConnection.State == ConnectionState.Open)
+ {
+ createConnection.Close();
+ }
+ }
+ }
+
protected void OnException(Exception ex)
{
Tracer.DebugFormat("Test Driver received Error Notification: {0}", ex.Message);
@@ -90,25 +224,21 @@
protected static void PrepareDatabase()
{
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (var sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
// remove all data from test table
- using (SqlCommand sqlCommand = new SqlCommand(string.Format("TRUNCATE TABLE {0}", testTable), sqlConnection))
+ using (SqlCommand sqlCommand = new SqlCommand($"TRUNCATE TABLE {testTable}", sqlConnection))
{
sqlCommand.ExecuteNonQuery();
}
// add some data to test table
- for (int i = 0; i < MSG_COUNT; ++i)
+ for (var i = 0; i < MSG_COUNT; ++i)
{
- using (SqlCommand sqlCommand = new SqlCommand(
- string.Format(
- "INSERT INTO {0} ({1}) values ({2})",
- testTable,
- testColumn,
- i), sqlConnection))
+ using (var sqlCommand = new SqlCommand(
+ $"INSERT INTO {testTable} ({testColumn}) values ({i})", sqlConnection))
{
sqlCommand.ExecuteNonQuery();
}
@@ -120,12 +250,12 @@
protected static void PurgeDatabase()
{
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (var sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
// remove all data from test table
- using (SqlCommand sqlCommand = new SqlCommand(string.Format("TRUNCATE TABLE {0}", testTable), sqlConnection))
+ using (var sqlCommand = new SqlCommand($"TRUNCATE TABLE {testTable}", sqlConnection))
{
sqlCommand.ExecuteNonQuery();
}
@@ -138,17 +268,17 @@
{
IList entries = new ArrayList();
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (var sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
- using (SqlCommand sqlReadCommand = new SqlCommand(
- string.Format("SELECT {0} FROM {1}", testColumn, testTable), sqlConnection))
- using (SqlDataReader reader = sqlReadCommand.ExecuteReader())
+ using (var sqlReadCommand = new SqlCommand(
+ $"SELECT {testColumn} FROM {testTable}", sqlConnection))
+ using (var reader = sqlReadCommand.ExecuteReader())
{
while (reader.Read())
{
- entries.Add("Hello World " + (int)reader[0]);
+ entries.Add("Hello World " + (string)reader[0]);
}
}
}
@@ -158,13 +288,13 @@
protected static void VerifyDatabaseTableIsEmpty()
{
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (var sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
- SqlCommand sqlCommand = new SqlCommand(
- string.Format("SELECT COUNT(*) FROM {0}", testTable),
+ var sqlCommand = new SqlCommand(
+ $"SELECT COUNT(*) FROM {testTable}",
sqlConnection);
- int count = (int)sqlCommand.ExecuteScalar();
+ var count = (int)sqlCommand.ExecuteScalar();
Assert.AreEqual(0, count, "wrong number of rows in DB");
}
}
@@ -176,13 +306,13 @@
protected static void VerifyDatabaseTableIsFull(int expected)
{
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (var sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
- SqlCommand sqlCommand = new SqlCommand(
- string.Format("SELECT COUNT(*) FROM {0}", testTable),
+ var sqlCommand = new SqlCommand(
+ $"SELECT COUNT(*) FROM {testTable}",
sqlConnection);
- int count = (int)sqlCommand.ExecuteScalar();
+ var count = (int)sqlCommand.ExecuteScalar();
Assert.AreEqual(expected, count, "wrong number of rows in DB");
}
}
@@ -193,19 +323,20 @@
protected static void DeleteDestination()
{
- IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
- using (Connection connection = factory.CreateConnection() as Connection)
+ using (var connection = factory.CreateConnection() as Connection)
{
- using (ISession session = connection.CreateSession())
+ using (var session = connection.CreateSession())
{
- IQueue queue = session.GetQueue(testQueueName);
+ var queue = session.GetQueue(testQueueName);
try
{
connection.DeleteDestination(queue);
}
- catch
+ catch(Exception e)
{
+ throw new Exception(e.Message);
}
}
}
@@ -213,14 +344,14 @@
protected static void PurgeDestination()
{
- IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
- using (IConnection connection = factory.CreateConnection())
+ using (var connection = factory.CreateConnection())
{
connection.Start();
- using (ISession session = connection.CreateSession())
- using (IMessageConsumer consumer = session.CreateConsumer(session.GetQueue(testQueueName)))
+ using (var session = connection.CreateSession())
+ using (var consumer = session.CreateConsumer(session.GetQueue(testQueueName)))
{
IMessage recvd;
while ((recvd = consumer.Receive(TimeSpan.FromMilliseconds(3000))) != null)
@@ -238,18 +369,18 @@
protected static void PurgeAndFillQueue(int msgCount)
{
- IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
- using (IConnection connection = factory.CreateConnection())
+ using (var connection = factory.CreateConnection())
{
connection.Start();
- using (ISession session = connection.CreateSession())
+ using (var session = connection.CreateSession())
{
- IQueue queue = session.GetQueue(testQueueName);
+ var queue = session.GetQueue(testQueueName);
// empty queue
- using (IMessageConsumer consumer = session.CreateConsumer(queue))
+ using (var consumer = session.CreateConsumer(queue))
{
while ((consumer.Receive(TimeSpan.FromMilliseconds(2000))) != null)
{
@@ -257,11 +388,11 @@
}
// enqueue several messages
- using (IMessageProducer producer = session.CreateProducer(queue))
+ using (var producer = session.CreateProducer(queue))
{
producer.DeliveryMode = MsgDeliveryMode.Persistent;
- for (int i = 0; i < msgCount; i++)
+ for (var i = 0; i < msgCount; i++)
{
producer.Send(session.CreateTextMessage(i.ToString()));
}
@@ -281,7 +412,7 @@
protected static void VerifyBrokerQueueCountNoRecovery(int expectedNumberOfMessages)
{
- IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = factory.CreateConnection())
{
@@ -312,12 +443,12 @@
protected void VerifyBrokerQueueCount()
{
- VerifyBrokerQueueCount(MSG_COUNT, connectionURI);
+ VerifyBrokerQueueCount(MSG_COUNT, connectionUri);
}
protected void VerifyBrokerQueueCount(int expectedCount)
{
- VerifyBrokerQueueCount(expectedCount, connectionURI);
+ VerifyBrokerQueueCount(expectedCount, connectionUri);
}
protected void VerifyBrokerQueueCount(string connectionUri)
@@ -366,7 +497,7 @@
protected static void VerifyBrokerStateNoRecover(int expectedNumberOfMessages)
{
- IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionURI));
+ IConnectionFactory factory = new ConnectionFactory(ReplaceEnvVar(connectionUri));
using (IConnection connection = factory.CreateConnection())
{
@@ -497,7 +628,7 @@
producer.DeliveryMode = MsgDeliveryMode.Persistent;
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
@@ -544,7 +675,7 @@
producer.DeliveryMode = MsgDeliveryMode.Persistent;
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
{
sqlConnection.Open();
@@ -589,7 +720,7 @@
using (IMessageConsumer consumer = session.CreateConsumer(queue))
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
@@ -630,7 +761,7 @@
using (IMessageConsumer consumer = session.CreateConsumer(queue))
{
using (TransactionScope scoped = new TransactionScope(TransactionScopeOption.RequiresNew))
- using (SqlConnection sqlConnection = new SqlConnection(sqlConnectionString))
+ using (SqlConnection sqlConnection = new SqlConnection(createDbConnectionString))
using (SqlCommand sqlInsertCommand = new SqlCommand())
{
sqlConnection.Open();
diff --git a/test/TestDbConfig.xml b/test/TestDbConfig.xml
new file mode 100644
index 0000000..56e15fe
--- /dev/null
+++ b/test/TestDbConfig.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+ <createDbConnectionString name="Data Source=WKRKL-F1400EW;User ID=test.user;Password=Password*01"/>
+ <createTableConnectionString name="Data Source=WKRKL-F1400EW;Initial Catalog=TestDB;User ID=test.user;Password=Password*01"/>
+ <testSqlTable name="TestTable"/>
+ <testSqlColumn name="TestID"/>
+ <testSqlQueueName name="TestQueue"/>
+ <testDbName name="TestDB"/>
+ <dbFileNameLocation name="C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\"/>
+ <connectionURI name="tcpfaulty://${activemqhost}:61616"/>
+</root>
\ No newline at end of file
diff --git a/test/nsm-openwire-test-introduction.txt b/test/nsm-openwire-test-introduction.txt
new file mode 100644
index 0000000..87c7a1b
--- /dev/null
+++ b/test/nsm-openwire-test-introduction.txt
@@ -0,0 +1,15 @@
+How to correcty run nms-openwire-tests ?
+
+Requirements:
+- installed broker ActiveMQ 5 (https://activemq.apache.org/components/classic/download/)
+- installer SQL Server
+
+1) When the software listed above is installed,
+ log in to SQL Server(using Windows Authentication) and create new login e.g:
+ -Login name: "testuser"
+ -Password: "Password*01"
+ -Check option "SQL Server authentication"
+
+2) Open "TestDbConfig.xml" and go to "createDbConnectionString" and "createTableConnectionString".
+ Update "User ID" and "Password" like was set in new SQL Server login.
+ Update server name e.g value for "Data Source" is a computer name.
\ No newline at end of file