clean up usage of obsolete library members, set warnings as error to all projects, fix accordingly

This commit is contained in:
Marko Lahma
2013-12-06 13:05:53 +02:00
parent 1b73368826
commit 1105bb351b
82 changed files with 539 additions and 626 deletions

View File

@@ -1,52 +1,52 @@
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using System;
using System.Collections;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Xml
{
/// <summary>
/// Context that gets passed along an object definition parsing process, encapsulating
/// all relevant configuraiton as well as state.
/// </summary>
public class ParserContext
{
private readonly XmlReaderContext readerContext;
private readonly ObjectDefinitionParserHelper parserHelper;
private readonly IObjectDefinition containingObjectDefinition;
// private Stack containingComponents = new Stack();
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="parserHelper">The parser helper.</param>
public ParserContext(ObjectDefinitionParserHelper parserHelper)
{
this.readerContext = parserHelper.ReaderContext;
this.parserHelper = parserHelper;
using System.Collections;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Xml
{
/// <summary>
/// Context that gets passed along an object definition parsing process, encapsulating
/// all relevant configuraiton as well as state.
/// </summary>
public class ParserContext
{
private readonly XmlReaderContext readerContext;
private readonly ObjectDefinitionParserHelper parserHelper;
private readonly IObjectDefinition containingObjectDefinition;
// private Stack containingComponents = new Stack();
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="parserHelper">The parser helper.</param>
public ParserContext(ObjectDefinitionParserHelper parserHelper)
{
this.readerContext = parserHelper.ReaderContext;
this.parserHelper = parserHelper;
}
@@ -62,92 +62,92 @@ namespace Spring.Objects.Factory.Xml
this.containingObjectDefinition = containingObjectDefinition;
}
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="readerContext">The reader context.</param>
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="readerContext">The reader context.</param>
/// <param name="parserHelper">The parser helper.</param>
[Obsolete("consider using ParserContext(ObjectDefinitionParserHelper) instead", false)]
public ParserContext(XmlReaderContext readerContext, ObjectDefinitionParserHelper parserHelper)
{
this.readerContext = readerContext;
this.parserHelper = parserHelper;
}
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="readerContext">The reader context.</param>
/// <param name="parserHelper">The parser helper.</param>
[Obsolete("consider using ParserContext(ObjectDefinitionParserHelper) instead", false)]
public ParserContext(XmlReaderContext readerContext, ObjectDefinitionParserHelper parserHelper)
{
this.readerContext = readerContext;
this.parserHelper = parserHelper;
}
/// <summary>
/// Initializes a new instance of the <see cref="ParserContext"/> class.
/// </summary>
/// <param name="readerContext">The reader context.</param>
/// <param name="parserHelper">The parser helper.</param>
/// <param name="containingObjectDefinition">The containing object definition.</param>
[Obsolete("consider using ParserContext(ObjectDefinitionParserHelper, IObjectDefinition) instead", false)]
public ParserContext(XmlReaderContext readerContext, ObjectDefinitionParserHelper parserHelper, IObjectDefinition containingObjectDefinition)
{
this.readerContext = readerContext;
this.parserHelper = parserHelper;
this.containingObjectDefinition = containingObjectDefinition;
}
/// <summary>
/// Gets the reader context.
/// </summary>
/// <value>The reader context.</value>
public XmlReaderContext ReaderContext
{
get { return readerContext; }
}
/// <summary>
/// Gets the registry.
/// </summary>
/// <value>The registry.</value>
public IObjectDefinitionRegistry Registry
{
get { return readerContext.Registry; }
}
/// <summary>
/// Gets the parser helper.
/// </summary>
/// <value>The parser helper.</value>
public ObjectDefinitionParserHelper ParserHelper
{
get { return parserHelper; }
}
/// <summary>
/// Gets the containing object definition.
/// </summary>
/// <value>The containing object definition.</value>
public IObjectDefinition ContainingObjectDefinition
{
get { return containingObjectDefinition; }
}
/// <summary>
/// Gets a value indicating whether this instance is nested.
/// </summary>
/// <value><c>true</c> if this instance is nested; otherwise, <c>false</c>.</value>
public bool IsNested
{
get { return containingObjectDefinition != null; }
}
/// <summary>
/// Gets a value indicating whether this instance is default lazy init.
/// </summary>
/// <value>
/// <c>true</c> if this instance is default lazy init; otherwise, <c>false</c>.
/// </value>
public bool IsDefaultLazyInit
{
get { return ObjectDefinitionConstants.TrueValue.Equals(ParserHelper.Defaults.LazyInit); }
}
}
}
public ParserContext(XmlReaderContext readerContext, ObjectDefinitionParserHelper parserHelper, IObjectDefinition containingObjectDefinition)
{
this.readerContext = readerContext;
this.parserHelper = parserHelper;
this.containingObjectDefinition = containingObjectDefinition;
}
/// <summary>
/// Gets the reader context.
/// </summary>
/// <value>The reader context.</value>
public XmlReaderContext ReaderContext
{
get { return readerContext; }
}
/// <summary>
/// Gets the registry.
/// </summary>
/// <value>The registry.</value>
public IObjectDefinitionRegistry Registry
{
get { return readerContext.Registry; }
}
/// <summary>
/// Gets the parser helper.
/// </summary>
/// <value>The parser helper.</value>
public ObjectDefinitionParserHelper ParserHelper
{
get { return parserHelper; }
}
/// <summary>
/// Gets the containing object definition.
/// </summary>
/// <value>The containing object definition.</value>
public IObjectDefinition ContainingObjectDefinition
{
get { return containingObjectDefinition; }
}
/// <summary>
/// Gets a value indicating whether this instance is nested.
/// </summary>
/// <value><c>true</c> if this instance is nested; otherwise, <c>false</c>.</value>
public bool IsNested
{
get { return containingObjectDefinition != null; }
}
/// <summary>
/// Gets a value indicating whether this instance is default lazy init.
/// </summary>
/// <value>
/// <c>true</c> if this instance is default lazy init; otherwise, <c>false</c>.
/// </value>
public bool IsDefaultLazyInit
{
get { return ObjectDefinitionConstants.TrueValue.Equals(ParserHelper.Defaults.LazyInit); }
}
}
}

View File

@@ -43,7 +43,8 @@
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>618</NoWarn>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
@@ -65,7 +66,8 @@
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>618</NoWarn>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>

View File

@@ -32,7 +32,9 @@ namespace Spring.Util
{
internal delegate void PrivilegedCallback();
#pragma warning disable 618
[SecurityCritical, SecurityTreatAsSafe]
#pragma warning restore 618
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ExecutePrivileged(IStackWalk permission, PrivilegedCallback callback)
{

View File

@@ -47,12 +47,13 @@
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>3</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<UseVSHostingProcess>false</UseVSHostingProcess>
<WarningsAsErrors>0612</WarningsAsErrors>
<WarningsAsErrors>
</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Aop.Tests\Release\</OutputPath>
@@ -71,7 +72,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -43,7 +43,7 @@ namespace Spring.Context.Support
[ExpectedException(typeof (NoSuchMessageException))]
public void GetResolvableNullCodes()
{
IMessageSourceResolvable res = (IMessageSourceResolvable) mocks.CreateMock(typeof (IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.GetCodes()).Return(null);
Expect.Call(res.DefaultMessage).Return(null);
mocks.ReplayAll();
@@ -57,11 +57,11 @@ namespace Spring.Context.Support
string MSGCODE = "nullCode";
object[] MSGARGS = new object[] { "arg1", "arg2" };
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.GetArguments()).Return(MSGARGS);
Expect.Call(res.GetCodes()).Return(new string[] {MSGCODE}).Repeat.Once();
IMessageSource parentSource = (IMessageSource)mocks.CreateMock(typeof(IMessageSource));
IMessageSource parentSource = mocks.StrictMock<IMessageSource>();
Expect.Call(parentSource.GetMessage(MSGCODE, null, CultureInfo.CurrentCulture, MSGARGS)).Return(
"MockMessageSource");
ParentMessageSource = parentSource;
@@ -75,7 +75,7 @@ namespace Spring.Context.Support
public void GetMessageParentMessageSource()
{
object[] args = new object[] {"arguments"};
IMessageSource parentSource = (IMessageSource)mocks.CreateMock(typeof(IMessageSource));
IMessageSource parentSource = mocks.StrictMock<IMessageSource>();
Expect.Call(parentSource.GetMessage("null", null, CultureInfo.CurrentCulture, args)).Return(
"my parent message");
ParentMessageSource = parentSource;
@@ -87,7 +87,7 @@ namespace Spring.Context.Support
[Test]
public void GetMessageResolvableDefaultMessage()
{
IMessageSourceResolvable res = (IMessageSourceResolvable) mocks.CreateMock(typeof (IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.DefaultMessage).Return("MyDefaultMessage").Repeat.AtLeastOnce();
Expect.Call(res.GetCodes()).Return(null);
Expect.Call(res.GetArguments()).Return(null);
@@ -101,8 +101,8 @@ namespace Spring.Context.Support
[Test]
public void GetMessageResolvableReturnsFirstCode()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.DefaultMessage).Return(null).Repeat.AtLeastOnce();
Expect.Call(res.GetCodes()).Return(new string[] {"null"});
Expect.Call(res.GetArguments()).Return(null).Repeat.AtLeastOnce();
@@ -116,7 +116,7 @@ namespace Spring.Context.Support
[ExpectedException(typeof (NoSuchMessageException))]
public void GetMessageResolvableNoValidMessage()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.DefaultMessage).Return(null).Repeat.AtLeastOnce();
Expect.Call(res.GetCodes()).Return(null);
Expect.Call(res.GetArguments()).Return(null).Repeat.AtLeastOnce();
@@ -127,7 +127,7 @@ namespace Spring.Context.Support
[Test]
public void GetMessageResolvableValidMessageAndCode()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.GetCodes()).Return(new string[] {"code1"});
Expect.Call(res.GetArguments()).Return(new object[] { "my", "arguments" }).Repeat.AtLeastOnce();
mocks.ReplayAll();
@@ -138,7 +138,7 @@ namespace Spring.Context.Support
[Test]
public void GetMessageResolvableValidMessageAndCodeNullCulture()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.GetCodes()).Return(new string[] { "code1" });
Expect.Call(res.GetArguments()).Return(new object[] { "my", "arguments" }).Repeat.AtLeastOnce();
mocks.ReplayAll();
@@ -183,7 +183,7 @@ namespace Spring.Context.Support
[Test]
public void GetMessageWithResolvableArguments()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.GetCodes()).Return(new string[] { "code1" });
Expect.Call(res.GetArguments()).Return(new object[] { "my", "resolvable" }).Repeat.AtLeastOnce();
mocks.ReplayAll();
@@ -194,7 +194,7 @@ namespace Spring.Context.Support
[Test]
public void GetMessageResolvableValidMessageAndCodNullMessageFormat()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.DefaultMessage).Return("myDefaultMessage").Repeat.AtLeastOnce();
Expect.Call(res.GetCodes()).Return(new string[] { "nullCode" });
Expect.Call(res.GetArguments()).Return(null).Repeat.AtLeastOnce();

