From 7e98517c4c72c7c53a96e3c80556611a52ca9401 Mon Sep 17 00:00:00 2001 From: RoyOsherove Date: Mon, 25 Jun 2007 23:24:08 +0000 Subject: [PATCH] new version of the code --- XtUnit/XtUnit.Framework.csproj | 119 ----------------- XtUnit/XtUnit.Framework.sln | 20 --- XtUnit/{ => XtUnit.Framework}/AssemblyInfo.cs | 0 .../Internal/InterceptableObject.cs | 0 .../Internal/InterceptionAttributes.cs | 6 +- .../Internal/ProcessingAttributeBase.cs | 17 +-- .../{ => XtUnit.Framework}/TestFixtureBase.cs | 0 .../TestProcessingAttributeBase .cs | 0 .../XtUnit.Framework/XtUnit.Framework.csproj | 126 ++++++++++++++++++ XtUnit/XtUnit.SampleTests/AssemblyInfo.cs | 56 ++++++++ .../ExtensibleUnitTesting.sln | 37 +++++ .../ExtensibleUnitTesting.suo | Bin 0 -> 10752 bytes XtUnit/XtUnit.SampleTests/SimpleFixture.cs | 27 ++++ .../XtUnit.SampleTests.csproj | 121 +++++++++++++++++ XtUnit/XtUnit.key | Bin 0 -> 596 bytes XtUnit/XtUnit.sln | 40 ++++++ XtUnit/XtUnitCoolBook.htm | 71 ++++++++++ XtUnit/Xtunit.Extensions.Royo/AssemblyInfo.cs | 56 ++++++++ .../CustomRollbackAttribute.cs | 59 ++++++++ .../CustomTracingAttribute.cs | 27 ++++ .../XtUnit.Extensions.Royo.csproj | 115 ++++++++++++++++ 21 files changed, 737 insertions(+), 160 deletions(-) delete mode 100644 XtUnit/XtUnit.Framework.csproj delete mode 100644 XtUnit/XtUnit.Framework.sln rename XtUnit/{ => XtUnit.Framework}/AssemblyInfo.cs (100%) rename XtUnit/{ => XtUnit.Framework}/Internal/InterceptableObject.cs (100%) rename XtUnit/{ => XtUnit.Framework}/Internal/InterceptionAttributes.cs (91%) rename XtUnit/{ => XtUnit.Framework}/Internal/ProcessingAttributeBase.cs (80%) rename XtUnit/{ => XtUnit.Framework}/TestFixtureBase.cs (100%) rename XtUnit/{ => XtUnit.Framework}/TestProcessingAttributeBase .cs (100%) create mode 100644 XtUnit/XtUnit.Framework/XtUnit.Framework.csproj create mode 100644 XtUnit/XtUnit.SampleTests/AssemblyInfo.cs create mode 100644 XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.sln create mode 100644 XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.suo create mode 100644 XtUnit/XtUnit.SampleTests/SimpleFixture.cs create mode 100644 XtUnit/XtUnit.SampleTests/XtUnit.SampleTests.csproj create mode 100644 XtUnit/XtUnit.key create mode 100644 XtUnit/XtUnit.sln create mode 100644 XtUnit/XtUnitCoolBook.htm create mode 100644 XtUnit/Xtunit.Extensions.Royo/AssemblyInfo.cs create mode 100644 XtUnit/Xtunit.Extensions.Royo/CustomRollbackAttribute.cs create mode 100644 XtUnit/Xtunit.Extensions.Royo/CustomTracingAttribute.cs create mode 100644 XtUnit/Xtunit.Extensions.Royo/XtUnit.Extensions.Royo.csproj diff --git a/XtUnit/XtUnit.Framework.csproj b/XtUnit/XtUnit.Framework.csproj deleted file mode 100644 index d62805b..0000000 --- a/XtUnit/XtUnit.Framework.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0D93571A-7C7B-42F6-9BF2-03C423DC44C9} - Debug - AnyCPU - - - - - XtUnit.Framework - - - JScript - Grid - IE50 - false - Library - XtUnit.Framework - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - nunit.framework - ..\..\..\..\..\..\Program Files\NUnit 2.2\\bin\nunit.framework.dll - hklm\dn\nunit.framework - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/XtUnit/XtUnit.Framework.sln b/XtUnit/XtUnit.Framework.sln deleted file mode 100644 index cd28ec0..0000000 --- a/XtUnit/XtUnit.Framework.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XtUnit.Framework", "XtUnit.Framework.csproj", "{0D93571A-7C7B-42F6-9BF2-03C423DC44C9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/XtUnit/AssemblyInfo.cs b/XtUnit/XtUnit.Framework/AssemblyInfo.cs similarity index 100% rename from XtUnit/AssemblyInfo.cs rename to XtUnit/XtUnit.Framework/AssemblyInfo.cs diff --git a/XtUnit/Internal/InterceptableObject.cs b/XtUnit/XtUnit.Framework/Internal/InterceptableObject.cs similarity index 100% rename from XtUnit/Internal/InterceptableObject.cs rename to XtUnit/XtUnit.Framework/Internal/InterceptableObject.cs diff --git a/XtUnit/Internal/InterceptionAttributes.cs b/XtUnit/XtUnit.Framework/Internal/InterceptionAttributes.cs similarity index 91% rename from XtUnit/Internal/InterceptionAttributes.cs rename to XtUnit/XtUnit.Framework/Internal/InterceptionAttributes.cs index 44c2710..6ff3abe 100644 --- a/XtUnit/Internal/InterceptionAttributes.cs +++ b/XtUnit/XtUnit.Framework/Internal/InterceptionAttributes.cs @@ -146,11 +146,7 @@ private void PreProcess(ref IMethodCallMessage callMessage) { ProcessingAttributeBase[] attrs = getMethodCallCustomAttributes(callMessage); for(int i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XtUnit/XtUnit.SampleTests/AssemblyInfo.cs b/XtUnit/XtUnit.SampleTests/AssemblyInfo.cs new file mode 100644 index 0000000..a36df86 --- /dev/null +++ b/XtUnit/XtUnit.SampleTests/AssemblyInfo.cs @@ -0,0 +1,56 @@ +using System.Reflection; +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("NUnit.Extensions.ExtensibilityFramework.Samples")] +[assembly: AssemblyDescription("NUnit.Extensions.ExtensibilityFramework.Samples")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Roy Osherove")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("2004 Roy Osherove")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.1")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("..\\..\\..\\XtUnit.key")] +[assembly: AssemblyKeyName("")] diff --git a/XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.sln b/XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.sln new file mode 100644 index 0000000..19be7ae --- /dev/null +++ b/XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.sln @@ -0,0 +1,37 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtensibleUnitTestsExample", "ExtensibleUnitTestsExample.csproj", "{576DF679-DDF4-4FD5-A2D3-01A4C19245BB}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnit.Extensions.ExtensibilityFramework", "..\Nunit.Extensions.ExtensibilityFramework\NUnit.Extensions.ExtensibilityFramework.csproj", "{0D93571A-7C7B-42F6-9BF2-03C423DC44C9}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnit.Extensions.Royo", "..\Nunit.Extensions.Royo\NUnit.Extensions.Royo.csproj", "{2A8B9AEE-2400-4829-AC47-4D1094587272}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {576DF679-DDF4-4FD5-A2D3-01A4C19245BB}.Debug.ActiveCfg = Debug|.NET + {576DF679-DDF4-4FD5-A2D3-01A4C19245BB}.Debug.Build.0 = Debug|.NET + {576DF679-DDF4-4FD5-A2D3-01A4C19245BB}.Release.ActiveCfg = Release|.NET + {576DF679-DDF4-4FD5-A2D3-01A4C19245BB}.Release.Build.0 = Release|.NET + {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Debug.ActiveCfg = Debug|.NET + {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Debug.Build.0 = Debug|.NET + {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Release.ActiveCfg = Release|.NET + {0D93571A-7C7B-42F6-9BF2-03C423DC44C9}.Release.Build.0 = Release|.NET + {2A8B9AEE-2400-4829-AC47-4D1094587272}.Debug.ActiveCfg = Debug|.NET + {2A8B9AEE-2400-4829-AC47-4D1094587272}.Debug.Build.0 = Debug|.NET + {2A8B9AEE-2400-4829-AC47-4D1094587272}.Release.ActiveCfg = Release|.NET + {2A8B9AEE-2400-4829-AC47-4D1094587272}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.suo b/XtUnit/XtUnit.SampleTests/ExtensibleUnitTesting.suo new file mode 100644 index 0000000000000000000000000000000000000000..dd843f57189b24cfe385015bc79ae37c4cdfac97 GIT binary patch literal 10752 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 baMBm?Kh>b9UgVu`u5MZjM(%WVv;+SKibNBm literal 0 HcmV?d00001 diff --git a/XtUnit/XtUnit.SampleTests/SimpleFixture.cs b/XtUnit/XtUnit.SampleTests/SimpleFixture.cs new file mode 100644 index 0000000..3701d44 --- /dev/null +++ b/XtUnit/XtUnit.SampleTests/SimpleFixture.cs @@ -0,0 +1,27 @@ +/// Created by Roy Osherove, http://www.iserializable.com +/// ------------------------------------------------------ +using System.Diagnostics; +using NUnit.Framework; +using XtUnit.Extensions.Royo; +using XtUnit.Framework; + +namespace ExtensibleUnitTesting.UI +{ + [TestFixture] + public class SimpleFixture:TestFixtureBase + { + [Test,CustomTracing] + public void SomeMethodWithTracing() + { + Debug.WriteLine("Performing some database stuff..."); + + } + + [Test,CustomRollBack,CustomTracing] + public void SomeMethodWithRollback() + { + Debug.WriteLine("Performing some database stuff..."); + } + + } +} diff --git a/XtUnit/XtUnit.SampleTests/XtUnit.SampleTests.csproj b/XtUnit/XtUnit.SampleTests/XtUnit.SampleTests.csproj new file mode 100644 index 0000000..dd275ee --- /dev/null +++ b/XtUnit/XtUnit.SampleTests/XtUnit.SampleTests.csproj @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/XtUnit/XtUnit.key b/XtUnit/XtUnit.key new file mode 100644 index 0000000000000000000000000000000000000000..ceab7eca7de64231325a14f57738bfa5b37e5610 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096I+G8QOf&UgR+p;5#n^!Zl8v&-Q%@VVv zcJh9vP?cnzzDQPRbS}t*Jtbxs*a^;;wqy0iwPuHcJlXv{^T$p5-cZIl!tuIK^R26z zNf`@}{Viwm&8JK%jSs_i9>703p52k0`AiRrXG|S5n6m@!8#rn$PC9(-?5Lkevw+$jo;=Fp|V&- z2I0@SO&mxehOy&QnX84K!obI?00h@Yo+H#YYuHS*luaBZv;kz00rJbt*EsbTYPM|? zWmuL+zZ^{EETX=|TQ7THdeD!Gp8F% zy@vX!(W5+10zoNa^%I~g;6$8=^QK>Jg?+hiSe#R$SN}nCHLgxsO2;e?3Lvccea!(z z6tuUtBYk}wDVoo{2k3Zm4SEJ!rt>sr3-2osa7TtdEm>G%LgNntnCGF_@B)}4q4?EN z{5O)@ra8?`jn&Kt&h?40LIC+#qt{O%#SQh>d|P0jFkl5ON=X>&FjP~qCWa@}l6z4t z?U0nz7u&5#x<_L)vZh)LD=E@A5FI&f$1rRvI;(L8FYH&y^O4V-q5k + + + + + + + +

XT-Unit, Cook Book

+

A helper for .Net based unit + testing framework

+

Based on the + Interception application block by Roy OSherove

+

By + Roy Osherove,   Team Agile

+

 

+

 

+

What’s the idea?

+

See these + links for details on the problems this helper is trying to solve:

+

http://weblogs.asp.net/rosherove/articles/dbunittesting.aspx

+

http://weblogs.asp.net/rosherove/archive/2004/07/20/187863.aspx

+

http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx

+

 

+

How do I use + it?

+

 

+

Let’s say that + you have a test fixture that performs various actions in each test against the + database, including the basic CRUD operations (Insert, update, etc…).

+

In order to + easily add roll back abilities to your tests do the following:

+
    +
  1. + In your test project, add a + reference to the XtUnit assembly or source code project
  2. +
  3. + add a using/imports statement + for TeamAgile.XtUnit
  4. +
  5. + Place the “DataRollBack” + attribute on your test so that it would  look a little like this one:
+

 

+

[Test, + DataRollBack]

+

            + public void + MyDataRelatedTest()

+

            + {

+

                  + //this method will be performed inside a COM+ + transaction

+

                  + //this requires windows XP SP2 or better

+

                  + //Windows Server 2003 works as well.

+

            + }

+
    +
  1. + Note that you MUST be running + your test (and database) on a machine that is capable of running COM+1.5, which + currently means Windows XP service Pack 2 or windows server 2003
  2. +
  3. + Done!
+

 

+

 

+

 

+ + diff --git a/XtUnit/Xtunit.Extensions.Royo/AssemblyInfo.cs b/XtUnit/Xtunit.Extensions.Royo/AssemblyInfo.cs new file mode 100644 index 0000000..b2c3fd6 --- /dev/null +++ b/XtUnit/Xtunit.Extensions.Royo/AssemblyInfo.cs @@ -0,0 +1,56 @@ +using System.Reflection; +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("NUnit.Extensions.ExtensibilityFramework")] +[assembly: AssemblyDescription("NUnit.Extensions.ExtensibilityFramework")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Roy Osherove")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("2004 Roy Osherove")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.1")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("..\\..\\..\\XtUnit.key")] +[assembly: AssemblyKeyName("")] diff --git a/XtUnit/Xtunit.Extensions.Royo/CustomRollbackAttribute.cs b/XtUnit/Xtunit.Extensions.Royo/CustomRollbackAttribute.cs new file mode 100644 index 0000000..ec94e12 --- /dev/null +++ b/XtUnit/Xtunit.Extensions.Royo/CustomRollbackAttribute.cs @@ -0,0 +1,59 @@ +/// Created by Roy Osherove, http://www.iserializable.com +/// ------------------------------------------------------ +using System; +using System.Diagnostics; +using System.EnterpriseServices; +using XtUnit.Framework; + +namespace XtUnit.Extensions.Royo +{ + + + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor |AttributeTargets.Field,Inherited=true)] + public class CustomRollBackAttribute:TestProcessingAttributeBase + { + + [DebuggerStepThrough] + protected override void OnPreProcess() + { + try + { + ServiceConfig config = new ServiceConfig(); + config.Transaction=TransactionOption.RequiresNew; + config.TrackingAppName="Application Unit Tests"; + config.TransactionDescription="Application Unit Tests Transaction"; + config.TransactionTimeout=10000; + + OutputDebugMessage("ENTERING transaction context on method: " + methodCallMessage.MethodBase.Name); + + ServiceDomain.Enter(config); + OutputDebugMessage("ENTRED transaction context on method: " + methodCallMessage.MethodBase.Name); + + + } + catch(Exception e) + { + OutputDebugMessage("Could not enter into a new transaction:\n" + e.ToString()); + } + } + + [DebuggerStepThrough] + protected override void OnPostProcess() + { + try + { + if(ContextUtil.IsInTransaction) + { + OutputDebugMessage("LEAVING transaction context on method: " + methodCallMessage.MethodBase.Name); + ContextUtil.SetAbort(); + } + ServiceDomain.Leave(); + } + catch(Exception e) + { + OutputDebugMessage("Could not leave an existing transaction:\n" + e.ToString()); + } + } + } + +} diff --git a/XtUnit/Xtunit.Extensions.Royo/CustomTracingAttribute.cs b/XtUnit/Xtunit.Extensions.Royo/CustomTracingAttribute.cs new file mode 100644 index 0000000..c60db37 --- /dev/null +++ b/XtUnit/Xtunit.Extensions.Royo/CustomTracingAttribute.cs @@ -0,0 +1,27 @@ +/// Created by Roy Osherove, http://www.iserializable.com +/// ------------------------------------------------------ +using System; +using System.Diagnostics; +using XtUnit.Framework; + +namespace XtUnit.Framework +{ + + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor |AttributeTargets.Field,Inherited=true)] + public class CustomTracingAttribute:TestProcessingAttributeBase + { + + [DebuggerStepThrough] + protected override void OnPreProcess() + { + OutputDebugMessage("ENTERING method: " + methodCallMessage.MethodBase.Name); + } + + [DebuggerStepThrough] + protected override void OnPostProcess() + { + OutputDebugMessage("LEAVING method: " + methodCallMessage.MethodBase.Name); + } + } + +} diff --git a/XtUnit/Xtunit.Extensions.Royo/XtUnit.Extensions.Royo.csproj b/XtUnit/Xtunit.Extensions.Royo/XtUnit.Extensions.Royo.csproj new file mode 100644 index 0000000..bde0b28 --- /dev/null +++ b/XtUnit/Xtunit.Extensions.Royo/XtUnit.Extensions.Royo.csproj @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + +