Removing .NET 2.0 and 3.0 support, updating build and project files, removing obsolete defines

This commit is contained in:
Marko Lahma
2012-02-16 22:32:16 +02:00
parent 18df6ad530
commit 88e05db3de
421 changed files with 1010 additions and 5050 deletions

View File

@@ -28,10 +28,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("1.3.1.40001")]
#elif NET_3_5
[assembly: AssemblyVersion("1.3.1.35001")]
#elif NET_3_0
[assembly: AssemblyVersion("1.3.1.30001")]
#elif NET_2_0
[assembly: AssemblyVersion("1.3.1.20001")]
#endif
//

View File

@@ -699,7 +699,6 @@ namespace Spring.Aop.Framework.DynamicProxy
#region ProxyGenericMethodWithRefOutParameters
#if NET_2_0
[Test]
public void ProxyGenericMethodWithRefOutParametersWithDirectCall()
{
@@ -799,7 +798,7 @@ namespace Spring.Aop.Framework.DynamicProxy
internal class InternalRefOutGenericTestObject : PublicRefOutGenericTestObject
{
}
#endif
#endregion
[Test]
@@ -816,7 +815,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.AreEqual(target.ToString(), proxy.ToString(), "ToString() not equal");
}
#if NET_2_0
[Test]
public void InterceptGenericMethod()
{
@@ -886,7 +884,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.AreEqual(2, ni.Count);
}
#endif
#region MultiThreadedProxyCreation
@@ -1060,7 +1057,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's parameter.");
}
#if NET_2_0
[Test]
public void ProxyTargetMethodReturnValueAttributes()
{
@@ -1110,7 +1106,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.IsNotNull(attrs);
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's return value.");
}
#endif
public sealed class MarkerAttribute : Attribute
{

View File

@@ -230,14 +230,12 @@ namespace Spring.Aop.Framework.DynamicProxy
base.ProxyMethodWithRefOutParametersWithStandardReflection();
}
#if NET_2_0
[Test]
[ExpectedException(typeof(AopConfigException), ExpectedMessage="Cannot create decorator-based IAopProxy for a non visible class [Spring.Aop.Framework.DynamicProxy.AbstractAopProxyTests+InternalRefOutGenericTestObject]")]
public override void ProxyGenericMethodWithRefOutParametersWithStandardReflection()
{
base.ProxyGenericMethodWithRefOutParametersWithStandardReflection();
}
#endif
#region Attributes
@@ -325,7 +323,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's parameter.");
}
#if NET_2_0
[Test]
public void ProxyTargetVirtualMethodReturnValueAttributes()
{
@@ -367,7 +364,6 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.IsNotNull(attrs);
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's return value.");
}
#endif
#endregion

View File

@@ -146,7 +146,6 @@ namespace Spring.Aop.Framework.DynamicProxy
}
}
#if NET_2_0
[Test]
public void InterceptVirtualGenericMethod()
{
@@ -202,7 +201,6 @@ namespace Spring.Aop.Framework.DynamicProxy
return arg;
}
}
#endif
[Test]
public void DoesNotInterceptFinalMethod()

View File

@@ -41,7 +41,6 @@ namespace Spring.Aop.Framework
}
#if NET_2_0
[Category("Performance")]
[Test, Explicit]
public void InstantiationPerformance()
@@ -56,6 +55,5 @@ namespace Spring.Aop.Framework
watch.Stop();
Console.WriteLine("Instantiation time: {0}ms", watch.ElapsedMilliseconds);
}
#endif
}
}
}

View File

@@ -74,7 +74,7 @@ namespace Spring.Aop.Support
ExactMatchTests(pointcut);
}
#if NET_2_0
protected void ExactMatchWithGenericTypeTests(AbstractRegularExpressionMethodPointcut rpc)
{
// assumes rpc.setPattern("System.Collections.Generic.List<string>");
@@ -106,7 +106,6 @@ namespace Spring.Aop.Support
Assert.IsTrue(pointcut.Matches(typeof(System.Collections.Generic.List<string>).GetMethod("Add"), typeof(int)));
Assert.IsFalse(pointcut.Matches(typeof(System.Collections.Generic.List<string>).GetMethod("GetType"), typeof(Type)));
}
#endif
protected void ExactMatchTests(AbstractRegularExpressionMethodPointcut rpc)
{

View File

@@ -153,7 +153,6 @@ namespace Spring.Aop.Target
Assert.AreEqual (2, ((IThreadLocalTargetSourceStats) apartment).Objects);
}
#if NET_2_0
private static bool multiThreadedTestFailed = false;
[Test]
@@ -227,6 +226,5 @@ namespace Spring.Aop.Target
}
#endregion
#endif
}
}

View File

@@ -146,7 +146,6 @@ namespace Spring.Aspects.Cache
IList items = store.GetAll();
}
#if NET_2_0
[Test(Description = "http://jira.springframework.org/browse/SPRNET-959")]
public void UseMethodInfoForKeyGeneration()
{
@@ -167,7 +166,6 @@ namespace Spring.Aspects.Cache
// but it returns the NullValue marker created by the CacheResultAttribute
Assert.IsNotNull(cache.Get("String_1"));
}
#endif
}
#region Inner Class : CacheParameterTarget
@@ -229,7 +227,6 @@ namespace Spring.Aspects.Cache
}
}
#if NET_2_0
public interface IGenericDao<T, IdT>
{
T Load(IdT id);
@@ -243,7 +240,6 @@ namespace Spring.Aspects.Cache
return default(T);
}
}
#endif
#endregion
}

View File

@@ -22,7 +22,7 @@
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Aop.Tests\Debug\</OutputPath>

View File

@@ -11,9 +11,6 @@
-->
<target name="build">
<!-- build Spring.Aop -->
<!-- use .NET 3.5 compiler for tests to allow lambdas etc -->
<property name="temp.nant.settings.currentframework" value="${nant.settings.currentframework}" />
<property name="nant.settings.currentframework" value="net-3.5" if="${nant.settings.currentframework == 'net-2.0' or nant.settings.currentframework == 'net-3.0'}" />
<csc target="library" define="${current.build.defines.csc}"
warnaserror="true"
optimize="${build.optimize}"
@@ -50,9 +47,6 @@
</references>
</csc>
<!-- restore old framework setting -->
<property name="nant.settings.currentframework" value="${temp.nant.settings.currentframework}" />
<copy todir="${current.bin.dir}">
<fileset basedir="${project::get-base-directory()}/Data">
<include name="**/*.xml" />

View File