View File

@@ -85,9 +85,11 @@ namespace Spring.Context.Support
get { return new DateTime(); }
}
#pragma warning disable 67
public event ApplicationEventHandler ContextEvent;
#pragma warning restore 67
public long StartupDateMilliseconds
public long StartupDateMilliseconds
{
get { return 0; }
}

View File

@@ -87,7 +87,7 @@ namespace Spring.Context.Support
[Test]
public void DefaultResolvableFromExistingResolvable()
{
IMessageSourceResolvable res = (IMessageSourceResolvable)mocks.CreateMock(typeof(IMessageSourceResolvable));
IMessageSourceResolvable res = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(res.DefaultMessage).Return("defaultMessageFromMock").Repeat.AtLeastOnce();
Expect.Call(res.GetCodes()).Return(new string[] { "code1FromMock" });
Expect.Call(res.GetArguments()).Return(new object[] { "ArgumentFromMock" }).Repeat.AtLeastOnce();

View File

@@ -56,7 +56,7 @@ namespace Spring.Context.Support
public void SetUp()
{
mocks = new MockRepository();
_messageSource = (IMessageSource)mocks.CreateMock(typeof(IMessageSource));
_messageSource = mocks.StrictMock<IMessageSource>();
}
[Test]
@@ -181,8 +181,7 @@ namespace Spring.Context.Support
{
const string expectedName = "Rick Evans";
IMessageSourceResolvable resolvable =
(IMessageSourceResolvable) mocks.CreateMock(typeof (IMessageSourceResolvable));
IMessageSourceResolvable resolvable = mocks.StrictMock<IMessageSourceResolvable>();
Expect.Call(resolvable.DefaultMessage).Return(expectedName);
Expect.Call(resolvable.DefaultMessage).Return(expectedName);

View File

@@ -55,8 +55,8 @@ namespace Spring.Context.Support
public void SetUp()
{
mocks = new MockRepository();
mockMsgSource = (IMessageSource) mocks.CreateMock(typeof(IMessageSource));
mockMsgSourceResolvable = (IMessageSourceResolvable) mocks.CreateMock(typeof(IMessageSourceResolvable));
mockMsgSource = mocks.StrictMock<IMessageSource>();
mockMsgSourceResolvable = mocks.StrictMock<IMessageSourceResolvable>();
}
[TearDown]

View File

@@ -293,7 +293,7 @@ namespace Spring.Context.Support
public void GetResource()
{
//Add another resource manager to the list
Assembly ass = Assembly.LoadWithPartialName("Spring.Core.Tests");
Assembly ass = Assembly.Load("Spring.Core.Tests");
string baseName = "Spring" + "." + "Resources.Images";
resourceManagerList.Add(new ResourceManager(baseName, ass));
@@ -408,7 +408,7 @@ namespace Spring.Context.Support
public void TwoResourceManagers()
{
//Add another resource manager to the list
Assembly ass = Assembly.LoadWithPartialName("Spring.Core.Tests");
Assembly ass = Assembly.Load("Spring.Core.Tests");
string baseName = "Spring" + "." + "Resources.SampleResources";
resourceManagerList.Add(new ResourceManager(baseName, ass));

View File

@@ -67,7 +67,7 @@ namespace Spring.Globalization.Formatters
public void FiltersOnParseAndFormat()
{
MockRepository mocks = new MockRepository();
IFormatter underlyingFormatter = (IFormatter) mocks.CreateMock(typeof (IFormatter));
IFormatter underlyingFormatter = mocks.StrictMock<IFormatter>();
TestFilteringFormatter formatter = (TestFilteringFormatter) mocks.PartialMock(typeof (TestFilteringFormatter), underlyingFormatter);
string inputText = "inputText";

View File

@@ -92,10 +92,12 @@ namespace Spring.Objects.Events.Support.Tests
internal class SimpleEventPublisher
{
#pragma warning disable 67
public event Delegate1 MyFirstEvent;
public event Delegate2 MySecondEvent;
public event Delegate3 MyThirdEvent;
}
#pragma warning restore 67
}
internal class SimpleEventSubscriber
{

View File

@@ -46,7 +46,7 @@ namespace Spring.Objects.Factory.Config
[Test]
public void DisposeCallbackIsNotInvokedOnDisposeIfInPrototypeMode()
{
IDisposable disposable = (IDisposable) mocks.CreateMock(typeof (IDisposable));
IDisposable disposable = mocks.StrictMock<IDisposable>();
DummyFactoryObject factory = new DummyFactoryObject(disposable);
mocks.ReplayAll();
factory.IsSingleton = false;
@@ -59,7 +59,7 @@ namespace Spring.Objects.Factory.Config
[Test]
public void DisposeCallbackIsInvokedOnDispose()
{
IDisposable disposable = (IDisposable)mocks.CreateMock(typeof(IDisposable));
IDisposable disposable = mocks.StrictMock<IDisposable>();
disposable.Dispose();
LastCall.On(disposable).Repeat.Once();
DummyFactoryObject factory = new DummyFactoryObject(disposable);

View File

@@ -45,8 +45,7 @@ namespace Spring.Objects.Factory.Config
public void SetUp()
{
mocks = new MockRepository();
factory = (IConfigurableListableObjectFactory)
mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
factory = mocks.StrictMock<IConfigurableListableObjectFactory>();
}

View File

@@ -48,11 +48,11 @@ namespace Spring.Objects.Factory.Config
public void SunnyDay()
{
TestObject dude = new TestObject("Rick Evans", 30);
IObjectFactory objectFactory = (IObjectFactory) mocks.CreateMock(typeof (IObjectFactory));
IObjectFactory objectFactory = mocks.StrictMock<IObjectFactory>();
const string lookupObjectName = "rick";
Expect.Call(objectFactory.GetObject(lookupObjectName)).Return(dude).Repeat.Twice();
ObjectFactoryCreatingFactoryObject factory = new ObjectFactoryCreatingFactoryObject();
factory.ObjectFactory = (IObjectFactory) objectFactory;
factory.ObjectFactory = objectFactory;
factory.TargetObjectName = lookupObjectName;
factory.AfterPropertiesSet();
@@ -75,11 +75,11 @@ namespace Spring.Objects.Factory.Config
public void PrototypeModeWithSingletonTarget()
{
TestObject dude = new TestObject("Rick Evans", 30);
IObjectFactory objectFactory = (IObjectFactory)mocks.CreateMock(typeof(IObjectFactory));
IObjectFactory objectFactory = mocks.StrictMock<IObjectFactory>();
const string lookupObjectName = "rick";
Expect.Call(objectFactory.GetObject(lookupObjectName)).Return(dude).Repeat.Twice();
ObjectFactoryCreatingFactoryObject factory = new ObjectFactoryCreatingFactoryObject();
factory.ObjectFactory = (IObjectFactory) objectFactory;
factory.ObjectFactory = objectFactory;
factory.TargetObjectName = lookupObjectName;
factory.IsSingleton = false;
factory.AfterPropertiesSet();

View File

@@ -42,7 +42,7 @@ namespace Spring.Objects.Factory.Config
public void SetUp()
{
mocks = new MockRepository();
factory = (IObjectFactory) mocks.CreateMock(typeof(IObjectFactory));
factory = mocks.StrictMock<IObjectFactory>();
}
[Test]

View File

@@ -144,9 +144,8 @@ namespace Spring.Objects.Factory.Config
[Test]
public void MalformedOverrideKey()
{
IConfigurableListableObjectFactory objectFactory =
(IConfigurableListableObjectFactory) mocks.CreateMock(typeof (IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory fac = (IConfigurableListableObjectFactory) objectFactory;
IConfigurableListableObjectFactory objectFactory = mocks.StrictMock<IConfigurableListableObjectFactory>();
IConfigurableListableObjectFactory fac = objectFactory;
PropertyOverrideConfigurer cfg = new PropertyOverrideConfigurer();
NameValueCollection defaultProperties = new NameValueCollection();
@@ -169,10 +168,9 @@ namespace Spring.Objects.Factory.Config
{
const string valueTo_NOT_BeOveridden = "Jenny Lewis";
TestObject foo = new TestObject(valueTo_NOT_BeOveridden, 30);
IConfigurableListableObjectFactory objectFactory =
(IConfigurableListableObjectFactory)mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory objectFactory = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(objectFactory.GetObjectDefinition("rubbish")).Return(null);
IConfigurableListableObjectFactory fac = (IConfigurableListableObjectFactory) objectFactory;
IConfigurableListableObjectFactory fac = objectFactory;
PropertyOverrideConfigurer cfg = new PropertyOverrideConfigurer();
NameValueCollection defaultProperties = new NameValueCollection();

View File

@@ -43,7 +43,7 @@ namespace Spring.Objects.Factory.Config
public void SetUp()
{
mocks = new MockRepository();
mockFactory = (IObjectFactory) mocks.CreateMock(typeof (IObjectFactory));
mockFactory = mocks.StrictMock<IObjectFactory>();
}
[Test]

View File

@@ -59,7 +59,7 @@ namespace Spring.Objects.Factory.Config
public void MismatchBetweenNumberOfConfigNamesAndNumberOfLocations()
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.Locations = new IResource[] { (IResource) mocks.CreateMock(typeof(IResource)) }; // will never get to the point where we check the validity
cfg.Locations = new IResource[] { mocks.StrictMock<IResource>() }; // will never get to the point where we check the validity
cfg.ConfigSections = new string[] { "", "" };
cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
}
@@ -69,7 +69,7 @@ namespace Spring.Objects.Factory.Config
public void OneConfigNameIsOKForLotsOfLocations()
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
IResource mock = (IResource) mocks.CreateMock(typeof(IResource));
IResource mock = mocks.StrictMock<IResource>();
Expect.Call(mock.Exists).Return(true);
Expect.Call(mock.InputStream).Throw(new FileNotFoundException());
mocks.ReplayAll();
@@ -85,7 +85,7 @@ namespace Spring.Objects.Factory.Config
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.IgnoreResourceNotFound = false;
IResource mock = (IResource) mocks.CreateMock(typeof(IResource));
IResource mock = mocks.StrictMock<IResource>();
Expect.Call(mock.Exists).Return(false);
mocks.ReplayAll();
@@ -99,7 +99,7 @@ namespace Spring.Objects.Factory.Config
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.IgnoreResourceNotFound = true;
IResource mockResource = (IResource) mocks.CreateMock(typeof(IResource));
IResource mockResource = mocks.StrictMock<IResource>();
Expect.Call(mockResource.Exists).Return(false);
cfg.Location = mockResource;
cfg.ConfigSections = new string[] { "" };
@@ -147,7 +147,7 @@ namespace Spring.Objects.Factory.Config
pvs.Add(theProperty, placeholder);
RootObjectDefinition def = new RootObjectDefinition(typeof(TestObject), pvs);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory) mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(false)).Return(new string [] {defName});
Expect.Call(mock.GetObjectDefinition(defName, false)).Return(def);
Expect.Call(delegate { mock.AddEmbeddedValueResolver(null); }).IgnoreArguments();
@@ -177,7 +177,7 @@ namespace Spring.Objects.Factory.Config
pvs.Add(theProperty, placeholder);
RootObjectDefinition def = new RootObjectDefinition(typeof(TestObject), pvs);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory)mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(true)).Return(new string[] { defName });
Expect.Call(mock.GetObjectDefinition(defName, true)).Return(def);
Expect.Call(delegate { mock.AddEmbeddedValueResolver(null); }).IgnoreArguments();
@@ -421,7 +421,7 @@ namespace Spring.Objects.Factory.Config
const string expectedName = "ba${foo}r";
properties.Add("foo", expectedName);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory) mocks.CreateMock(typeof (IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(false)).Return(new string[] {"foo"});
Expect.Call(mock.GetObjectDefinition(null, false)).IgnoreArguments().Return(def);
mocks.ReplayAll();
@@ -452,7 +452,7 @@ namespace Spring.Objects.Factory.Config
const string expectedName = "Rick";
properties.Add("hope.floats", expectedName);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory) mocks.CreateMock(typeof (IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(false)).Return(new string[] {"foo"});
Expect.Call(mock.GetObjectDefinition(null, false)).IgnoreArguments().Return(def);
Expect.Call(delegate { mock.AddEmbeddedValueResolver(null); }).IgnoreArguments();
@@ -482,7 +482,7 @@ namespace Spring.Objects.Factory.Config
const string expectedName = "Rick";
properties.Add("hope.floats", expectedName);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory) mocks.CreateMock(typeof (IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(false)).Return(new string[] {"foo"});
Expect.Call(mock.GetObjectDefinition(null, false)).IgnoreArguments().Return(def);
Expect.Call(delegate { mock.AddEmbeddedValueResolver(null); }).IgnoreArguments();
@@ -580,7 +580,7 @@ namespace Spring.Objects.Factory.Config
pvs.Add("name", placeholder);
RootObjectDefinition def = new RootObjectDefinition(typeof(TestObject), pvs);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory) mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(false)).Return(new string [] {defName});
Expect.Call(mock.GetObjectDefinition(defName, false)).Return(def);
Expect.Call(delegate { mock.AddEmbeddedValueResolver(null); }).IgnoreArguments();

View File

@@ -114,7 +114,7 @@ namespace Spring.Objects.Factory.Config
DefaultListableObjectFactory of = new DefaultListableObjectFactory();
MockRepository mocks = new MockRepository();
ISharedStateFactory ssf1 = (ISharedStateFactory)mocks.CreateMock( typeof( ISharedStateFactory ) );
ISharedStateFactory ssf1 = mocks.StrictMock<ISharedStateFactory>();
ISharedStateAware ssa = (ISharedStateAware)mocks.DynamicMock( typeof( ISharedStateAware ) );
SharedStateAwareProcessor ssap = new SharedStateAwareProcessor();
@@ -140,10 +140,10 @@ namespace Spring.Objects.Factory.Config
DefaultListableObjectFactory of = new DefaultListableObjectFactory();
MockRepository mocks = new MockRepository();
ISharedStateFactory ssf1 = (ISharedStateFactory)mocks.CreateMock( typeof( ISharedStateFactory ) );
ISharedStateFactory ssf2 = (ISharedStateFactory)mocks.CreateMock( typeof( ISharedStateFactory ) );
ISharedStateFactory ssf3 = (ISharedStateFactory)mocks.CreateMock( typeof( ISharedStateFactory ) );
ISharedStateFactory ssf4 = (ISharedStateFactory)mocks.CreateMock( typeof( ISharedStateFactory ) );
ISharedStateFactory ssf1 = mocks.StrictMock<ISharedStateFactory>();
ISharedStateFactory ssf2 = mocks.StrictMock<ISharedStateFactory>();
ISharedStateFactory ssf3 = mocks.StrictMock<ISharedStateFactory>();
ISharedStateFactory ssf4 = mocks.StrictMock<ISharedStateFactory>();
IDictionary ssf3ProvidedState = new Hashtable();
SharedStateAwareProcessor ssap = new SharedStateAwareProcessor();

View File

@@ -44,8 +44,7 @@ namespace Spring.Objects.Factory.Config
public void SetUp()
{
mocks = new MockRepository();
factory = (IConfigurableListableObjectFactory)
mocks.CreateMock(typeof (IConfigurableListableObjectFactory));
factory = mocks.StrictMock<IConfigurableListableObjectFactory>();
}
[Test]

View File

@@ -301,7 +301,7 @@ namespace Spring.Objects.Factory.Config
pvs.Add(theProperty, placeholder);
RootObjectDefinition def = new RootObjectDefinition(typeof(TestObject), pvs);
IConfigurableListableObjectFactory mock = (IConfigurableListableObjectFactory)mocks.CreateMock(typeof(IConfigurableListableObjectFactory));
IConfigurableListableObjectFactory mock = mocks.StrictMock<IConfigurableListableObjectFactory>();
Expect.Call(mock.GetObjectDefinitionNames(true)).Return(new string[] { defName });
Expect.Call(mock.GetObjectDefinition(defName, true)).Return(def);
mocks.ReplayAll();

View File

@@ -293,8 +293,8 @@ namespace Spring.Objects.Factory
[Test]
public void GetObjectPostProcessorCount()
{
IObjectPostProcessor proc1 = (IObjectPostProcessor) mocks.CreateMock(typeof (IObjectPostProcessor));
IObjectPostProcessor proc2 = (IObjectPostProcessor)mocks.CreateMock(typeof(IObjectPostProcessor));
IObjectPostProcessor proc1 = mocks.StrictMock<IObjectPostProcessor>();
IObjectPostProcessor proc2 = mocks.StrictMock<IObjectPostProcessor>();
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
@@ -316,8 +316,8 @@ namespace Spring.Objects.Factory
public void GetObjectPostProcessorCountDoesntRespectHierarchy()
{
IObjectPostProcessor proc1 = (IObjectPostProcessor)mocks.CreateMock(typeof(IObjectPostProcessor));
IObjectPostProcessor proc2 = (IObjectPostProcessor)mocks.CreateMock(typeof(IObjectPostProcessor));
IObjectPostProcessor proc1 = mocks.StrictMock<IObjectPostProcessor>();
IObjectPostProcessor proc2 = mocks.StrictMock<IObjectPostProcessor>();
DefaultListableObjectFactory child = new DefaultListableObjectFactory();
DefaultListableObjectFactory parent = new DefaultListableObjectFactory(child);
@@ -1664,7 +1664,7 @@ namespace Spring.Objects.Factory
[Test]
public void IgnoreObjectPostProcessorDuplicates()
{
IObjectPostProcessor proc1 = (IObjectPostProcessor)mocks.CreateMock(typeof(IObjectPostProcessor));
IObjectPostProcessor proc1 = mocks.StrictMock<IObjectPostProcessor>();
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();

View File

@@ -48,7 +48,7 @@ namespace Spring.Objects.Factory
{
string expectedName = "bing";
string expectedResourceDescription = "mock.resource";
IResource resource = (IResource) mocks.CreateMock(typeof (IResource));
IResource resource = mocks.StrictMock<IResource>();
Expect.Call(resource.Description).Return(expectedResourceDescription);
mocks.ReplayAll();
ObjectDefinitionStoreException inex

View File

@@ -48,7 +48,7 @@ namespace Spring.Objects.Factory.Support
[ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullDefinition()
{
IObjectFactory factory = (IObjectFactory) mocks.CreateMock(typeof (IObjectFactory));
IObjectFactory factory = mocks.StrictMock<IObjectFactory>();
new DelegatingMethodReplacer(null, factory);
}
@@ -56,17 +56,16 @@ namespace Spring.Objects.Factory.Support
[ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullFactory()
{
IConfigurableObjectDefinition mock = (IConfigurableObjectDefinition)
mocks.CreateMock(typeof(IConfigurableObjectDefinition));
IConfigurableObjectDefinition mock = mocks.StrictMock<IConfigurableObjectDefinition>();
new DelegatingMethodReplacer(mock, null);
}
[Test]
public void SunnyDayPath()
{
IObjectFactory mockFactory = (IObjectFactory) mocks.CreateMock(typeof(IObjectFactory));
IConfigurableObjectDefinition mockDefinition = (IConfigurableObjectDefinition) mocks.CreateMock(typeof(IConfigurableObjectDefinition));
IMethodReplacer mockReplacer = (IMethodReplacer) mocks.CreateMock(typeof(IMethodReplacer));
IObjectFactory mockFactory = mocks.StrictMock<IObjectFactory>();
IConfigurableObjectDefinition mockDefinition = mocks.StrictMock<IConfigurableObjectDefinition>();
IMethodReplacer mockReplacer = mocks.StrictMock<IMethodReplacer>();
const string ReplacerObjectName = "replacer";

View File

@@ -48,7 +48,7 @@ namespace Spring.Objects.Factory.Support
[ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullDefinition()
{
IObjectFactory objectFactory = (IObjectFactory) mocks.CreateMock(typeof (IObjectFactory));
IObjectFactory objectFactory = mocks.StrictMock<IObjectFactory>();
new LookupMethodReplacer(null, objectFactory);
}
@@ -56,17 +56,15 @@ namespace Spring.Objects.Factory.Support
[ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullFactory()
{
IConfigurableObjectDefinition configurableObjectDefinition =
(IConfigurableObjectDefinition) mocks.CreateMock(typeof (IConfigurableObjectDefinition));
var configurableObjectDefinition = mocks.StrictMock<IConfigurableObjectDefinition>();
new LookupMethodReplacer(configurableObjectDefinition, null);
}
[Test]
public void SunnyDayPath()
{
IObjectFactory objectFactory = (IObjectFactory)mocks.CreateMock(typeof(IObjectFactory));
IConfigurableObjectDefinition configurableObjectDefinition =
(IConfigurableObjectDefinition)mocks.CreateMock(typeof(IConfigurableObjectDefinition));
var objectFactory = mocks.StrictMock<IObjectFactory>();
var configurableObjectDefinition = mocks.StrictMock<IConfigurableObjectDefinition>();
object expectedLookup = new object();
const string LookupObjectName = "foo";

View File

@@ -44,11 +44,8 @@ namespace Spring.Objects.Factory.Support
public void SetUp()
{
mocks = new MockRepository();
registry = (IObjectDefinitionRegistry)
mocks.CreateMock(typeof(IObjectDefinitionRegistry));
definition = (IObjectDefinition)
mocks.CreateMock(typeof (IObjectDefinition));
registry = mocks.StrictMock<IObjectDefinitionRegistry>();
definition = mocks.StrictMock<IObjectDefinition>();
}
[Test]
@@ -138,9 +135,7 @@ namespace Spring.Objects.Factory.Support
[ExpectedException(typeof (ArgumentNullException))]
public void GenerateObjectNameWithNullRegistry()
{
ObjectDefinitionReaderUtils.GenerateObjectName(
(IConfigurableObjectDefinition) mocks.CreateMock(typeof(IConfigurableObjectDefinition)),
null);
ObjectDefinitionReaderUtils.GenerateObjectName(mocks.StrictMock<IConfigurableObjectDefinition>(), null);
}
}
}

View File

@@ -860,7 +860,9 @@ namespace Spring.Proxy
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
[Marker]
#pragma warning disable 618
[WebPermission(SecurityAction.Deny)]
#pragma warning restore 618
public class ClassWithSecurityAttribute : IMarkerInterface
{
}

View File

@@ -29,6 +29,8 @@ using Spring.Context.Support;
#endregion
#pragma warning disable 618
namespace Spring.Reflection.Dynamic
{
/// <summary>
@@ -152,3 +154,4 @@ namespace Spring.Reflection.Dynamic
}
}
#pragma warning restore 618

View File

@@ -1,19 +1,19 @@
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
@@ -33,6 +33,8 @@ using System.Threading;
using System.Web;
using System.Web.Configuration;
#pragma warning disable 618
namespace Spring
{
/// <summary>
@@ -517,3 +519,4 @@ namespace Spring
// }
}
}
#pragma warning restore 618

View File

@@ -43,11 +43,12 @@
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>67, 618</NoWarn>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
@@ -67,11 +68,12 @@
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>618</NoWarn>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -88,7 +88,7 @@ namespace Spring
public static Uri GetUri(object context, string ext)
{
string resname = context.GetType().AssemblyQualifiedName + "#" + ext;
Uri uri = new Uri("testres://inline/" + resname, false);
Uri uri = new Uri("testres://inline/" + resname);
return uri;
}

View File

@@ -14,7 +14,7 @@ namespace Spring.Threading
public void SetUp ()
{
mocks = new MockRepository();
sync = (ISync) mocks.CreateMock(typeof(ISync));
sync = mocks.StrictMock<ISync>();
}
[TearDown]

View File

@@ -55,7 +55,9 @@ namespace Spring.Validation
XmlReaderContext readerContext = new XmlReaderContext(null, new XmlObjectDefinitionReader(registry));
ObjectDefinitionParserHelper helper = new ObjectDefinitionParserHelper(readerContext);
helper.InitDefaults(doc.DocumentElement);
#pragma warning disable 618
ParserContext parserContext = new ParserContext(helper.ReaderContext, helper);
#pragma warning restore 618
ValidationNamespaceParser parser = new ValidationNamespaceParser();
foreach (XmlElement element in doc.DocumentElement.ChildNodes)
@@ -162,7 +164,9 @@ namespace Spring.Validation
XmlReaderContext readerContext = new XmlReaderContext(null, new XmlObjectDefinitionReader(registry));
ObjectDefinitionParserHelper helper = new ObjectDefinitionParserHelper(readerContext);
helper.InitDefaults(doc.DocumentElement);
#pragma warning disable 618
ParserContext parserContext = new ParserContext(helper.ReaderContext, helper);
#pragma warning restore 618
ValidationNamespaceParser parser = new ValidationNamespaceParser();
foreach (XmlElement element in doc.DocumentElement.ChildNodes)

View File

@@ -70,7 +70,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -79,12 +79,12 @@ namespace Spring.Data.NHibernate
[Test]
public void TransactionCommit()
{
IDbProvider provider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction) mocks.CreateMock(typeof (ITransaction));
IQuery query = (IQuery) mocks.CreateMock(typeof (IQuery));
IDbProvider provider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IQuery query = mocks.StrictMock<IQuery>();
IList list = new ArrayList();
list.Add("test");
@@ -143,12 +143,12 @@ namespace Spring.Data.NHibernate
public void TransactionRollback()
{
IDbProvider provider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbTransaction adoTransaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider provider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IDbTransaction adoTransaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -194,11 +194,11 @@ namespace Spring.Data.NHibernate
[Test]
public void TransactionRollbackOnly()
{
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbTransaction adoTransaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IDbTransaction adoTransaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -239,10 +239,10 @@ namespace Spring.Data.NHibernate
[Test]
public void ParticipatingTransactionWithCommit()
{
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory) mocks.CreateMock(typeof (ISessionFactory));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
ITransaction transaction = (ITransaction) mocks.CreateMock(typeof (ITransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
using (mocks.Ordered())
{
@@ -277,11 +277,11 @@ namespace Spring.Data.NHibernate
[Test]
public void ParticipatingTransactionWithRollback()
{
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory) mocks.CreateMock(typeof (ISessionFactory));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
ITransaction transaction = (ITransaction) mocks.CreateMock(typeof (ITransaction));
IDbTransaction adoTransaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IDbTransaction adoTransaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -322,11 +322,11 @@ namespace Spring.Data.NHibernate
[Test]
public void ParticipatingTransactionWithRollbackOnly()
{
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbTransaction adoTransaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IDbTransaction adoTransaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -368,11 +368,11 @@ namespace Spring.Data.NHibernate
[Test]
public void ParticipatingTransactionWithWithRequiresNew()
{
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session1 = (ISession)mocks.CreateMock(typeof(ISession));
ISession session2 = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session1 = mocks.StrictMock<ISession>();
ISession session2 = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
//using (mocks.Ordered())
//{
@@ -418,10 +418,10 @@ namespace Spring.Data.NHibernate
[Test]
public void ParticipatingTransactionWithWithNotSupported()
{
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
//using (mocks.Ordered())
//{
@@ -461,8 +461,8 @@ namespace Spring.Data.NHibernate
[Test]
public void TransactionWithPropagationSupports()
{
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
Expect.Call(sessionFactory.OpenSession()).Return(session);
Expect.Call(session.FlushMode).Return(FlushMode.Never);
@@ -500,11 +500,11 @@ namespace Spring.Data.NHibernate
[Test]
public void TransactionWithPropagationSupportsAndInnerTransaction()
{
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session1 = (ISession)mocks.CreateMock(typeof(ISession));
ISession session2 = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session1 = mocks.StrictMock<ISession>();
ISession session2 = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
Expect.Call(sessionFactory.OpenSession()).Return(session1);
Expect.Call(session1.Connection).Return(connection);
@@ -586,11 +586,11 @@ namespace Spring.Data.NHibernate
#region Mock Setup
IDbProvider provider = new TestDbProvider();
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
ISessionFactory sessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ITransaction transaction = (ITransaction)mocks.CreateMock(typeof(ITransaction));
IDbTransaction adoTransaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
ISession session = mocks.StrictMock<ISession>();
ITransaction transaction = mocks.StrictMock<ITransaction>();
IDbTransaction adoTransaction = mocks.StrictMock<IDbTransaction>();
Exception rootCause = null;
using (mocks.Ordered())

View File

@@ -46,7 +46,7 @@ namespace Spring.Data.NHibernate.Support
// setup expected values
MockRepository mocks = new MockRepository();
ISessionFactory expectedSessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISessionFactory expectedSessionFactory = mocks.StrictMock<ISessionFactory>();
IInterceptor expectedEntityInterceptor = null;
bool expectedSingleSession = SessionScopeSettings.SINGLESESSION_DEFAULT;
FlushMode expectedDefaultFlushMode = SessionScopeSettings.FLUSHMODE_DEFAULT;
@@ -73,8 +73,8 @@ namespace Spring.Data.NHibernate.Support
string ENTITYINTERCEPTOR_OBJECTNAME = "EntityInterceptor";
MockRepository mocks = new MockRepository();
ISessionFactory expectedSessionFactory = (ISessionFactory) mocks.CreateMock(typeof(ISessionFactory));
IInterceptor expectedEntityInterceptor = (IInterceptor) mocks.CreateMock(typeof(IInterceptor));
ISessionFactory expectedSessionFactory = mocks.StrictMock<ISessionFactory>();
IInterceptor expectedEntityInterceptor = mocks.StrictMock<IInterceptor>();
bool expectedSingleSession = false;
FlushMode expectedDefaultFlushMode = FlushMode.Auto;

View File

@@ -81,8 +81,8 @@ namespace Spring.Data.NHibernate.Support
public void WorksAsExpected()
{
MockRepository mocks = new MockRepository();
ISessionFactory sessionFactory = (ISessionFactory) mocks.CreateMock(typeof(ISessionFactory));
IInterceptor entityInterceptor = (IInterceptor) mocks.CreateMock(typeof(IInterceptor));
ISessionFactory sessionFactory = mocks.StrictMock<ISessionFactory>();
IInterceptor entityInterceptor = mocks.StrictMock<IInterceptor>();
Assert.AreNotEqual( FlushMode.Auto, SessionScopeSettings.FLUSHMODE_DEFAULT ); // ensure noone changed our assumptions
SessionScopeSettings sss = new SessionScopeSettings(sessionFactory, entityInterceptor, !SessionScopeSettings.SINGLESESSION_DEFAULT, FlushMode.Auto );
@@ -115,8 +115,8 @@ namespace Spring.Data.NHibernate.Support
public void CallingDefaultConstructorCausesLazyResolvingReferences()
{
MockRepository mocks = new MockRepository();
ISessionFactory expectedSessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
IInterceptor expectedEntityInterceptor = (IInterceptor)mocks.CreateMock(typeof(IInterceptor));
ISessionFactory expectedSessionFactory = mocks.StrictMock<ISessionFactory>();
IInterceptor expectedEntityInterceptor = mocks.StrictMock<IInterceptor>();
SessionScopeSettings sss = new LazyResolvingSessionScopeSettings(expectedSessionFactory, expectedEntityInterceptor);
@@ -145,7 +145,7 @@ namespace Spring.Data.NHibernate.Support
public void MissingEntityInterceptorIsOkDuringLazyResolving()
{
MockRepository mocks = new MockRepository();
ISessionFactory expectedSessionFactory = (ISessionFactory)mocks.CreateMock(typeof(ISessionFactory));
ISessionFactory expectedSessionFactory = mocks.StrictMock<ISessionFactory>();
SessionScopeSettings sss = new LazyResolvingSessionScopeSettings(expectedSessionFactory, null);

View File

@@ -37,7 +37,7 @@ namespace Spring.Data.NHibernate.Support
[TestFixture]
public class SessionScopeTests
{
private MockRepository repository;
private MockRepository mocks;
private ISessionFactory expectedSessionFactory;
private IInterceptor expectedEntityInterceptor;
private bool expectedSingleSession;
@@ -46,9 +46,9 @@ namespace Spring.Data.NHibernate.Support
[SetUp]
public void SetUp()
{
repository = new MockRepository();
expectedSessionFactory = (ISessionFactory)repository.CreateMock(typeof(ISessionFactory));
expectedEntityInterceptor = (IInterceptor)repository.CreateMock(typeof(IInterceptor));
mocks = new MockRepository();
expectedSessionFactory = mocks.StrictMock<ISessionFactory>();
expectedEntityInterceptor = mocks.StrictMock<IInterceptor>();
expectedSingleSession = SessionScopeSettings.SINGLESESSION_DEFAULT;
expectedDefaultFlushMode = SessionScopeSettings.FLUSHMODE_DEFAULT;
}
@@ -74,14 +74,14 @@ namespace Spring.Data.NHibernate.Support
[Test]
public void CanCreateAndCloseSimpleCtor()
{
using (repository.Ordered())
using (mocks.Ordered())
{
ISession session = (ISession) repository.CreateMock(typeof (ISession));
ISession session = mocks.StrictMock<ISession>();
Expect.Call(expectedSessionFactory.OpenSession()).Return(session);
session.FlushMode = FlushMode.Never;
Expect.Call(session.Close()).Return(null);
}
repository.ReplayAll();
mocks.ReplayAll();
using (SessionScope scope = new SessionScope(expectedSessionFactory, true))
{
// no op - just create & dispose
@@ -99,7 +99,7 @@ namespace Spring.Data.NHibernate.Support
Assert.IsNotNull(sessionHolder.Session);
scope.Close();
}
repository.VerifyAll();
mocks.VerifyAll();
}
[Test]
@@ -208,12 +208,12 @@ namespace Spring.Data.NHibernate.Support
[Test]
public void SingleSessionAppliesDefaultFlushModeOnOpenSessionAndClosesSession()
{
ISession expectedSession = (ISession)repository.CreateMock(typeof(ISession));
ISession expectedSession = mocks.StrictMock<ISession>();
Expect.Call(expectedSessionFactory.OpenSession()).Return(expectedSession);
expectedSession.FlushMode = FlushMode.Auto;
Expect.Call(expectedSession.Close()).Return(null);
repository.ReplayAll();
mocks.ReplayAll();
SessionScope scope = null;
using (scope = new SessionScope(expectedSessionFactory, null, true, FlushMode.Auto, true))
@@ -225,7 +225,7 @@ namespace Spring.Data.NHibernate.Support
Assert.IsFalse(scope.IsOpen);
Assert.IsFalse(TransactionSynchronizationManager.HasResource(expectedSessionFactory));
repository.VerifyAll();
mocks.VerifyAll();
}
[Test]
@@ -286,13 +286,13 @@ namespace Spring.Data.NHibernate.Support
public void ResolvesEntityInterceptorOnEachOpen()
{
TestSessionScopeSettings sss =
(TestSessionScopeSettings)repository.PartialMock(typeof(TestSessionScopeSettings), expectedSessionFactory);
ISession expectedSession = (ISession)repository.CreateMock(typeof(ISession));
(TestSessionScopeSettings)mocks.PartialMock(typeof(TestSessionScopeSettings), expectedSessionFactory);
ISession expectedSession = mocks.StrictMock<ISession>();
sss.DefaultFlushMode = FlushMode.Never;
SessionScope sc = new SessionScope(sss, false);
using (repository.Ordered())
using (mocks.Ordered())
{
Expect.Call(sss.DoResolveEntityInterceptor()).Return(expectedEntityInterceptor);
Expect.Call(expectedSessionFactory.OpenSession(expectedEntityInterceptor)).Return(expectedSession);
@@ -304,7 +304,7 @@ namespace Spring.Data.NHibernate.Support
expectedSession.FlushMode = FlushMode.Never;
Expect.Call(expectedSession.Close()).Return(null);
}
repository.ReplayAll();
mocks.ReplayAll();
sc.Open();
SessionHolder sessionHolder = (SessionHolder)TransactionSynchronizationManager.GetResource(expectedSessionFactory);
@@ -316,7 +316,7 @@ namespace Spring.Data.NHibernate.Support
sessionHolder.ContainsSession(null); // force opening session
sc.Close();
repository.VerifyAll();
mocks.VerifyAll();
}
}

View File

@@ -40,6 +40,7 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +49,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -40,6 +40,7 @@
<DefineConstants>TRACE;DEBUG;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +49,7 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.1.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -40,6 +40,7 @@
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +49,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -40,6 +40,7 @@
<DefineConstants>TRACE;DEBUG;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +49,7 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.1.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -67,8 +67,8 @@ namespace Spring.Data
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -108,8 +108,8 @@ namespace Spring.Data
#region Mock Setup
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -158,8 +158,8 @@ namespace Spring.Data
public void ParticipatingTransactionWithRollbackOnly()
{
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -232,8 +232,8 @@ namespace Spring.Data
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
Expect.Call(dbProvider.CreateConnection()).Return(connection).Repeat.Twice();
connection.Open();
@@ -274,8 +274,8 @@ namespace Spring.Data
public void PropagationRequiresNewWithExistingTransactionAndUnrelatedDataSource()
{
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
Expect.Call(dbProvider.CreateConnection()).Return(connection);
connection.Open();
@@ -286,8 +286,8 @@ namespace Spring.Data
connection.Dispose();
IDbProvider dbProvider2 = (IDbProvider) mocks.CreateMock(typeof (IDbProvider));
IDbConnection connection2 = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction transaction2 = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbConnection connection2 = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction2 = mocks.StrictMock<IDbTransaction>();
Expect.Call(dbProvider2.CreateConnection()).Return(connection2);
connection2.Open();
@@ -328,9 +328,9 @@ namespace Spring.Data
public void PropagationRequiresNewWithExistingTransactionAndUnrelatedFailingDataSource()
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
Expect.Call(dbProvider.CreateConnection()).Return(connection);
connection.Open();
@@ -340,8 +340,8 @@ namespace Spring.Data
LastCall.On(transaction).Repeat.Once();
connection.Dispose();
IDbProvider dbProvider2 = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection2 = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider2 = mocks.StrictMock<IDbProvider>();
IDbConnection connection2 = mocks.StrictMock<IDbConnection>();
Expect.Call(dbProvider2.CreateConnection()).Return(connection2);
connection2.Open();
@@ -386,9 +386,9 @@ namespace Spring.Data
public void PropagationNotSupportedWithExistingTransaction()
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -422,9 +422,9 @@ namespace Spring.Data
public void PropagationNeverWithExistingTransaction()
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -468,16 +468,16 @@ namespace Spring.Data
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
Expect.Call(dbProvider.CreateConnection()).Return(connection);
connection.Open();
LastCall.On(connection).Repeat.Once();
connection.Dispose();
IDbConnection connection2 = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction2 = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbConnection connection2 = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction2 = mocks.StrictMock<IDbTransaction>();
Expect.Call(dbProvider.CreateConnection()).Return(connection2);
connection2.Open();
@@ -511,9 +511,9 @@ namespace Spring.Data
public void TransactionWithIsolation()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -562,10 +562,10 @@ namespace Spring.Data
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbCommand command = (IDbCommand) mocks.CreateMock(typeof (IDbCommand));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
IDbCommand command = mocks.StrictMock<IDbCommand>();
using (mocks.Ordered())
{
@@ -628,7 +628,7 @@ namespace Spring.Data
public void TransactionWithExceptionOnBegin()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
// CreateConnection is called in AdoPlatformTransactionManager.DoBegin
Expect.Call(dbProvider.CreateConnection()).Throw(new TestSqlException("Cannot begin", "314"));
@@ -665,9 +665,9 @@ namespace Spring.Data
public void TransactionWithExceptionOnCommit()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -708,9 +708,9 @@ namespace Spring.Data
public void TransactionWithExceptionOnCommitAndRollbackOnCommitFailure()
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -754,9 +754,9 @@ namespace Spring.Data
{
#region Mock Setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -804,7 +804,7 @@ namespace Spring.Data
[Test]
public void TransactionWithPropagationSupports()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
mocks.ReplayAll();
@@ -825,7 +825,7 @@ namespace Spring.Data
[Test]
public void TransactionWithPropagationNotSupported()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
mocks.ReplayAll();
@@ -846,7 +846,7 @@ namespace Spring.Data
[Test]
public void TransactionWithPropagationNever()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
mocks.ReplayAll();
@@ -868,9 +868,9 @@ namespace Spring.Data
public void ExistingTransactionWithPropagationNestedNotSupported()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -914,9 +914,9 @@ namespace Spring.Data
public void TransactionWithPropagationNested()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{
@@ -962,9 +962,9 @@ namespace Spring.Data
public void TransactionWithPropagationNestedAndRollback()
{
#region Mock setup
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbTransaction transaction = (IDbTransaction)mocks.CreateMock(typeof(IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
IDbTransaction transaction = mocks.StrictMock<IDbTransaction>();
using (mocks.Ordered())
{

View File

@@ -200,8 +200,8 @@ namespace Spring.Data.Common
[Test]
public void CreateOperations()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection mockConnection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection mockConnection = mocks.StrictMock<IDbConnection>();
Expect.Call(dbProvider.CreateConnection()).Return(mockConnection).Repeat.Once();
IDbCommand mockCommand = (IDbCommand)mocks.CreateMock(typeof(IDbCommand));

View File

@@ -46,8 +46,8 @@ namespace Spring.Data.Common
[Test]
public void StaticCredentials()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
using (mocks.Ordered())
{
Expect.Call(dbProvider.CreateConnection()).Return(connection);
@@ -70,8 +70,8 @@ namespace Spring.Data.Common
[Test]
public void NoCredentials()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
using (mocks.Ordered())
{
Expect.Call(dbProvider.CreateConnection()).Return(connection);
@@ -89,8 +89,8 @@ namespace Spring.Data.Common
[Test]
public void ThreadBoundCredentials()
{
IDbProvider dbProvider = (IDbProvider)mocks.CreateMock(typeof(IDbProvider));
IDbConnection connection = (IDbConnection)mocks.CreateMock(typeof(IDbConnection));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection connection = mocks.StrictMock<IDbConnection>();
using (mocks.Ordered())
{
Expect.Call(dbProvider.CreateConnection()).Return(connection);

View File

@@ -42,6 +42,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -51,6 +52,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Apache.NMS, Version=1.1.0.1642, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">

View File

@@ -117,7 +117,7 @@ namespace Spring.Messaging.Nms.Config
Assert.IsNull(testObject3.Message);
ITextMessage message1 = (ITextMessage) mocks.CreateMock(typeof (ITextMessage));
ITextMessage message1 = mocks.StrictMock<ITextMessage>();
Expect.Call(message1.Text).Return("Test1");
mocks.Replay(message1);
@@ -127,7 +127,7 @@ namespace Spring.Messaging.Nms.Config
mocks.Verify(message1);
ITextMessage message2 = (ITextMessage)mocks.CreateMock(typeof(ITextMessage));
ITextMessage message2 = mocks.StrictMock<ITextMessage>();
Expect.Call(message2.Text).Return("Test1");
mocks.Replay(message2);
@@ -136,7 +136,7 @@ namespace Spring.Messaging.Nms.Config
mocks.Verify(message2);
ITextMessage message3 = (ITextMessage)mocks.CreateMock(typeof(ITextMessage));
ITextMessage message3 = mocks.StrictMock<ITextMessage>();
mocks.Replay(message3);
//Default naming strategy is to use full type name + # + number

View File

@@ -232,7 +232,7 @@ namespace Spring.Messaging.Nms.Connections
private IConnectionFactory CreateConnectionFactory()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = new TestConnection();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Once();

View File

@@ -50,9 +50,9 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void TransactionCommit()
{
IConnectionFactory connectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
IConnection connection = (IConnection) mocks.CreateMock(typeof (IConnection));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
using (mocks.Ordered())
{
@@ -74,9 +74,9 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void TransactionRollback()
{
IConnectionFactory connectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
IConnection connection = (IConnection) mocks.CreateMock(typeof (IConnection));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
SetupRollbackExpectations(connection, connectionFactory, session);
@@ -91,15 +91,12 @@ namespace Spring.Messaging.Nms.Connections
mocks.VerifyAll();
}
/**
* TODO because using anonymous delegates - refactor to support .net 1.1 later.
*/
[Test]
public void ParticipatingTransactionWithCommit()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
using (mocks.Ordered())
{
@@ -130,9 +127,9 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void ParticipatingTransactionWithRollback()
{
IConnectionFactory connectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
IConnection connection = (IConnection) mocks.CreateMock(typeof (IConnection));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
using (mocks.Ordered())
{
@@ -168,10 +165,10 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void SuspendedTransaction()
{
IConnectionFactory connectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
IConnection connection = (IConnection) mocks.CreateMock(typeof (IConnection));
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
ISession session2 = (ISession)mocks.CreateMock(typeof(ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
ISession session2 = mocks.StrictMock<ISession>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Twice();
Expect.Call(connection.CreateSession(AcknowledgementMode.Transactional)).Return(session).Repeat.Once();
@@ -214,10 +211,10 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void TransactionSuspension()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ISession session2 = (ISession)mocks.CreateMock(typeof(ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession session = mocks.StrictMock<ISession>();
ISession session2 = mocks.StrictMock<ISession>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Twice();

View File

@@ -50,7 +50,7 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnection()
{
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnection connection = mocks.StrictMock<IConnection>();
connection.Start();
LastCall.On(connection).Repeat.Twice();
@@ -82,8 +82,8 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnectionFactory()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Once();
connection.Start();
@@ -112,8 +112,8 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnectionFactoryAndClientId()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Once();
connection.ClientId = "MyId";
@@ -146,8 +146,8 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnectionFactoryAndExceptionListener()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
IExceptionListener listener = new ChainedExceptionListener();
@@ -185,7 +185,7 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnectionFactoryAndReconnectOnException()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
TestConnection con = new TestConnection();
Expect.Call(connectionFactory.CreateConnection()).Return(con).Repeat.Twice();
@@ -211,7 +211,7 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void UsingConnectionFactoryAndExceptionListenerAndReconnectOnException()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
TestConnection con = new TestConnection();
TestExceptionListener listener = new TestExceptionListener();
@@ -240,10 +240,10 @@ namespace Spring.Messaging.Nms.Connections
[Test]
public void CachingConnectionFactory()
{
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
ISession txSession = (ISession)mocks.CreateMock(typeof(ISession));
ISession nonTxSession = (ISession)mocks.CreateMock(typeof(ISession));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
IConnection connection = mocks.StrictMock<IConnection>();
ISession txSession = mocks.StrictMock<ISession>();
ISession nonTxSession = mocks.StrictMock<ISession>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection).Repeat.Once();
Expect.Call(connection.CreateSession(AcknowledgementMode.Transactional)).Return(txSession).Repeat.Once();

View File

@@ -24,9 +24,11 @@ namespace Spring.Messaging.Nms.Connections
get { throw new NotImplementedException(); }
}
#pragma warning disable 67
public event ExceptionListener ExceptionListener;
public event ConnectionInterruptedListener ConnectionInterruptedListener;
public event ConnectionResumedListener ConnectionResumedListener;
#pragma warning restore 67
public ISession CreateSession()
{

View File

@@ -20,7 +20,6 @@
#region Imports
using System;
using System.Collections;
using Apache.NMS;
using NUnit.Framework;
@@ -75,11 +74,11 @@ namespace Spring.Messaging.Nms.Core
private void CreateMocks()
{
mockConnectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
mockConnection = (IConnection) mocks.CreateMock(typeof (IConnection));
mockSession = (ISession) mocks.CreateMock(typeof (ISession));
mockConnectionFactory = mocks.StrictMock<IConnectionFactory>();
mockConnection = mocks.StrictMock<IConnection>();
mockSession = mocks.StrictMock<ISession>();
IQueue queue = (IQueue) mocks.CreateMock(typeof (IQueue));
IQueue queue = mocks.StrictMock<IQueue>();
Expect.Call(mockConnectionFactory.CreateConnection()).Return(mockConnection).Repeat.Once();
if (UseTransactedTemplate)
@@ -96,7 +95,7 @@ namespace Spring.Messaging.Nms.Core
Expect.Call(mockSession.Transacted).Return(true);
mockDestinationResolver =
(IDestinationResolver) mocks.CreateMock(typeof (IDestinationResolver));
mocks.StrictMock<IDestinationResolver>();
mockDestinationResolver.ResolveDestinationName(mockSession, "testDestination", false);
LastCall.Return(queue).Repeat.Any();
}
@@ -107,7 +106,7 @@ namespace Spring.Messaging.Nms.Core
NmsTemplate template = CreateTemplate();
template.ConnectionFactory = mockConnectionFactory;
IMessageProducer mockProducer = (IMessageProducer)mocks.CreateMock(typeof(IMessageProducer));
IMessageProducer mockProducer = mocks.StrictMock<IMessageProducer>();
Expect.Call(mockSession.CreateProducer(null)).Return(mockProducer);
Expect.Call(mockProducer.Priority).Return(MsgPriority.Normal);
@@ -137,7 +136,7 @@ namespace Spring.Messaging.Nms.Core
template.MessageIdEnabled = false;
template.MessageTimestampEnabled = false;
IMessageProducer mockProducer = (IMessageProducer) mocks.CreateMock(typeof (IMessageProducer));
IMessageProducer mockProducer = mocks.StrictMock<IMessageProducer>();
Expect.Call(mockSession.CreateProducer(null)).Return(mockProducer);
mockProducer.DisableMessageID = true;

View File

@@ -23,13 +23,15 @@
using System;
using System.Collections;
using System.Text;
using Apache.NMS;
using Apache.NMS.ActiveMQ.OpenWire;
using Apache.NMS.Util;
using NUnit.Framework;
using Rhino.Mocks;
using Spring.Messaging.Nms.Support.Converter;
using Spring.Util;
#endregion
@@ -51,14 +53,14 @@ namespace Spring.Messaging.Nms.Core
public void Setup()
{
mocks = new MockRepository();
session = (ISession) mocks.CreateMock(typeof (ISession));
session = mocks.StrictMock<ISession>();
converter = new SimpleMessageConverter();
}
[Test]
public void StringConversion()
{
ITextMessage message = (ITextMessage) mocks.CreateMock(typeof (ITextMessage));
ITextMessage message = mocks.StrictMock<ITextMessage>();
string content = "test";
Expect.Call(session.CreateTextMessage(content)).Return(message).Repeat.Once();
@@ -79,7 +81,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void ByteArrayConversion()
{
IBytesMessage message = (IBytesMessage) mocks.CreateMock(typeof (IBytesMessage));
IBytesMessage message = mocks.StrictMock<IBytesMessage>();
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] content = encoding.GetBytes("test");
@@ -100,7 +102,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void MapConversion()
{
IMapMessage message = (IMapMessage) mocks.CreateMock(typeof (IMapMessage));
IMapMessage message = mocks.StrictMock<IMapMessage>();
IPrimitiveMap primitiveMap = new PrimitiveMap();
IDictionary content = new Hashtable();
content["key1"] = "value1";
@@ -123,7 +125,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void Serializable()
{
IObjectMessage message = (IObjectMessage)mocks.CreateMock(typeof(IObjectMessage));
IObjectMessage message = mocks.StrictMock<IObjectMessage>();
SerializableWithAttribute content = new SerializableWithAttribute();
@@ -157,7 +159,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void ToMessageSimplyReturnsMessageAsIsIfSuppliedWithMessage()
{
IObjectMessage message = (IObjectMessage) mocks.CreateMock(typeof (IObjectMessage));
IObjectMessage message = mocks.StrictMock<IObjectMessage>();
mocks.ReplayAll();
@@ -170,7 +172,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void FromMessageSimplyReturnsMessageAsIsIfSuppliedWithMessage()
{
IMessage message = (IMessage)mocks.CreateMock(typeof(IMessage));
IMessage message = mocks.StrictMock<IMessage>();
mocks.ReplayAll();
@@ -183,7 +185,7 @@ namespace Spring.Messaging.Nms.Core
[Test]
public void DictionaryConversionWhereMapHasNonStringTypesForKeys()
{
IMapMessage message = (IMapMessage)mocks.CreateMock(typeof(IMapMessage));
IMapMessage message = mocks.StrictMock<IMapMessage>();
Expect.Call(session.CreateMapMessage()).Return(message);

View File

@@ -63,26 +63,26 @@ namespace Spring.Messaging.Nms.Core
{
SimpleMessageConsumer messageConsumer = new SimpleMessageConsumer();
ISession session = (ISession) mocks.CreateMock(typeof (ISession));
ISession session = mocks.StrictMock<ISession>();
Expect.Call(session.GetQueue(DESTINATION_NAME)).Return(QUEUE_DESTINATION);
Expect.Call(session.CreateConsumer(QUEUE_DESTINATION, null)).Return(messageConsumer);
// an exception is thrown, so the rollback logic is being applied here...
Expect.Call(session.Transacted).Return(false);
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnection connection = mocks.StrictMock<IConnection>();
connection.ExceptionListener += container.OnException;
Expect.Call(connection.CreateSession(container.SessionAcknowledgeMode)).Return(session);
connection.Start();
IConnectionFactory connectionFactory = (IConnectionFactory) mocks.CreateMock(typeof (IConnectionFactory));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection);
NMSException theException = new NMSException(EXCEPTION_MESSAGE);
IExceptionListener exceptionListener = (IExceptionListener) mocks.CreateMock(typeof (IExceptionListener));
IExceptionListener exceptionListener = mocks.StrictMock<IExceptionListener>();
exceptionListener.OnException(theException);
IMessage message = (IMessage) mocks.CreateMock(typeof (IMessage));
IMessage message = mocks.StrictMock<IMessage>();
mocks.ReplayAll();
@@ -103,26 +103,26 @@ namespace Spring.Messaging.Nms.Core
{
SimpleMessageConsumer messageConsumer = new SimpleMessageConsumer();
ISession session = (ISession)mocks.CreateMock(typeof(ISession));
ISession session = mocks.StrictMock<ISession>();
Expect.Call(session.GetQueue(DESTINATION_NAME)).Return(QUEUE_DESTINATION);
Expect.Call(session.CreateConsumer(QUEUE_DESTINATION, null)).Return(messageConsumer);
// an exception is thrown, so the rollback logic is being applied here...
Expect.Call(session.Transacted).Return(false);
IConnection connection = (IConnection)mocks.CreateMock(typeof(IConnection));
IConnection connection = mocks.StrictMock<IConnection>();
connection.ExceptionListener += container.OnException;
Expect.Call(connection.CreateSession(container.SessionAcknowledgeMode)).Return(session);
connection.Start();
IConnectionFactory connectionFactory = (IConnectionFactory)mocks.CreateMock(typeof(IConnectionFactory));
IConnectionFactory connectionFactory = mocks.StrictMock<IConnectionFactory>();
Expect.Call(connectionFactory.CreateConnection()).Return(connection);
IllegalStateException theException = new IllegalStateException(EXCEPTION_MESSAGE);
IErrorHandler errorHandler = (IErrorHandler)mocks.CreateMock(typeof(IErrorHandler));
IErrorHandler errorHandler = mocks.StrictMock<IErrorHandler>();
errorHandler.HandleError(theException);
IMessage message = (IMessage)mocks.CreateMock(typeof(IMessage));
IMessage message = mocks.StrictMock<IMessage>();
mocks.ReplayAll();

View File

@@ -52,7 +52,7 @@ namespace Spring.Messaging.Nms.Listener.Adapter
public void MessageContentsHandlerForTextMessage()
{
int numIterations = 10;
ITextMessage message = (ITextMessage)mocks.CreateMock(typeof(ITextMessage));
ITextMessage message = mocks.StrictMock<ITextMessage>();
Expect.Call(message.Text).Return(TEXT).Repeat.Times(numIterations);
MessageContentsHandler handler = new MessageContentsHandler();
mocks.ReplayAll();
@@ -71,7 +71,7 @@ namespace Spring.Messaging.Nms.Listener.Adapter
public void MessageContentsHandlerForBytesMessage()
{
int numIterations = 10;
IBytesMessage message = (IBytesMessage)mocks.CreateMock(typeof(IBytesMessage));
IBytesMessage message = mocks.StrictMock<IBytesMessage>();
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] content = encoding.GetBytes("test");
Expect.Call(message.Content).Return(content).Repeat.Times(numIterations);
@@ -92,12 +92,12 @@ namespace Spring.Messaging.Nms.Listener.Adapter
public void MessageContentsHandlerOverloadCalls()
{
int numIterations = 10;
IBytesMessage bytesMessage = (IBytesMessage)mocks.CreateMock(typeof(IBytesMessage));
IBytesMessage bytesMessage = mocks.StrictMock<IBytesMessage>();
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] content = encoding.GetBytes("test");
Expect.Call(bytesMessage.Content).Return(content).Repeat.Times(numIterations / 2);
ITextMessage textMessage = (ITextMessage)mocks.CreateMock(typeof(ITextMessage));
ITextMessage textMessage = mocks.StrictMock<ITextMessage>();
Expect.Call(textMessage.Text).Return(TEXT).Repeat.Times(numIterations/2);
MessageContentsHandler handler = new MessageContentsHandler();

View File

@@ -25,6 +25,7 @@
<DefineConstants>TRACE;DEBUG;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -33,6 +34,7 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility" />

View File

@@ -40,6 +40,7 @@
<DefineConstants>TRACE;DEBUG;NET_4_0;NET_3_5,QUARTZ_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -48,6 +49,7 @@
<DefineConstants>TRACE;NET_4_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.1.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -36,6 +36,7 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.1.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -72,7 +72,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>

View File

@@ -22,20 +22,22 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Testing.Microsoft.Tests\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Testing.Microsoft.Tests\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -27,6 +27,7 @@
<DefineConstants>TRACE;DEBUG;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -35,6 +36,7 @@
<DefineConstants>TRACE;NET_4_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.1.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">

View File

@@ -1,19 +1,19 @@
#region License
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
@@ -42,7 +42,7 @@ namespace Spring.Testing.Ado
public void SetUp()
{
mocks = new MockRepository();
adoTemplate = (IAdoOperations) mocks.CreateMock(typeof (IAdoOperations));
adoTemplate = mocks.StrictMock<IAdoOperations>();
}
[Test]
@@ -111,9 +111,9 @@ namespace Spring.Testing.Ado
public void ExecuteScriptTransactedSuccess()
{
IDbProvider dbProvider = (IDbProvider) mocks.DynamicMock(typeof(IDbProvider));
IDbConnection dbConnection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction dbTx = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbCommand dbCommand = (IDbCommand) mocks.CreateMock(typeof (IDbCommand));
IDbConnection dbConnection = mocks.StrictMock<IDbConnection>();
IDbTransaction dbTx = mocks.StrictMock<IDbTransaction>();
IDbCommand dbCommand = mocks.StrictMock<IDbCommand>();
DefaultTransactionDefinition txDefinition = new DefaultTransactionDefinition();
Expect.Call(dbProvider.CreateConnection()).Return(dbConnection);
@@ -142,9 +142,9 @@ namespace Spring.Testing.Ado
[Test]
public void ExecuteScriptTransactedRollsbackIfNoCommit()
{
IDbProvider dbProvider = (IDbProvider) mocks.CreateMock(typeof(IDbProvider));
IDbConnection dbConnection = (IDbConnection) mocks.CreateMock(typeof (IDbConnection));
IDbTransaction dbTx = (IDbTransaction) mocks.CreateMock(typeof (IDbTransaction));
IDbProvider dbProvider = mocks.StrictMock<IDbProvider>();
IDbConnection dbConnection = mocks.StrictMock<IDbConnection>();
IDbTransaction dbTx = mocks.StrictMock<IDbTransaction>();
DefaultTransactionDefinition txDefinition = new DefaultTransactionDefinition();
Expect.Call(dbProvider.CreateConnection()).Return(dbConnection);

View File

@@ -1,17 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using NHibernate;
using Spring.Web.Conversation;
public partial class EndPausedSessionIsClosedA : System.Web.UI.Page
{

View File

@@ -1,17 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using NHibernate;
using Spring.Entities;
using Spring.Web.Conversation;
public partial class EndPausedSessionIsClosedB : System.Web.UI.Page
{

View File

@@ -1,14 +1,5 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Web.Conversation;
public partial class EndPausedTest : System.Web.UI.Page

View File

@@ -1,14 +1,5 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Web.Conversation;
public partial class GetParentObjetFromChild : System.Web.UI.Page

View File

@@ -1,20 +1,11 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using System.Text.RegularExpressions;
using NHibernate;
using Spring.Data.NHibernate.Support;
using Common.Logging;
using Spring.Objects.Factory;
using Spring.Web.Conversation;
public partial class IoeTests : System.Web.UI.Page
{

View File

@@ -1,18 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using System.Threading;
using NHibernate;
using Spring.Web.Conversation;
public partial class RedirectErrorNoPauseConversation : System.Web.UI.Page
{

View File

@@ -1,17 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using NHibernate;
using Spring.Entities;
using Spring.Web.Conversation;
public partial class SPCLazyLoadTest_A_Begin : System.Web.UI.Page
{

View File

@@ -1,18 +1,9 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using Common.Logging;
using NHibernate;
using Spring.Web.Conversation;
public partial class SPCLazyLoadTest_A_Status : System.Web.UI.Page
{

View File

@@ -1,29 +1,14 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Data.NHibernate.Support;
using NHibernate;
using Spring.Entities;
using Spring.Spring.Data.Common;
using NUnit.Framework;
using Spring.Bsn;
using NHibernate.Impl;
using System.Reflection;
using NHibernate.Cfg;
using Spring.Context;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using Spring.Web.Conversation;
using NHibernate;
using Spring.Entities;
/// <summary>
/// Page for <see cref="Spring.Web.Conversation.WebConversationStateTest.SerializeConversationTest()"/>.
/// </summary>

View File

@@ -1,17 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using NHibernate;
using Spring.Web.Conversation;
public partial class SessionIsClosedA : System.Web.UI.Page
{

View File

@@ -1,17 +1,8 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Entities;
using NHibernate;
using Spring.Web.Conversation;
public partial class SessionIsClosedB : System.Web.UI.Page
{

View File

@@ -1,14 +1,5 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Web.Conversation;
public partial class TimeOut_NoTimeOut : System.Web.UI.Page

View File

@@ -1,14 +1,5 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.Web.Conversation;
using Spring.Web.Conversation;
public partial class TimeOut_WithTimeOut : System.Web.UI.Page

View File

@@ -40,10 +40,12 @@
<DefineConstants>TRACE;DEBUG;NET_40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\..\build\VS.Net.2010\Spring.Web.Conversation.NHibernate32.Tests\Debug\Spring.Web.Conversation.NHibernate32.Tests.XML</DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<StartAction>Program</StartAction>
<StartProgram>$(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe</StartProgram>
<StartArguments>"$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll"</StartArguments>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -52,6 +54,7 @@
<DefineConstants>TRACE;NET_40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -45,6 +45,7 @@
<StartAction>Program</StartAction>
<StartProgram>$(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe</StartProgram>
<StartArguments>"$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll"</StartArguments>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -53,6 +54,7 @@
<DefineConstants>TRACE;NET_40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">

View File

@@ -27,10 +27,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc3.Tests\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">

View File

@@ -27,10 +27,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc4.Tests\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">

View File

@@ -30,10 +30,11 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Web.Mvc5.Tests\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>

View File

@@ -86,7 +86,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>