@@ -1,4 +1,3 @@
#if NET_2_0
#region License
/*
@@ -91,4 +90,3 @@ namespace Spring.Collections.Generic
}
}
#endif

View File

@@ -28,9 +28,7 @@ namespace Spring
public string Name;
public string Nationality;
public string[] Inventions;
#if NET_2_0
public DateTime? DateOfGraduation;
#endif
private DateTime dob;
private Place pob;

View File

@@ -63,7 +63,6 @@ namespace Spring.Context.Support
}
#if NET_2_0
[Test]
public void ExecutesAllContextEventHandlersAndRethrowsExceptionsThrownDuringContextEventHandlingByDefault()
{
@@ -93,7 +92,6 @@ namespace Spring.Context.Support
Assert.AreEqual("dummy", resultException.Message);
Assert.IsTrue(secondHandlerExecuted);
}
#endif
[Test]
public void DoesNotSearchParentContextForMessageSource()

View File

@@ -117,11 +117,7 @@ namespace Spring.Context.Support
/// Expect failure when using a type that does not inherit from IApplicationContext
/// </summary>
[Test]
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof(ConfigurationException))]
#endif
public void ContextNotOfCorrectType()
{
const string xmlData =
@@ -134,11 +130,7 @@ namespace Spring.Context.Support
}
[Test]
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof(ConfigurationException))]
#endif
public void CreatedFromNullXmlElement()
{
ContextHandler ctxHandler = new ContextHandler();
@@ -159,11 +151,7 @@ namespace Spring.Context.Support
"Default type is not the XmlApplicationContext type; it must be.");
}
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof(ConfigurationException))]
#endif
[Test(Description="SPRNET-105")]
public void ChokesIfChildContextsUseTheSameName()
{

View File

@@ -201,7 +201,6 @@ namespace Spring.Context.Support
Assert.AreEqual("Baia", to2.Name);
}
#if NET_2_0
// TODO : Add support for .NET 1.x
[Test]
public void ClearWithConfigurationSection()
@@ -212,7 +211,6 @@ namespace Spring.Context.Support
Assert.AreNotSame(ctx1, ctx2);
}
#endif
[Test(Description = "SPRNET-105")]
[ExpectedException(typeof(ApplicationContextException))]

View File

@@ -100,11 +100,7 @@ namespace Spring.Context.Support
}
[Test]
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof (ConfigurationException))]
#endif
public void WithParserElementThatIsMissingTheTypeAttribute()
{
const string xml = @"<?xml version='1.0' encoding='UTF-8' ?>

View File

@@ -375,20 +375,6 @@ namespace Spring.Context.Support
messageSource.GetMessage("MyNonExistantMessage", CultureInfo.CurrentCulture, new object[] { "Spring", ".NET" });
}
#if !NET_2_0
/// <summary>
/// Test resource whose value is null
/// </summary>
[Test]
public void ResourceSetMessageSourceGetNullResource()
{
messageSource.ResourceManagers = resourceManagerList;
object resource = messageSource.GetResourceObject("MyNullMessage", CultureInfo.InvariantCulture);
Assert.AreEqual(String.Empty, resource, "should've returned empty string");
}
#endif
#if NET_2_0
/// <summary>
/// Test resource whose value is null.
/// </summary>
@@ -400,7 +386,6 @@ namespace Spring.Context.Support
object resource = messageSource.GetResourceObject("MyNullMessage", CultureInfo.InvariantCulture);
Assert.AreEqual(String.Empty, resource, "should've returned empty string");
}
#endif
/// <summary>
/// Exercise repeated requests to hit the cache of MessageSets. Note order of test is not assured

View File

@@ -55,7 +55,6 @@ namespace Spring.Context.Support
Assert.AreEqual(typeof (TestObject), type, "The type alias was not registered by the TypeAliasesSectionHandler.");
}
#if NET_2_0
[Test]
public void WithGenericType()
{
@@ -80,7 +79,6 @@ namespace Spring.Context.Support
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
handler.Create(null, null, BuildConfigurationSection(xml));
}
#endif
[Test]
[ExpectedException(typeof (TypeLoadException))]
@@ -179,11 +177,7 @@ namespace Spring.Context.Support
}
[Test]
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof (ConfigurationException))]
#endif
public void WithAliasElementThatIsMissingTheNameAttribute()
{
const string xml = @"<?xml version='1.0' encoding='UTF-8' ?>
@@ -196,11 +190,7 @@ namespace Spring.Context.Support
}
[Test]
#if NET_2_0
[ExpectedException(typeof(ConfigurationErrorsException))]
#else
[ExpectedException(typeof (ConfigurationException))]
#endif
public void WithAliasElementThatIsMissingTheTypeAttribute()
{
const string xml = @"<?xml version='1.0' encoding='UTF-8' ?>

View File

@@ -18,7 +18,6 @@
#endregion
using System;
using System.IO;
using System.Text;
using NUnit.Framework;
@@ -52,7 +51,6 @@ namespace Spring.Core.IO
Assert.AreEqual("test", reader.ReadToEnd());
}
#if NET_2_0
[Test]
public void OpensReaderWithAutoDetectEncoding()
{
@@ -84,7 +82,7 @@ namespace Spring.Core.IO
Assert.AreEqual(Encoding.UTF8.GetString(resourceData), actual);
Assert.AreEqual(Encoding.UTF8.EncodingName, reader.CurrentEncoding.EncodingName);
}
#endif
/// <summary>
/// Returns the text bytes including the encoding's preamble (<see cref="Encoding.GetPreamble"/>), if any.
/// </summary>

View File

@@ -18,8 +18,6 @@
#endregion
#if NET_2_0
#region Imports
using System;
@@ -99,5 +97,3 @@ namespace Spring.Core
}
}
}
#endif

View File

@@ -18,13 +18,9 @@
#endregion
#if NET_2_0
#region Imports
using System;
using System.Data;
using NUnit.Framework;
using Spring.Objects;
@@ -130,5 +126,3 @@ namespace Spring.Core.TypeResolution
}
}
}
#endif

View File

@@ -24,10 +24,6 @@ using System;
using NUnit.Framework;
using Spring.Objects;
#if NET_2_0
using System.Collections.Generic;
#endif
#endregion
namespace Spring.Core.TypeResolution
@@ -59,7 +55,6 @@ namespace Spring.Core.TypeResolution
Assert.AreEqual(null, tah.AssemblyName);
}
#if NET_2_0
[Test]
public void CanTakeUnqualifiedGenericType()
{
@@ -79,6 +74,5 @@ namespace Spring.Core.TypeResolution
Assert.AreEqual(testType.FullName, tah.TypeName);
Assert.AreEqual(testType.Assembly.FullName, tah.AssemblyName);
}
#endif
}
}
}

View File

@@ -546,7 +546,6 @@ namespace Spring.Core.TypeResolution
TypeRegistry.ResolveType(TypeRegistry.DoubleArrayAliasVB));
}
#if NET_2_0
[Test]
public void ResolveNullableChar()
{
@@ -722,7 +721,6 @@ namespace Spring.Core.TypeResolution
Assert.AreEqual(typeof(double?[]),
TypeRegistry.ResolveType(TypeRegistry.NullableDoubleArrayAlias));
}
#endif
}
internal class Foo

View File

@@ -24,7 +24,6 @@ using System.Collections;
using NUnit.Framework;
using Spring.Core;
using Spring.Globalization.Formatters;
using Spring.Objects;
using Spring.Validation;
namespace Spring.DataBinding
@@ -44,9 +43,7 @@ namespace Spring.DataBinding
mgr = new BaseBindingManager();
mgr.AddBinding("['name']", "Name");
mgr.AddBinding("['dob']", "DOB");
#if NET_2_0 // test nullable type
mgr.AddBinding("['dateofgraduation']", "DateOfGraduation");
#endif
mgr.AddBinding("['inventions']", "Inventions");
mgr.AddBinding("['cityOfBirth']", "PlaceOfBirth.City");
mgr.AddBinding("['countryOfBirth']", "PlaceOfBirth.Country");
@@ -60,10 +57,9 @@ namespace Spring.DataBinding
source["name"] = "Nikola Tesla";
source["dob"] = new DateTime(1856, 7, 9);
#if NET_2_0
// I know this is pupin's graduation year but I need a date here
source["dateofgraduation"] = new DateTime(1883,1,1);
#endif
source["inventions"] = new string[] {"One", "Two"};
mgr.BindSourceToTarget(source, target, null);
@@ -97,10 +93,9 @@ namespace Spring.DataBinding
source["name"] = "Nikola Tesla";
source["dob"] = "1856-7-9";
source["inventions"] = "One,Two";
#if NET_2_0
// I know this is pupin's graduation year but I need a date here
source["dateofgraduation"] = "1883-1-1";
#endif
mgr.BindSourceToTarget(source, target, null);
@@ -125,7 +120,6 @@ namespace Spring.DataBinding
}
#if NET_2_0
[Test]
public void BindNullValues()
{
@@ -167,7 +161,6 @@ namespace Spring.DataBinding
mgr.BindSourceToTarget(source, target, null);
Assert.IsNull(target.DateOfGraduation);
}
#endif
[Test]
public void UnhandledTypeConversionExceptionSourceToTarget()

View File

@@ -30,7 +30,6 @@ namespace Spring.DataBinding
[TestFixture]
public class SimpleExpressionBindingTests
{
#if NET_2_0
private class BindToNullable_TestEntity
{
private Nullable<short> sortOrder;
@@ -46,7 +45,6 @@ namespace Spring.DataBinding
new SimpleExpressionBinding("Text", "SortOrder").BindSourceToTarget(textBox, entity, null);
Assert.IsNull(entity.SortOrder);
}
#endif
[Test]
[ExpectedException(typeof(ArgumentNullException))]

View File

@@ -750,7 +750,6 @@ namespace Spring.Expressions
Assert.AreEqual(typeof(ExpressionEvaluator), ExpressionEvaluator.GetValue(null, string.Format("T({0})", typeof(ExpressionEvaluator).AssemblyQualifiedName)));
}
#if NET_2_0
/// <summary>
/// Tests type node
/// </summary>
@@ -787,7 +786,7 @@ namespace Spring.Expressions
{
Assert.AreEqual(typeof(int?[,]), ExpressionEvaluator.GetValue(null, "T(System.Nullable`1[[System.Int32, mscorlib]][,], mscorlib)"));
}
#endif
/// <summary>
/// Tests constructor node
/// </summary>
@@ -1339,9 +1338,6 @@ namespace Spring.Expressions
/// Tests LIKE operator.
/// </summary>
[Test]
#if !NET_2_0
[ExpectedException(typeof(NotSupportedException))]
#endif
public void TestLikeOperator()
{
Assert.IsTrue((bool)ExpressionEvaluator.GetValue(null, "'A' like '?'"));
@@ -2084,8 +2080,6 @@ namespace Spring.Expressions
ExpressionEvaluator.SetValue(null, "DateTime", 20);
}
#if NET_2_0
/// <summary>
/// Reproduce SPRNET-408.
/// </summary>
@@ -2124,7 +2118,6 @@ namespace Spring.Expressions
Assert.IsTrue((bool)ExpressionEvaluator.GetValue(test, "#root == null"));
Assert.IsNull(ExpressionEvaluator.GetValue(test, "#root"));
}
#endif
/// <summary>
/// Reproduce SPRNET-462.
@@ -2980,12 +2973,10 @@ namespace Spring.Expressions
internal class Foo
{
private FooType type;
#if NET_2_0
private Nullable<DateTime> nullableDate;
private Nullable<Int32> nullableInt;
#endif
public Foo()
: this(FooType.One)
public Foo() : this(FooType.One)
{
}
@@ -3031,8 +3022,6 @@ namespace Spring.Expressions
get { return type; }
}
#if NET_2_0
public DateTime? NullableDate
{
get { return nullableDate; }
@@ -3044,7 +3033,6 @@ namespace Spring.Expressions
get { return nullableInt; }
set { nullableInt = value; }
}
#endif
public string MethodWithSimilarArguments(int flags, Bar[] bars)
{

View File

@@ -79,7 +79,6 @@ namespace Spring.Expressions
return string.Format("{0},{1},{2}", this.GetHashCode(), arg1, arg2);
}
#if NET_2_0
[Category("Performance")]
[Test, Explicit]
public void ExecutesDelegatePerformance()
@@ -116,6 +115,5 @@ namespace Spring.Expressions
}
}
}
#endif
}
}

View File

@@ -426,7 +426,6 @@ namespace Spring.Objects.Factory
.RegisterSingleton(null, DBNull.Value);
}
#if NET_2_0
[Test]
public void GetSingletonNamesReflectsOrderOfRegistration()
{
@@ -443,7 +442,6 @@ namespace Spring.Objects.Factory
of.RegisterSingleton("B", new object());
Assert.AreEqual(new string[] { "A", "C", "B" }, of.GetSingletonNames(typeof(object)));
}
#endif
[Test]
[ExpectedException(typeof(ArgumentNullException))]
@@ -674,8 +672,6 @@ namespace Spring.Objects.Factory
}
}
#if NET_2_0
[TestFixture]
public class SPRNET_1338
{
@@ -1031,6 +1027,4 @@ namespace Spring.Objects.Factory
}
}
#endif
}
}

View File

@@ -65,7 +65,7 @@ namespace Spring.Objects.Factory.Config
// non-existant variable
Assert.IsNull(vs.ResolveVariable("dummy"));
}
#if NET_2_0 && !NET_3_5
#if !NET_3_5
[Test]
public void TestVariableResolutionFromApplicationSettingsSchema()
{

View File

@@ -53,7 +53,6 @@ namespace Spring.Objects.Factory.Config
</foo>
</configuration>";
#if NET_2_0
/// <summary>
/// Unfortunately ConfigurationManager doesn't accept uri's.
/// </summary>
@@ -70,7 +69,6 @@ namespace Spring.Objects.Factory.Config
Assert.IsInstanceOf(typeof(ArgumentException), cfgex.InnerException);
}
}
#endif
[Test]
public void ReadSunnyDay()
@@ -93,8 +91,6 @@ namespace Spring.Objects.Factory.Config
string machineConfig = RuntimeEnvironment.SystemConfigurationFile;
}
#if NET_2_0
[Test]
public void GetSectionLocalSectionHandler()
{
@@ -142,8 +138,6 @@ namespace Spring.Objects.Factory.Config
}
}
#endif
[Test]
public void GetSectionSunnyDay()
{
@@ -227,11 +221,7 @@ namespace Spring.Objects.Factory.Config
}
[Test]
#if !NET_2_0
[ExpectedException(typeof(ConfigurationException), ExpectedMessage = "Cannot read config section 'ELNOMBRE' - section not found.")]
#else
[ExpectedException(typeof(ConfigurationErrorsException), ExpectedMessage = "Cannot read config section 'ELNOMBRE' - section not found.")]
#endif
public void TryReadFromNonExistantConfigSection()
{
using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(SunnyDayXml)))

View File

@@ -1,5 +1,3 @@
#if NET_2_0
#region License
/*
@@ -51,5 +49,3 @@ namespace Spring.Objects.Factory.Config
}
}
}
#endif

View File

@@ -18,8 +18,6 @@
#endregion
#if NET_2_0
using NUnit.Framework;
using Spring.Context;
using Spring.Context.Support;
@@ -76,5 +74,3 @@ namespace Spring.Objects.Factory.Config
}
}
}
#endif

View File

@@ -123,18 +123,6 @@ namespace Spring.Objects.Factory.Config
Assert.AreEqual("value2", dvs.ResolveVariable("key2"));
}
#if !NET_2_0
[Test]
public void Initialize_WithInlineDictionarySyntax()
{
DictionaryVariableSource dvs = new DictionaryVariableSource() { { "key1", "value1" }, { "key2", "value2" } };
Assert.AreEqual("value1", dvs.ResolveVariable("key1"));
Assert.AreEqual("value2", dvs.ResolveVariable("key2"));
}
#endif
[Test]
public void Requesting_KeyNotFound_ThrowsException()
{

View File

@@ -38,7 +38,6 @@ namespace Spring.Objects.Factory.Config
[TestFixture]
public class MethodInvokingFactoryObjectTests
{
#if NET_2_0
[Test]
public void InvokeGenericMethod()
{
@@ -52,8 +51,8 @@ namespace Spring.Objects.Factory.Config
Assert.IsNotNull(obj);
Assert.IsTrue(obj is TestObject);
}
#endif
[Test]
[Test]
public void GetSingletonNonStatic()
{
TestClass1 tc1 = new TestClass1();

View File

@@ -42,10 +42,8 @@ namespace Spring.Objects.Factory.Config
{
key = Registry.CurrentUser.CreateSubKey("RegistryVariableSourceTests");
key.SetValue("name", "Aleks Seovic");
#if NET_2_0
key.SetValue("computer_name", "%COMPUTERNAME% is the name of my computer", RegistryValueKind.ExpandString);
key.SetValue("age", 32, RegistryValueKind.DWord);
#endif
key.SetValue("family", new string[] {"Marija", "Ana", "Nadja"});
key.SetValue("bday", new byte[] {24, 8, 74});
key.Flush();
@@ -65,11 +63,9 @@ namespace Spring.Objects.Factory.Config
// existing vars
Assert.AreEqual("Aleks Seovic", rvs.ResolveVariable("name"));
#if NET_2_0
Assert.AreEqual(Environment.GetEnvironmentVariable("COMPUTERNAME") + " is the name of my computer",
rvs.ResolveVariable("computer_name"));
Assert.AreEqual("32", rvs.ResolveVariable("age"));
#endif
// multi_sz
Assert.AreEqual( "Marija,Ana,Nadja", rvs.ResolveVariable("family"));
// binary

View File

@@ -178,54 +178,14 @@ namespace Spring.Objects.Factory.Config
private static IDisposable Record( MockRepository mocks )
{
#if NET_2_0
return mocks.Record();
#else
return new RecordModeChanger(mocks);
#endif
}
private static IDisposable Playback( MockRepository mocks )
{
#if NET_2_0
return mocks.Playback();
#else
return new PlaybackModeChanger(mocks);
#endif
}
#if !NET_2_0
private class RecordModeChanger : IDisposable
{
private MockRepository _mocks;
public RecordModeChanger(MockRepository mocks)
{
_mocks = mocks;
}
public void Dispose()
{
_mocks.ReplayAll();
}
}
private class PlaybackModeChanger : IDisposable
{
private MockRepository _mocks;
public PlaybackModeChanger(MockRepository mocks)
{
_mocks = mocks;
}
public void Dispose()
{
_mocks.VerifyAll();
}
}
#endif
#endregion Rhino.Mocks Compatibility Adapter
}
}

View File

@@ -162,7 +162,7 @@ namespace Spring.Objects.Factory
IDictionary objs = lof.GetObjectsOfType(typeof(TestObject));
Assert.AreEqual(1, objs.Count);
}
#if NET_2_0
[Test(Description = "http://opensource2.atlassian.com/projects/spring/browse/SPRNET-112")]
public void ObjectCreatedViaStaticGenericFactoryMethodUsesReturnTypeOfGenericFactoryMethodAsTheObjectType()
{
@@ -188,7 +188,7 @@ namespace Spring.Objects.Factory
IDictionary objs = lof.GetObjectsOfType(typeof(TestGenericObject<string, int>));
Assert.AreEqual(1, objs.Count);
}
#endif
/// <summary>
/// Object instantiation through factory method should not require type attribute.
/// </summary>

View File

@@ -75,7 +75,6 @@ namespace Spring.Objects.Factory
Assert.AreEqual(6, names.Count);
}
#if NET_2_0
[Test]
public void ObjectNamesIncludingAncestorsPreserveOrderOfRegistration()
{
@@ -95,7 +94,6 @@ namespace Spring.Objects.Factory
mocks.VerifyAll();
}
#endif
[Test]
public void ObjectNamesForTypeIncludingAncestors()
@@ -126,7 +124,6 @@ namespace Spring.Objects.Factory
Assert.AreEqual(0, names.Count);
}
#if NET_2_0
[Test]
public void ObjectNamesForTypeIncludingAncestorsPreserveOrderOfRegistration()
{
@@ -169,7 +166,6 @@ namespace Spring.Objects.Factory
mocks.VerifyAll();
}
#endif
[Test]
public void CountObjectsIncludingAncestorsWithNonHierarchicalFactory()

View File

@@ -20,14 +20,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
#if NET_2_0
using System.Collections.Generic;
#endif
namespace Spring.Objects.Factory.Support
{
/// <summary>
@@ -102,7 +99,6 @@ namespace Spring.Objects.Factory.Support
Assert.AreEqual("fork", mergedMap["one"]);
}
#if NET_2_0
internal class InternalType
{
public string Value = "OK";
@@ -150,6 +146,5 @@ namespace Spring.Objects.Factory.Support
Assert.AreEqual(1, resolved.Count);
Assert.AreEqual(typeof(List<string>), resolved["key"].GetType());
}
#endif
}
}
}

View File

@@ -719,7 +719,6 @@ namespace Spring.Objects.Factory.Xml
Assert.IsTrue((bool)obj["3"].GetValue());
}
#if NET_2_0
[Test]
public void TypedGenericList()
{
@@ -741,7 +740,6 @@ namespace Spring.Objects.Factory.Xml
Assert.AreEqual("ALEKSANDAR SEOVIC", obj["2"].GetValue());
Assert.IsTrue((bool)obj["3"].GetValue());
}
#endif
}
#region Helper classes
@@ -772,7 +770,6 @@ namespace Spring.Objects.Factory.Xml
}
}
#if NET_2_0
public class GenericExpressionHolder
{
private System.Collections.Generic.IList<IExpression> expressionsList;
@@ -798,11 +795,6 @@ namespace Spring.Objects.Factory.Xml
get { return this.expressionsDictionary[key]; }
}
}
#else
public class GenericExpressionHolder : NonGenericExpressionHolder
{}
#endif
#endregion
}
}

View File

@@ -28,7 +28,6 @@ using Spring.Aop.Config;
using Spring.Core.IO;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Validation;
#endregion
@@ -68,7 +67,6 @@ namespace Spring.Objects.Factory.Xml
new DefaultListableObjectFactory());
reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("/dev/null"));
}
#if NET_2_0
[Test]
public void AutoRegistersAllWellknownNamespaceParsers_Common()
@@ -90,10 +88,6 @@ namespace Spring.Objects.Factory.Xml
}
}
#endif
#if NET_3_0
[Test]
public void AutoRegistersAllWellknownNamespaceParsers_3_0()
{
@@ -105,7 +99,6 @@ namespace Spring.Objects.Factory.Xml
string.Format("Parser for Namespace {0} could not be auto-registered.", ns));
}
}
#endif
[Test]
[Ignore] //this test cannot co-exist with AutoRegistersAllWellknownNamespaceParsers b/c that test will have already loaded the Spring.Data ass'y

View File

@@ -22,9 +22,7 @@
using System;
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
@@ -112,7 +110,6 @@ namespace Spring.Objects
}
#if NET_2_0
public class GenericPerson
{
private List<string> favoriteNames = new List<string>();
@@ -143,7 +140,6 @@ namespace Spring.Objects
}
}
#endif
public class AltPerson
{

View File

@@ -87,7 +87,6 @@ namespace Spring.Objects.Support
Assert.AreEqual(27, (int)actual);
}
#if NET_2_0
[Test]
public void InvokeWithGenericStaticMethod()
{
@@ -99,7 +98,6 @@ namespace Spring.Objects.Support
Assert.IsNotNull(actual);
Assert.AreEqual(typeof(TestObject), actual.GetType());
}
#endif
[Test]
public void InvokeWithOKArguments()

View File

@@ -18,11 +18,8 @@
#endregion
#if NET_2_0
#region Imports
using System;
using System.Collections.Generic;
#endregion
@@ -106,4 +103,3 @@ namespace Spring.Objects
#endregion
}
}
#endif

View File

@@ -282,10 +282,6 @@ namespace Spring.Proxy
#if !MONO
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
[Test]
#if !NET_2_0
[Ignore("GetCustomAttributes() does not return SecurityAttribute in .NET 1.x")]
#endif
public void ProxySecurityAttribute()
{
IProxyTypeBuilder builder = GetProxyBuilder();
@@ -473,7 +469,6 @@ namespace Spring.Proxy
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's parameter.");
}
#if NET_2_0
[Test]
public void ProxyTargetMethodReturnValueAttributes()
{
@@ -670,7 +665,6 @@ namespace Spring.Proxy
}
#endregion
#endif
protected abstract IProxyTypeBuilder GetProxyBuilder();

View File

@@ -274,7 +274,6 @@ namespace Spring.Proxy
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's parameter.");
}
#if NET_2_0
[Test]
public void ProxyTargetVirtualMethodReturnValueAttributes()
{
@@ -321,7 +320,6 @@ namespace Spring.Proxy
Assert.IsNotNull(attrs);
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's return value.");
}
#endif
protected override IProxyTypeBuilder GetProxyBuilder()
{

View File

@@ -127,7 +127,6 @@ namespace Spring.Reflection.Dynamic
Assert.AreEqual("here we go...", myProperty.GetValue(null));
}
#if NET_2_0
[Test, Ignore("test N/A anymore due to System.Reflection.Emit.DynamicMethod")]
[ExpectedException(typeof(MethodAccessException))]
public void TestForRestrictiveGetter()
@@ -164,7 +163,6 @@ namespace Spring.Reflection.Dynamic
//this should never execute
Assert.AreEqual(123, second.GetValue(something));
}
#endif
#region Performance tests
@@ -341,7 +339,6 @@ namespace Spring.Reflection.Dynamic
}
}
#if NET_2_0
public class Something
{
public int First
@@ -372,7 +369,4 @@ namespace Spring.Reflection.Dynamic
private int third;
}
#endif
}

View File

@@ -132,9 +132,6 @@ namespace Spring.Reflection.Dynamic
Assert.AreEqual(s1, s2);
}
#if NET_2_0
[Test]
public void CanReadPrivateReadOnlyField()
{
@@ -165,7 +162,6 @@ namespace Spring.Reflection.Dynamic
Assert.IsTrue( sex.Message.IndexOf("ReflectionPermission") > -1 );
}
}
#endif
[Test]
public void CannotSetStaticReadOnlyField()

View File

@@ -83,7 +83,6 @@ namespace Spring.Reflection.Dynamic
#endregion
#if NET_2_0
private string RespectsPermissionsPrivateMethod()
{
return "Result";
@@ -131,7 +130,6 @@ namespace Spring.Reflection.Dynamic
catch (MethodAccessException)
{ }
}
#endif
[Test]
public void TestInstanceMethods()
@@ -159,8 +157,6 @@ namespace Spring.Reflection.Dynamic
Assert.IsFalse((bool)isNullOrEmpty.Invoke(null, new object[] { "Ana Maria" }));
}
#if NET_2_0
internal class TheClassAsArgument { }
internal class TheClassDerivedFromTheArgumentClass : TheClassAsArgument { }
@@ -192,7 +188,7 @@ namespace Spring.Reflection.Dynamic
Assert.AreEqual(dt, dm.Invoke(null, dt));
}
#endif
[Test]
public void PassInvalidNumberOfArguments()
{
@@ -340,7 +336,7 @@ namespace Spring.Reflection.Dynamic
{
return arg;
}
#if NET_2_0
public static object Invoke(object target, object[] args)
{
return PassNullableArgumentStatic((DateTime?)(args[0]));
@@ -355,7 +351,6 @@ namespace Spring.Reflection.Dynamic
{
return arg;
}
#endif
}
#endregion
}

View File

@@ -25,7 +25,6 @@ using System.CodeDom.Compiler;
using System.IO;
using System.Reflection;
using System.Text;
using Microsoft.VisualBasic;
using NUnit.Framework;
using Spring.Util;
@@ -109,7 +108,6 @@ namespace Spring.Reflection.Dynamic
Assert.AreEqual("Arg3", ThisArg2.GetValue(o));
}
#if NET_2_0
[Test]
public void TestForRestrictiveSetterWithSafeWrapper()
{
@@ -143,7 +141,6 @@ namespace Spring.Reflection.Dynamic
//this should not cause MethodAccessException, "first" is createtd using "CreateSafe"
Assert.AreEqual(123, first.GetValue(something));
}
#endif
#region VB TestClass Code
@@ -166,14 +163,10 @@ namespace Spring.Reflection.Dynamic
args.GenerateInMemory = true;
args.GenerateExecutable = false;
args.IncludeDebugInformation = true;
#if NET_2_0
CodeDomProvider provider = CodeDomProvider.CreateProvider( "VisualBasic" );
CompilerResults results = provider.CompileAssemblyFromSource( args, vbSourceCode );
#else
CodeDomProvider provider = new VBCodeProvider();
ICodeCompiler compiler = provider.CreateCompiler();
CompilerResults results = compiler.CompileAssemblyFromSource( args, vbSourceCode );
#endif
if (results.Errors.HasErrors)
{
StringBuilder sb = new StringBuilder();

View File

@@ -18,8 +18,6 @@
#endregion
#if NET_2_0
using System;
using System.Configuration;
using System.Data.SqlClient;
@@ -161,9 +159,7 @@ namespace Spring
securityPermissionFlag |= SecurityPermissionFlag.UnmanagedCode;
}
mediumTrustPermissionSet.AddPermission(new SecurityPermission(securityPermissionFlag));
#if NET_2_0
mediumTrustPermissionSet.AddPermission(new System.Net.Mail.SmtpPermission(System.Net.Mail.SmtpAccess.Connect));
#endif
mediumTrustPermissionSet.AddPermission(new SqlClientPermission(PermissionState.Unrestricted));
mediumTrustPermissionSet.AddPermission(new WebPermission());
pLevel.AddNamedPermissionSet(mediumTrustPermissionSet);
@@ -521,5 +517,3 @@ namespace Spring
// }
}
}
#endif

View File

@@ -22,7 +22,7 @@
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Core.Tests\Debug\</OutputPath>

View File

@@ -111,15 +111,9 @@ namespace Spring
using (Stream stm = GetStream(context, ext))
{
#if !NET_2_0
XmlValidatingReader validatingReader = new XmlValidatingReader(stm, XmlNodeType.Document, null);
validatingReader.ValidationType = ValidationType.Schema;
XmlSchemaCollection schemas = validatingReader.Schemas;
#else
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
XmlSchemaSet schemas = settings.Schemas;
#endif
foreach (IResource schemaResource in schemaResources)
{
@@ -133,9 +127,7 @@ namespace Spring
schemas.Add(targetNamespace, new XmlNodeReader(schemaDoc));
}
#if NET_2_0
XmlReader validatingReader = XmlReader.Create(stm, settings);
#endif
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(validatingReader);
validatingReader.Close();

View File

@@ -45,7 +45,6 @@ namespace Spring.Util
Assert.AreEqual("Iron Brew", dude.Soda); // should have got through before exception was thrown
}
#if NET_2_0
[Test]
public void RaiseSwallowsExceptionRaisedByHandlerButCallsAllOtherHandlers()
{
@@ -68,6 +67,5 @@ namespace Spring.Util
Assert.IsTrue(secondCall);
Assert.IsTrue(thirdCall);
}
#endif
}
}

View File

@@ -169,28 +169,8 @@ namespace Spring.Util
public void BitwiseOr()
{
Assert.AreEqual( ((Byte)2) | ((Byte)3), NumberUtils.BitwiseOr((Byte)2, (Byte)3));
#if NET_2_0
Assert.AreEqual(((SByte)2) | ((SByte)3), NumberUtils.BitwiseOr((SByte)2, (SByte)3));
#else
try
{
NumberUtils.BitwiseOr((SByte)2, (SByte)3);
Assert.Fail();
}
catch (ArgumentException)
{ }
#endif
#if NET_2_0
Assert.AreEqual(((Int16)2) | ((Int16)3), NumberUtils.BitwiseOr((Int16)2, (Int16)3));
#else
try
{
NumberUtils.BitwiseOr((Int16) 2, (Int16) 3);
Assert.Fail();
}
catch(ArgumentException)
{}
#endif
Assert.AreEqual(((UInt16)2) | ((UInt16)3), NumberUtils.BitwiseOr((UInt16)2, (UInt16)3));
Assert.AreEqual(((Int32)2) | ((Int32)3), NumberUtils.BitwiseOr((Int32)2, (Int32)3));
Assert.AreEqual(((UInt32)2) | ((UInt32)3), NumberUtils.BitwiseOr((UInt32)2, (UInt32)3));

View File

@@ -22,16 +22,12 @@
using System;
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.Reflection;
using System.Runtime.Serialization;
using System.Security.Policy;
using NUnit.Framework;
using Spring.Objects;
using Spring.Objects.Factory;
using Spring.Util;
#endregion
@@ -134,7 +130,6 @@ namespace Spring.Util
}
}
#if NET_2_0
[Test]
[ExpectedException(typeof(FatalReflectionException))]
public void InstantiateTypeWithOpenGenericType()
@@ -147,7 +142,6 @@ namespace Spring.Util
{
// ObjectUtils.InstantiateType(typeof(Dictionary<string, int>), new object[] { new object() } );
}
#endif
[Test]
[ExpectedException(typeof(FatalReflectionException))]

View File

@@ -53,7 +53,6 @@ namespace Spring.Util
Assert.AreEqual(i1, i2);
}
#if NET_2_0
[Test]
public void MediumTrustAllowsCopyingBetweenTypesFromSameModule()
{
@@ -92,7 +91,6 @@ namespace Spring.Util
ReflectionUtils.MemberwiseCopy(a, b);
}
}
#endif
}
#region Test Support Classes

View File

@@ -36,9 +36,7 @@ using Spring.Objects.Factory.Attributes;
#endregion
#if NET_2_0
[assembly: InternalsVisibleTo("ReflectionUtils.IsTypeVisible.AssemblyTestName")]
#endif
namespace Spring.Util
{
@@ -227,12 +225,9 @@ namespace Spring.Util
{
}
#if NET_2_0
public void MethodWithNullableIntegerArg(int? nullableInteger)
{
}
#endif
}
#endregion
@@ -546,7 +541,7 @@ namespace Spring.Util
// TODO : actually emit the attribute and check it...
}
#if NET_2_0
[Test]
public void CreatCustomAttriubtesFromCustomAttributeData()
{
@@ -641,7 +636,6 @@ namespace Spring.Util
}
}
internal class TestClassHavingAttributeWithEnumArraySetInConstructor : IHaveSomeMethod
{
@@ -736,8 +730,6 @@ namespace Spring.Util
}
#endif
[Test]
public void CreateCustomAttributeUsingDefaultValuesForTheConstructor()
{
@@ -926,8 +918,6 @@ namespace Spring.Util
Assert.AreSame(candidateMethods[1], resolvedMethod);
}
#if NET_2_0
[Test]
public void GetMethodByArgumentValuesMatchesNullableArgs()
{
@@ -957,8 +947,6 @@ namespace Spring.Util
Assert.AreSame(candidateMethods[3], resolvedMethod);
}
#endif
[Test]
public void GetConstructorByArgumentValuesResolvesToExactMatchIfAvailable()
{
@@ -1104,7 +1092,6 @@ namespace Spring.Util
Assert.IsFalse(ReflectionUtils.IsTypeVisible(type));
}
#if NET_2_0
private static readonly string FRIENDLY_ASSEMBLY_NAME = "ReflectionUtils.IsTypeVisible.AssemblyTestName";
[Test]
@@ -1205,9 +1192,6 @@ namespace Spring.Util
Assert.That(ReflectionUtils.IsNullableType(type), Is.False);
}
#endif
[Test]
public void GetCustomAttributesOnType()
{
@@ -1268,7 +1252,6 @@ namespace Spring.Util
Assert.AreEqual(ex, appEx);
}
#if NET_2_0
[Test]
public void CanGetFriendlyNamesForGenericTypes()
{
@@ -1276,7 +1259,7 @@ namespace Spring.Util
Assert.AreEqual("System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, int>>", ReflectionUtils.GetTypeFriendlyName(t));
}
#endif
#endregion
#region Helper Methods
@@ -1520,12 +1503,11 @@ namespace Spring.Util
{
return "AssignableMatch";
}
#if NET_2_0
public string MethodWithNullableArgument(int? nullableInteger)
{
return "NullableArgumentMatch";
}
#endif
}
public sealed class MyCustomAttribute : Attribute

View File

@@ -1,4 +1,3 @@
#if NET_2_0
#region License
/*
@@ -265,4 +264,3 @@ namespace Spring.Data
}
}
}
#endif

View File

@@ -19,8 +19,6 @@
#endregion
#if NET_2_0
using System;
using System.Collections.Generic;
using System.Data;
@@ -125,4 +123,3 @@ namespace Spring.Data.Generic
}
}
}
#endif

View File

@@ -19,8 +19,6 @@
#endregion
#if NET_2_0
using System.Collections.Generic;
using Spring.Objects;
@@ -31,5 +29,3 @@ namespace Spring.Data.Generic
IList<TestObject> FindAll();
}
}
#endif

View File

@@ -19,8 +19,6 @@
#endregion
#if NET_2_0
using System.Collections.Generic;
using System.Data;
using Spring.Objects;
@@ -51,5 +49,3 @@ namespace Spring.Data.Generic
}
}
}
#endif

View File

@@ -19,11 +19,8 @@
#endregion
#if NET_2_0
using System.Data;
using Spring.Objects;
using Spring.Data.Generic;
namespace Spring.Data.Generic
{
@@ -47,5 +44,3 @@ namespace Spring.Data.Generic
}
}
}
#endif

View File

@@ -18,8 +18,6 @@
#endregion
#if NET_2_0
#region Imports
using System;
@@ -171,4 +169,3 @@ namespace Spring.Data
}
}
}
#endif

View File

@@ -19,8 +19,6 @@
#endregion
#if NET_2_0
#region Imports
using System;
@@ -30,7 +28,6 @@ using System.Reflection;
using NUnit.Framework;
using Spring.Data.Common;
using Spring.Data.Generic;
using Spring.Data.Objects.Generic;
using Spring.Objects;
#endregion
@@ -175,5 +172,3 @@ namespace Spring.Data.Objects.Generic
}
}
#endif

View File

@@ -19,8 +19,6 @@
#endregion
#if NET_2_0
using System;
using System.Data;
using Spring.Data.Generic;
@@ -49,5 +47,3 @@ namespace Spring.Data.Objects.Generic
}
}
}
#endif

View File

@@ -18,12 +18,11 @@
#endregion
#if NET_2_0 && !MONO
#if !MONO
#region Imports
using System;
//using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Data;
@@ -33,7 +32,6 @@ using NUnit.Framework;
using Spring.Data.Common;
using Spring.Data.Generic;
using Spring.Data.Objects;
//using Sybase.Data.AseClient;
#endregion

View File

@@ -18,20 +18,15 @@
#endregion
#if NET_2_0
#region Imports
using System;
using System.Data.SqlClient;
using System.Transactions;
using NUnit.Framework;
using Spring.Aop.Config;
using Spring.Context;
using Spring.Context.Support;
using Spring.Data.Config;
using Spring.Objects;
using Spring.Objects.Factory.Xml;
using Spring.Transaction.Config;
#endregion
@@ -94,4 +89,3 @@ namespace Spring.Data
}
}
}
#endif

View File

@@ -22,7 +22,7 @@
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Data.Integration.Tests\Debug\</OutputPath>

View File

@@ -88,13 +88,9 @@ namespace Spring.Data.NHibernate
ISessionFactory sf = ctx["SessionFactory"] as ISessionFactory;
IDbProvider dbProvider = SessionFactoryUtils.GetDbProvider(sf);
#if NET_2_0
Assert.AreEqual("Microsoft SQL Server, provider V2.0.0.0 in framework .NET V2.0",
dbProvider.DbMetadata.ProductName);
#else
Assert.AreEqual("Microsoft SQL Server, provider V1.0.5000.0 in framework .NET V1.1",
dbProvider.DbMetadata.ProductName);
#endif
}

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Data.NHibernate.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Data.NHibernate.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Data.NHibernate.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View File

@@ -38,11 +38,10 @@
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="*.dll" />
<include name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12*.dll" />
<exclude name="Spring.Data.NHibernate21*.dll" />
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate21*.dll" />
<exclude name="Spring.Data.NHibernate3*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">

View File

@@ -22,7 +22,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Data.NHibernate20.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0,NH_2_0</DefineConstants>
<DefineConstants>TRACE;DEBUG;NH_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Data.NHibernate20.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NH_2_0</DefineConstants>
<DefineConstants>TRACE;NH_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -39,11 +39,10 @@
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="*.dll" />
<include name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12*.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate21*.dll" />
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
<exclude name="Spring.Data.NHibernate3*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">

View File

@@ -38,11 +38,10 @@
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="*.dll" />
<include name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12*.dll" />
<exclude name="Spring.Data.NHibernate20*.dll" />
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate20*.dll" />
<exclude name="Spring.Data.NHibernate3*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">

View File

@@ -39,10 +39,10 @@
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="*.dll" />
<include name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12*.dll" />
<exclude name="Spring.Data.NHibernate20*.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate20*.dll" />
<exclude name="Spring.Data.NHibernate3*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Data.NHibernate30.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>

View File

@@ -32,11 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.Tests.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate31*.dll" />
<exclude name="Spring.Data.NHibernate32*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -23,7 +23,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Data.NHibernate30.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Data.NHibernate30.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -32,10 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate31*.dll" />
<exclude name="Spring.Data.NHibernate32*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -32,11 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.Tests.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate30*.dll" />
<exclude name="Spring.Data.NHibernate32*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -23,7 +23,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Data.NHibernate31.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Data.NHibernate31.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -32,10 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate30*.dll" />
<exclude name="Spring.Data.NHibernate32*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -32,11 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.Tests.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate30*.dll" />
<exclude name="Spring.Data.NHibernate31*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -23,7 +23,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Data.NHibernate32.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.Net.2010\Spring.Data.NHibernate32.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0,NET_2_1</DefineConstants>
<DefineConstants>TRACE;NET_2_0,NH_2_0,NH_2_1</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@@ -32,10 +32,11 @@
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="Spring.Data.NHibernate1*.dll" />
<exclude name="Spring.Data.NHibernate2*.dll" />
<exclude name="Spring.Data.NHibernate30*.dll" />
<exclude name="Spring.Data.NHibernate31*.dll" />
<exclude name="Spring.Data.NHibernate*Tests*.dll" />
<exclude name="CloverRuntime.dll" />
<exclude if="${net-4.0}" name="System.Web.Extensions.dll" />
</references>

View File

@@ -18,11 +18,9 @@
#endregion
#if (NET_2_0)
#region Imports
using System.Data;
using System.Data.OracleClient;
using NUnit.Framework;
#endregion
@@ -72,4 +70,3 @@ namespace Spring.Data.Common
}
}
#endif

View File

@@ -74,8 +74,6 @@ namespace Spring.Data.Common
ctx = new XmlApplicationContext("assembly://Spring.Data.Tests/Spring.Data.Common/DbProviderFactoryTests.xml");
}
#if NET_2_0
[Test]
public void ThreadSafety()
{
@@ -154,7 +152,6 @@ namespace Spring.Data.Common
Assert.IsNotNull(provider.CreateParameter());
Assert.AreEqual(":Foo", provider.CreateParameterName("Foo"));
}
#endif
#if NET_4_0

View File

@@ -1,5 +1,3 @@
#if NET_2_0
#region License
/*
@@ -22,11 +20,8 @@
#region Imports
using System.Reflection;
using NUnit.Framework;
using Rhino.Mocks;
using Spring.Data.Core;
using Spring.Objects;
using Spring.Transaction;
using Spring.Transaction.Support;
@@ -152,4 +147,3 @@ namespace Spring.Data.Core
}
}
#endif

View File

@@ -1,5 +1,3 @@
#if NET_2_0
#region License
/*
@@ -192,4 +190,3 @@ namespace Spring.Data.Core
}
}
}
#endif

View File

@@ -20,7 +20,7 @@
<OutputType>Library</OutputType>
<RootNamespace>Spring</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Data.Tests\Debug\</OutputPath>

View File

@@ -11,9 +11,6 @@
-->
<target name="build">
<!-- build Spring.Data.Tests -->
<!-- use .NET 3.5 compiler for tests to allow lambdas etc -->
<property name="temp.nant.settings.currentframework" value="${nant.settings.currentframework}" />
<property name="nant.settings.currentframework" value="net-3.5" if="${nant.settings.currentframework == 'net-2.0' or nant.settings.currentframework == 'net-3.0'}" />
<csc target="library" define="${current.build.defines.csc}"
warnaserror="true"
optimize="${build.optimize}"
@@ -45,9 +42,6 @@
</references>
</csc>
<!-- restore old framework setting -->
<property name="nant.settings.currentframework" value="${temp.nant.settings.currentframework}" />
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
</target>

View File

@@ -98,7 +98,6 @@ namespace Spring.Support
public bool IsDataAccessException(Exception e)
{
#if NET_2_0
if (e is System.Data.Common.DbException)
{
return true;
@@ -107,9 +106,6 @@ namespace Spring.Support
{
return false;
}
#else
return IsDataAccessExceptionBCL11(e);
#endif
}
public bool IsDataAccessExceptionBCL11(Exception e)

View File

@@ -171,11 +171,9 @@ namespace Spring.Transaction
private TransactionPropagation _transactionPropagation = TransactionPropagation.NotSupported;
private bool _readOnly = false;
private string _name = null;
#if NET_2_0
private System.Transactions.EnterpriseServicesInteropOption _esInteropOption;
#endif
#region ITransactionDefinition Members
#region ITransactionDefinition Members
public bool ReadOnly
{
@@ -229,14 +227,11 @@ namespace Spring.Transaction
}
}
#if NET_2_0
public System.Transactions.EnterpriseServicesInteropOption EnterpriseServicesInteropOption
{
get { return _esInteropOption; }
set { _esInteropOption = value; }
}
#endif
#endregion

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Messaging.Ems.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkSubset>
</TargetFrameworkSubset>

Some files were not shown because too many files have changed in this diff Show More