create netstandard2.0 targets
* Spring.Aop * Spring.Core * Spring.Data * Spring.Messaging * Spring.Testing.NUnit
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<NUnitVersion>3.10.1</NUnitVersion>
|
||||
<NUnitTestAdapterVersion>3.10.0</NUnitTestAdapterVersion>
|
||||
<FakeItEasyVersion>4.8.1</FakeItEasyVersion>
|
||||
<MicrosoftTestSDKVersion>15.7.2</MicrosoftTestSDKVersion>
|
||||
<MicrosoftTestSDKVersion>15.8.0</MicrosoftTestSDKVersion>
|
||||
|
||||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
|
||||
<ComVisible>False</ComVisible>
|
||||
@@ -32,6 +32,7 @@
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
|
||||
<LangVersion>latest</LangVersion>
|
||||
<TargetFullFrameworkVersion>net452</TargetFullFrameworkVersion>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Spring.Aop.Framework.Adapter
|
||||
/// <author>Rod Johnson</author>
|
||||
/// <author>Simon White (.NET)</author>
|
||||
[TestFixture]
|
||||
public sealed class ThrowsAdviceInterceptorTests
|
||||
public sealed partial class ThrowsAdviceInterceptorTests
|
||||
{
|
||||
[Test]
|
||||
public void NoHandlerMethods()
|
||||
@@ -201,83 +201,79 @@ namespace Spring.Aop.Framework.Adapter
|
||||
Assert.AreEqual(1, handler.GetCalls("RemotingException"));
|
||||
}
|
||||
|
||||
#region Helper Classes
|
||||
private sealed class MultipleMethodsAreApplicableThrowsHandler
|
||||
{
|
||||
public void AfterThrowing(MethodInfo method, object[] args, object target, RemotingException ex)
|
||||
{
|
||||
}
|
||||
|
||||
private sealed class MultipleMethodsAreApplicableThrowsHandler
|
||||
{
|
||||
public void AfterThrowing(
|
||||
MethodInfo method, object[] args, object target, RemotingException ex)
|
||||
{
|
||||
}
|
||||
public void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
private class ThrowingMyHandler : MyThrowsHandler
|
||||
{
|
||||
private Exception exception;
|
||||
|
||||
private class ThrowingMyHandler : MyThrowsHandler
|
||||
{
|
||||
private Exception exception;
|
||||
public ThrowingMyHandler(Exception ex)
|
||||
{
|
||||
this.exception = ex;
|
||||
}
|
||||
|
||||
public ThrowingMyHandler(Exception ex)
|
||||
{
|
||||
this.exception = ex;
|
||||
}
|
||||
public override void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
base.AfterThrowing(ex);
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
base.AfterThrowing(ex);
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
public class MyThrowsHandler : MethodCounter, IThrowsAdvice
|
||||
{
|
||||
public void AfterThrowing(
|
||||
MethodInfo m, object[] args, object target, HttpException ex)
|
||||
{
|
||||
Count("HttpException");
|
||||
}
|
||||
|
||||
public class MyThrowsHandler : MethodCounter, IThrowsAdvice
|
||||
{
|
||||
public void AfterThrowing(
|
||||
MethodInfo m, object[] args, object target, HttpException ex)
|
||||
{
|
||||
Count("HttpException");
|
||||
}
|
||||
public virtual void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
Count("RemotingException");
|
||||
}
|
||||
|
||||
public virtual void AfterThrowing(RemotingException ex)
|
||||
{
|
||||
Count("RemotingException");
|
||||
}
|
||||
// not valid, wrong number of arguments...
|
||||
public void AfterThrowing(MethodInfo m, Exception ex)
|
||||
{
|
||||
throw new NotSupportedException("Shouldn't be called");
|
||||
}
|
||||
}
|
||||
|
||||
public interface IEcho
|
||||
{
|
||||
int A { get; set; }
|
||||
|
||||
// not valid, wrong number of arguments...
|
||||
public void AfterThrowing(MethodInfo m, Exception ex)
|
||||
{
|
||||
throw new NotSupportedException("Shouldn't be called");
|
||||
}
|
||||
}
|
||||
int EchoException(int i, Exception t);
|
||||
}
|
||||
|
||||
public interface IEcho
|
||||
{
|
||||
int A { get; set; }
|
||||
public class Echo : IEcho
|
||||
{
|
||||
private int a;
|
||||
|
||||
int EchoException(int i, Exception t);
|
||||
}
|
||||
public int A
|
||||
{
|
||||
get { return a; }
|
||||
set { a = value; }
|
||||
}
|
||||
|
||||
public class Echo : IEcho
|
||||
{
|
||||
private int a;
|
||||
public virtual int EchoException(int i, Exception ex)
|
||||
{
|
||||
if (ex != null)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
public int A
|
||||
{
|
||||
get { return a; }
|
||||
set { a = value; }
|
||||
}
|
||||
|
||||
public virtual int EchoException(int i, Exception ex)
|
||||
{
|
||||
if (ex != null)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright <20> 2002-2011 the original author or authors.
|
||||
*
|
||||
@@ -16,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
@@ -93,8 +89,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
return (IAopProxy)proxyCtorInfo.Invoke(new object[] { advisedSupport });
|
||||
}
|
||||
|
||||
#region Serialization Tests
|
||||
|
||||
private object SerializeAndDeserialize(object s)
|
||||
{
|
||||
// Serialize the session
|
||||
@@ -219,8 +213,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(target.TestData, to.TestData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test(Description = "Simple test that if we set values we can get them out again.")]
|
||||
public void ValuesStick()
|
||||
{
|
||||
@@ -243,8 +235,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(name, to.Name);
|
||||
}
|
||||
|
||||
#region ImplementsInterfaceHierarchy Types
|
||||
|
||||
public interface ITestPerson
|
||||
{
|
||||
long Id { get; set; }
|
||||
@@ -281,8 +271,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test(Description = "http://jira.springframework.org/browse/SPRNET-1174")]
|
||||
public void ImplementsInterfaceHierarchy()
|
||||
{
|
||||
@@ -448,8 +436,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(target.Age, proxy2.Age, "Incorrect age");
|
||||
}
|
||||
|
||||
#region ProxyAProxyWhereClassExplicitlyImplementsInterfacesWithSameMethodNamesAndSignatures
|
||||
|
||||
// SPRNET-655
|
||||
[Test]
|
||||
public void ProxyAProxyWhereClassExplicitlyImplementsInterfacesWithSameMethodNamesAndSignatures()
|
||||
@@ -494,8 +480,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
|
||||
public class TheCommand : IServiceCommand, IBusinessCommand
|
||||
{
|
||||
#region IServiceCommand Members
|
||||
|
||||
private int _serviceCount = 0;
|
||||
int IServiceCommand.ServiceCount
|
||||
{
|
||||
@@ -507,10 +491,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
_serviceCount++;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBusinessCommand Members
|
||||
|
||||
private int _businessCount = 0;
|
||||
int IBusinessCommand.BusinessCount
|
||||
{
|
||||
@@ -521,12 +501,8 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
{
|
||||
_businessCount++;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void EqualsMethod()
|
||||
{
|
||||
@@ -555,8 +531,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(target.GetHashCode(), proxy.GetHashCode(), "GetHashCode() not equal");
|
||||
}
|
||||
|
||||
#region ProxyMethodWithRefOutParameters
|
||||
|
||||
[Test]
|
||||
public void ProxyMethodWithRefOutParametersWithDirectCall()
|
||||
{
|
||||
@@ -685,10 +659,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ProxyGenericMethodWithRefOutParameters
|
||||
|
||||
[Test]
|
||||
public void ProxyGenericMethodWithRefOutParametersWithDirectCall()
|
||||
{
|
||||
@@ -789,8 +759,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void ToStringMethod()
|
||||
{
|
||||
@@ -875,8 +843,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(2, ni.Count);
|
||||
}
|
||||
|
||||
#region MultiThreadedProxyCreation
|
||||
|
||||
[Test(Description = "http://opensource.atlassian.com/projects/spring/browse/SPRNET-340")]
|
||||
public void MultiThreadedProxyCreation()
|
||||
{
|
||||
@@ -907,10 +873,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(target.Age, proxy.Age, "Incorrect age");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Attributes
|
||||
|
||||
[Test]
|
||||
public void ProxyTargetTypeAttributes()
|
||||
{
|
||||
@@ -1122,8 +1084,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void AddAdviceAtRuntime()
|
||||
{
|
||||
@@ -1239,10 +1199,8 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(2, cta.GetCalls());
|
||||
}
|
||||
|
||||
#region OneAdvisedObjectCallsAnother
|
||||
|
||||
/// <summary>
|
||||
/// Check that the two MethodInvocations necessary are independent
|
||||
/// Check that the two MethodInvocations necessary are independent
|
||||
/// and don't conflict.
|
||||
/// </summary>
|
||||
[Test]
|
||||
@@ -1304,8 +1262,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void Reentrance()
|
||||
{
|
||||
@@ -1357,8 +1313,8 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check that although a method is eligible for advice chain optimization and
|
||||
/// direct reflective invocation, it doesn't happen if we've asked to see the proxy,
|
||||
/// Check that although a method is eligible for advice chain optimization and
|
||||
/// direct reflective invocation, it doesn't happen if we've asked to see the proxy,
|
||||
/// so as to guarantee a consistent programming model.
|
||||
/// </summary>
|
||||
[Test]
|
||||
@@ -1387,8 +1343,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.Throws<AopConfigException>(() => proxied.IncrementViaProxy());
|
||||
}
|
||||
|
||||
#region TargetReturnsThis
|
||||
|
||||
[Test(Description = "Test that the proxy returns itself when the target returns 'this'.")]
|
||||
public void TargetReturnsThis()
|
||||
{
|
||||
@@ -1410,8 +1364,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void TargetThrowsException()
|
||||
{
|
||||
@@ -1434,8 +1386,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#region InterceptorThrowsException
|
||||
|
||||
[Test]
|
||||
public void InterceptorThrowsException()
|
||||
{
|
||||
@@ -1475,8 +1425,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO : Introduction tests
|
||||
/*
|
||||
[Test(Description = "Test stateful interceptor")]
|
||||
@@ -1501,7 +1449,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
CheckTestObjectIntroduction(advised);
|
||||
}
|
||||
|
||||
private void CheckTestObjectIntroduction(AdvisedSupport advised)
|
||||
private void CheckTestObjectIntroduction(AdvisedSupport advised)
|
||||
{
|
||||
int newAge = 65;
|
||||
|
||||
@@ -1514,12 +1462,12 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
lockable.DoLock();
|
||||
|
||||
Assert.IsTrue(ito.Age == newAge);
|
||||
try
|
||||
try
|
||||
{
|
||||
ito.Age = 1;
|
||||
Assert.Fail("Setters should fail when locked");
|
||||
}
|
||||
catch (LockedException)
|
||||
catch (LockedException)
|
||||
{
|
||||
// ok
|
||||
}
|
||||
@@ -1533,8 +1481,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
*/
|
||||
|
||||
#region MultipleProceedCalls
|
||||
|
||||
[Test]
|
||||
public void MultipleProceedCalls()
|
||||
{
|
||||
@@ -1560,10 +1506,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ReplaceArgument
|
||||
|
||||
[Test]
|
||||
public void ReplaceArgument()
|
||||
{
|
||||
@@ -1675,8 +1617,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// http://forum.springframework.net/showthread.php?t=504
|
||||
/// </summary>
|
||||
@@ -1822,7 +1762,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
|
||||
// TODO : Opaque can be implemented if really usefull (To increase performance)
|
||||
/*
|
||||
public void testCanPreventCastToAdvisedUsingOpaque()
|
||||
public void testCanPreventCastToAdvisedUsingOpaque()
|
||||
{
|
||||
TestObject target = new TestObject();
|
||||
ProxyFactory pf = new ProxyFactory(target);
|
||||
@@ -1846,7 +1786,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
*/
|
||||
|
||||
// TODO AdviceSupportListeners test
|
||||
#region AdviceSupportListeners
|
||||
/*
|
||||
[Test]
|
||||
public void AdviceSupportListeners()
|
||||
@@ -1888,13 +1827,13 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(2, l.adviceChanges);
|
||||
}
|
||||
|
||||
public class CountingAdvisorListener : IAdvisedSupportListener
|
||||
public class CountingAdvisorListener : IAdvisedSupportListener
|
||||
{
|
||||
public int adviceChanges;
|
||||
public int activates;
|
||||
private AdvisedSupport expectedSource;
|
||||
|
||||
public CountingAdvisorListener(AdvisedSupport expectedSource)
|
||||
public CountingAdvisorListener(AdvisedSupport expectedSource)
|
||||
{
|
||||
this.expectedSource = expectedSource;
|
||||
}
|
||||
@@ -1905,18 +1844,18 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
++adviceChanges;
|
||||
}
|
||||
|
||||
public void Activated(AdvisedSupport source)
|
||||
public void Activated(AdvisedSupport source)
|
||||
{
|
||||
Assert.AreEqual(expectedSource,source);
|
||||
++activates;
|
||||
}
|
||||
}
|
||||
|
||||
public class RefreshCountingAdvisorChainFactory : IAdvisorChainFactory
|
||||
public class RefreshCountingAdvisorChainFactory : IAdvisorChainFactory
|
||||
{
|
||||
public int refreshes;
|
||||
|
||||
public void AdviceChanged(AdvisedSupport source)
|
||||
public void AdviceChanged(AdvisedSupport source)
|
||||
{
|
||||
++refreshes;
|
||||
}
|
||||
@@ -1924,17 +1863,14 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
public IList GetInterceptors(IAdvised advised, object proxy, string methodId, MethodInfo method, Type targetType)
|
||||
{
|
||||
return AdvisorChainFactoryUtils.CalculateInterceptors(advised, proxy, method, targetType);
|
||||
}
|
||||
}
|
||||
|
||||
public void Activated(AdvisedSupport source)
|
||||
public void Activated(AdvisedSupport source)
|
||||
{
|
||||
++refreshes;
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region DynamicMethodPointcut
|
||||
|
||||
[Test]
|
||||
public void DynamicMethodPointcutThatAlwaysAppliesStatically()
|
||||
@@ -2012,10 +1948,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region StaticMethodPointcut
|
||||
|
||||
[Test]
|
||||
public void StaticMethodPointcut()
|
||||
{
|
||||
@@ -2055,14 +1987,10 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CloneInvocationToProceedThreeTimes
|
||||
|
||||
// TODO ? ReflectiveMethodInvocation is not Cloneable
|
||||
/*
|
||||
[Test(Description="There are times when we want to call proceed() twice.")]
|
||||
public void CloneInvocationToProceedThreeTimes()
|
||||
public void CloneInvocationToProceedThreeTimes()
|
||||
{
|
||||
//We can do this if we clone the invocation.
|
||||
|
||||
@@ -2113,7 +2041,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
|
||||
// // We want to change the arguments on a clone: it shouldn't affect the original.
|
||||
// public void testCanChangeArgumentsIndependentlyOnClonedInvocation() throws Throwable
|
||||
// public void testCanChangeArgumentsIndependentlyOnClonedInvocation() throws Throwable
|
||||
// {
|
||||
// TestObject to = new TestObject();
|
||||
// ProxyFactory pc = new ProxyFactory(to);
|
||||
@@ -2160,9 +2088,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
// Assert.AreEqual(name1, saver.names.get(1));
|
||||
// }
|
||||
*/
|
||||
#endregion
|
||||
|
||||
#region OverloadedMethodsWithDifferentAdvice
|
||||
|
||||
[Test]
|
||||
public void OverloadedMethodsWithDifferentAdvice()
|
||||
@@ -2245,8 +2170,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO : IAdvised.TargetSource is read only (no setter)
|
||||
/*
|
||||
[Test]
|
||||
@@ -2294,7 +2217,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ProxyIsBoundBeforeTargetSourceInvoked()
|
||||
public void ProxyIsBoundBeforeTargetSourceInvoked()
|
||||
{
|
||||
TestObject target = new TestObject();
|
||||
ProxyFactory pf = new ProxyFactory(target);
|
||||
@@ -2317,17 +2240,15 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
return target;
|
||||
}
|
||||
|
||||
public void releaseTarget(Object target) throws Exception {
|
||||
}
|
||||
public void releaseTarget(Object target) throws Exception {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Just test anything: it will fail if context wasn't found
|
||||
Assert.AreEqual(0, proxy.Age);
|
||||
}
|
||||
*/
|
||||
|
||||
#region BeforeAdvisorIsInvoked
|
||||
|
||||
[Test]
|
||||
public void BeforeAdvisorIsInvoked()
|
||||
{
|
||||
@@ -2365,10 +2286,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO : Multi advice not supported ?
|
||||
#region MultiAdvice
|
||||
|
||||
[Test]
|
||||
[Ignore("Multi advice not supported for now.")]
|
||||
@@ -2420,10 +2338,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BeforeAdviceThrowsException
|
||||
|
||||
[Test]
|
||||
public void BeforeAdviceThrowsException()
|
||||
{
|
||||
@@ -2481,10 +2395,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AfterReturningAdvisorIsInvoked
|
||||
|
||||
[Test]
|
||||
public void AfterReturningAdvisorIsInvoked()
|
||||
{
|
||||
@@ -2533,8 +2443,6 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test]
|
||||
public void AfterReturningAdvisorIsNotInvokedOnException()
|
||||
{
|
||||
@@ -2564,8 +2472,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
Assert.AreEqual(2, car.GetCalls());
|
||||
}
|
||||
|
||||
#region ThrowsAdvisorIsInvoked
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void ThrowsAdvisorIsInvoked()
|
||||
{
|
||||
@@ -2606,6 +2513,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
Assert.AreEqual(1, th.GetCalls("HttpException"));
|
||||
}
|
||||
#endif
|
||||
|
||||
private class EchoPointcutAdvisor : StaticMethodMatcherPointcutAdvisor
|
||||
{
|
||||
@@ -2620,8 +2528,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void AddThrowsAdviceWithoutAdvisor()
|
||||
{
|
||||
@@ -2662,8 +2569,7 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
}
|
||||
Assert.AreEqual(1, th.GetCalls("RemotingException"));
|
||||
}
|
||||
|
||||
#region Arguments
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ArgumentsModification()
|
||||
@@ -2690,36 +2596,24 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
|
||||
public class Interceptor1 : IMethodInterceptor
|
||||
{
|
||||
#region IMethodInterceptor Members
|
||||
|
||||
public object Invoke(IMethodInvocation invocation)
|
||||
{
|
||||
invocation.Proceed();
|
||||
|
||||
return invocation.Arguments[0];
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class Interceptor2 : IMethodInterceptor
|
||||
{
|
||||
#region IMethodInterceptor Members
|
||||
|
||||
public object Invoke(IMethodInvocation invocation)
|
||||
{
|
||||
invocation.Arguments[0] = null;
|
||||
|
||||
return invocation.Proceed();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Helper classes definitions
|
||||
|
||||
public interface INeedsToSeeProxy
|
||||
{
|
||||
@@ -2824,7 +2718,5 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,6 +406,7 @@ namespace Spring.Aop.Framework
|
||||
Assert.AreEqual("set_Name", PointcutForVoid.methodNames[1]);
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void CanAddThrowsAdviceWithoutAdvisor()
|
||||
{
|
||||
@@ -446,7 +447,8 @@ namespace Spring.Aop.Framework
|
||||
// One match
|
||||
Assert.AreEqual(1, th.GetCalls("HttpException"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary> Checks that globals get invoked,
|
||||
/// and that they can add aspect interfaces unavailable
|
||||
/// to other objects. These interfaces don't need
|
||||
@@ -778,6 +780,7 @@ namespace Spring.Aop.Framework
|
||||
Assert.AreEqual(typeof(SingletonTargetSource), pfb.TargetSource.GetType(), "Incorrect target source, expected singleton");
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test(Description = "http://opensource.atlassian.com/projects/spring/browse/SPRNET-293")]
|
||||
public void SupportsTransparentProxyAsTarget()
|
||||
{
|
||||
@@ -807,6 +810,7 @@ namespace Spring.Aop.Framework
|
||||
AppDomain.Unload(domain);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test(Description = "http://opensource.atlassian.com/projects/spring/browse/SPRNET-500")]
|
||||
public void NotAccessibleInterfaceProxying()
|
||||
|
||||
@@ -119,8 +119,11 @@ namespace Spring.Aop.Support
|
||||
Assert.AreEqual(2, nop.Count);
|
||||
|
||||
// Serialize and continue...
|
||||
|
||||
#if !NETCOREAPP // deep chains for Type serialization problems, not worth the effort at the moment
|
||||
p = (IPerson) SerializationTestUtils.SerializeAndDeserialize(p);
|
||||
Assert.AreEqual(newAge, p.GetAge());
|
||||
#endif
|
||||
// Remembers count, but we need to get a new reference to nop...
|
||||
nop = (SerializableNopInterceptor) ((IAdvised) p).Advisors[0].Advice;
|
||||
Assert.AreEqual(2, nop.Count);
|
||||
|
||||
@@ -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
|
||||
@@ -41,9 +41,6 @@ namespace Spring
|
||||
[TestFixture]
|
||||
public class AopSerializationTests
|
||||
{
|
||||
public AopSerializationTests()
|
||||
{ }
|
||||
|
||||
[Test]
|
||||
public void AllAopInfrastructureTypesAreSerializable()
|
||||
{
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
using Common.Logging;
|
||||
using Common.Logging.Simple;
|
||||
|
||||
namespace Spring.Aspects.Exceptions
|
||||
{
|
||||
public class CaptureOutputLogger : TraceLogger
|
||||
{
|
||||
public static readonly string NAME = "capturingLogger";
|
||||
public CaptureOutputLogger()
|
||||
: base(false, NAME, LogLevel.All, true, false, false, null)
|
||||
{ }
|
||||
|
||||
// private LogLevel _currentLogLevel = LogLevel.All;
|
||||
//
|
||||
// private IList logMessages = new ArrayList();
|
||||
//
|
||||
// public IList LogMessages
|
||||
// {
|
||||
// get { return logMessages; }
|
||||
// set { logMessages = value; }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Do the actual logging by constructing the log message using a <see cref="StringBuilder" /> then
|
||||
// /// sending the output to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// /// <param name="level">The <see cref="LogLevel" /> of the message.</param>
|
||||
// /// <param name="message">The log message.</param>
|
||||
// /// <param name="e">An optional <see cref="Exception" /> associated with the message.</param>
|
||||
// private void Write(LogLevel level, object message, Exception e)
|
||||
// {
|
||||
// // Use a StringBuilder for better performance
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// // Append date-time if so configured
|
||||
// // Append a readable representation of the log level
|
||||
// sb.Append(("[" + level.ToString().ToUpper() + "]").PadRight(8));
|
||||
//
|
||||
// // Append the message
|
||||
// sb.Append(message);
|
||||
//
|
||||
// // Append stack trace if not null
|
||||
// if (e != null)
|
||||
// {
|
||||
// sb.Append(Environment.NewLine).Append(e.ToString());
|
||||
// }
|
||||
//
|
||||
// // Print to the appropriate destination
|
||||
// logMessages.Add(sb.ToString());
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Determines if the given log level is currently enabled.
|
||||
// /// </summary>
|
||||
// /// <param name="level"></param>
|
||||
// /// <returns></returns>
|
||||
// private bool IsLevelEnabled(LogLevel level)
|
||||
// {
|
||||
// int iLevel = (int)level;
|
||||
// int iCurrentLogLevel = (int)_currentLogLevel;
|
||||
//
|
||||
// // return iLevel.CompareTo(iCurrentLogLevel); better ???
|
||||
// return (iLevel >= iCurrentLogLevel);
|
||||
// }
|
||||
//
|
||||
// #region ILog Members
|
||||
//
|
||||
// public void Trace(object message)
|
||||
// {
|
||||
// Trace(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Trace(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Trace))
|
||||
// {
|
||||
// Write(LogLevel.Trace, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void Debug(object message)
|
||||
// {
|
||||
// Debug(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Debug(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Debug))
|
||||
// {
|
||||
// Write(LogLevel.Debug, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void Error(object message)
|
||||
// {
|
||||
// Error(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Error(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Error))
|
||||
// {
|
||||
// Write(LogLevel.Error, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void Fatal(object message)
|
||||
// {
|
||||
// Fatal(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Fatal(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Fatal))
|
||||
// {
|
||||
// Write(LogLevel.Fatal, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void Info(object message)
|
||||
// {
|
||||
// Info(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Info(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Info))
|
||||
// {
|
||||
// Write(LogLevel.Info, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void Warn(object message)
|
||||
// {
|
||||
// Warn(message, null);
|
||||
// }
|
||||
//
|
||||
// public void Warn(object message, Exception e)
|
||||
// {
|
||||
// if (IsLevelEnabled(LogLevel.Warn))
|
||||
// {
|
||||
// Write(LogLevel.Warn, message, e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Trace" />. If it is, all messages will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsTraceEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Trace); }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Debug" />. If it is, all messages will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsDebugEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Debug); }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Error" />. If it is, only messages with a <see cref="LogLevel" /> of
|
||||
// /// <see cref="LogLevel.Error" /> and <see cref="LogLevel.Fatal" /> will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsErrorEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Error); }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Fatal" />. If it is, only messages with a <see cref="LogLevel" /> of
|
||||
// /// <see cref="LogLevel.Fatal" /> will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsFatalEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Fatal); }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Info" />. If it is, only messages with a <see cref="LogLevel" /> of
|
||||
// /// <see cref="LogLevel.Info" />, <see cref="LogLevel.Warn" />, <see cref="LogLevel.Error" />, and
|
||||
// /// <see cref="LogLevel.Fatal" /> will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsInfoEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Info); }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Returns <see langword="true" /> if the current <see cref="LogLevel" /> is greater than or
|
||||
// /// equal to <see cref="LogLevel.Warn" />. If it is, only messages with a <see cref="LogLevel" /> of
|
||||
// /// <see cref="LogLevel.Warn" />, <see cref="LogLevel.Error" />, and <see cref="LogLevel.Fatal" />
|
||||
// /// will be sent to <see cref="Console.Out" />.
|
||||
// /// </summary>
|
||||
// public bool IsWarnEnabled
|
||||
// {
|
||||
// get { return IsLevelEnabled(LogLevel.Warn); }
|
||||
// }
|
||||
//
|
||||
// #endregion
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Common.Logging;
|
||||
using Common.Logging.Simple;
|
||||
|
||||
namespace Spring.Aspects.Exceptions
|
||||
{
|
||||
public class CaptureOutputLoggerFactoryAdapter : ILoggerFactoryAdapter, IDisposable
|
||||
{
|
||||
private class CapturingTraceListener : TraceListener
|
||||
{
|
||||
private readonly CaptureOutputLoggerFactoryAdapter adapter;
|
||||
|
||||
public CapturingTraceListener(CaptureOutputLoggerFactoryAdapter adapter)
|
||||
{
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
public override void Write(string message)
|
||||
{
|
||||
adapter.LogMessages.Add(message);
|
||||
}
|
||||
|
||||
public override void WriteLine(string message)
|
||||
{
|
||||
this.Write(message);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly CapturingTraceListener listener;
|
||||
|
||||
public CaptureOutputLoggerFactoryAdapter()
|
||||
{
|
||||
listener = new CapturingTraceListener(this);
|
||||
System.Diagnostics.Trace.Listeners.Add(listener);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
System.Diagnostics.Trace.Listeners.Remove(listener);
|
||||
}
|
||||
|
||||
private IList<string> logMessages = new List<string>();
|
||||
|
||||
public IList<string> LogMessages
|
||||
{
|
||||
get { return logMessages; }
|
||||
set { logMessages = value; }
|
||||
}
|
||||
|
||||
#region ILoggerFactoryAdapter Members
|
||||
|
||||
public ILog GetLogger(Type type)
|
||||
{
|
||||
return GetLogger(type.FullName);
|
||||
}
|
||||
|
||||
public ILog GetLogger(string name)
|
||||
{
|
||||
if (name.Equals("adviceHandler") || name.IndexOf("LogExceptionHandler") >= 0)
|
||||
{
|
||||
CaptureOutputLogger logger = new CaptureOutputLogger();
|
||||
return logger;
|
||||
}
|
||||
|
||||
return new NoOpLogger();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ using System;
|
||||
using System.Collections;
|
||||
|
||||
using Common.Logging;
|
||||
using Common.Logging.Simple;
|
||||
|
||||
using NUnit.Framework;
|
||||
using Spring.Aop.Framework;
|
||||
@@ -42,7 +43,7 @@ namespace Spring.Aspects.Exceptions
|
||||
public class ExceptionHandlerAspectIntegrationTests
|
||||
{
|
||||
private ExceptionHandlerAdvice exceptionHandlerAdvice;
|
||||
private CaptureOutputLoggerFactoryAdapter loggerFactoryAdapter;
|
||||
private CapturingLoggerFactoryAdapter loggerFactoryAdapter;
|
||||
private ILoggerFactoryAdapter originalAdapter;
|
||||
private static bool spelActionExecuted = false;
|
||||
|
||||
@@ -50,7 +51,7 @@ namespace Spring.Aspects.Exceptions
|
||||
public void Setup()
|
||||
{
|
||||
originalAdapter = LogManager.Adapter;
|
||||
loggerFactoryAdapter = new CaptureOutputLoggerFactoryAdapter();
|
||||
loggerFactoryAdapter = new CapturingLoggerFactoryAdapter();
|
||||
LogManager.Adapter = loggerFactoryAdapter;
|
||||
exceptionHandlerAdvice = new ExceptionHandlerAdvice();
|
||||
}
|
||||
@@ -61,7 +62,7 @@ namespace Spring.Aspects.Exceptions
|
||||
// loggerFactoryAdapter.LogMessages.Clear();
|
||||
|
||||
//reset so other tests can produce some output if needed.
|
||||
loggerFactoryAdapter.Dispose();
|
||||
loggerFactoryAdapter.Clear();
|
||||
LogManager.Adapter = originalAdapter;
|
||||
}
|
||||
|
||||
@@ -113,9 +114,9 @@ namespace Spring.Aspects.Exceptions
|
||||
catch (ArithmeticException)
|
||||
{
|
||||
bool found = false;
|
||||
foreach (string message in loggerFactoryAdapter.LogMessages)
|
||||
foreach (CapturingLoggerEvent loggerEvent in loggerFactoryAdapter.LoggerEvents)
|
||||
{
|
||||
if (message.IndexOf("Hello World") >= 0)
|
||||
if (loggerEvent.RenderedMessage.IndexOf("Hello World") >= 0)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
@@ -180,7 +181,7 @@ namespace Spring.Aspects.Exceptions
|
||||
{
|
||||
string logHandlerText = "on exception (#e is System.FooBar) log 'My Message, Method Name ' + #method.Name";
|
||||
|
||||
ExecuteLoggingHandler(logHandlerText, "[WARN] Was not able to evaluate constraint expression [#e is System.FooBar]");
|
||||
ExecuteLoggingHandler(logHandlerText, "Was not able to evaluate constraint expression [#e is System.FooBar]");
|
||||
|
||||
}
|
||||
|
||||
@@ -189,7 +190,7 @@ namespace Spring.Aspects.Exceptions
|
||||
{
|
||||
string logHandlerText = "on exception (1+1) log 'My Message, Method Name ' + #method.Name";
|
||||
|
||||
ExecuteLoggingHandler(logHandlerText, "[WARN] Was not able to unbox constraint expression to boolean [1+1]");
|
||||
ExecuteLoggingHandler(logHandlerText, "Was not able to unbox constraint expression to boolean [1+1]");
|
||||
|
||||
}
|
||||
|
||||
@@ -483,15 +484,15 @@ namespace Spring.Aspects.Exceptions
|
||||
private void AssertSearchString(string searchString)
|
||||
{
|
||||
bool found = false;
|
||||
foreach (string message in loggerFactoryAdapter.LogMessages)
|
||||
foreach (CapturingLoggerEvent loggerEvent in loggerFactoryAdapter.LoggerEvents)
|
||||
{
|
||||
if (message.IndexOf(searchString) >= 0)
|
||||
if (loggerEvent.RenderedMessage.IndexOf(searchString) >= 0)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
Assert.IsTrue(found, "did not find logging output [" + searchString + "] Logging values = "
|
||||
+ StringUtils.CollectionToCommaDelimitedString(loggerFactoryAdapter.LogMessages));
|
||||
+ StringUtils.CollectionToCommaDelimitedString(loggerFactoryAdapter.LoggerEvents));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net452</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.2010.csproj" />
|
||||
@@ -13,9 +13,14 @@
|
||||
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
|
||||
<Compile Remove="Aop\Framework\AutoProxy\AbstractAutoProxyCreatorTests.cs" />
|
||||
<Compile Remove="Aop\Framework\Adapter\ThrowsAdviceInterceptorTests.cs" />
|
||||
<Compile Remove="Aop\Framework\AutoProxy\AbstractAutoProxyCreatorTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Spring.Core.Tests\TestAssemblySetup.cs" Link="TestAssemblySetup.cs" />
|
||||
<Content Include="App.config" CopyToOutputDirectory="PreserveNewest" />
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Spring.Context.Support
|
||||
[Test]
|
||||
public void ThrowsInvalidOperationExceptionOnRecursiveCallsToGetContext()
|
||||
{
|
||||
using (new HookableContextHandler.Guard(new HookableContextHandler.CreateContextFromSectionHandler(GetContextRecursive)))
|
||||
using (new HookableContextHandler.Guard(GetContextRecursive))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -286,6 +286,7 @@ namespace Spring.Context.Support
|
||||
}
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
/// <summary>
|
||||
/// Test the happy day scenario of returning an object
|
||||
/// </summary>
|
||||
@@ -351,6 +352,7 @@ namespace Spring.Context.Support
|
||||
Assert.AreEqual("Mark", to.Name);
|
||||
Assert.AreEqual(35, to.Age);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Test when the code being resolves itself implements IMessageResolvable.
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace Spring.Context.Support
|
||||
msgSource.ToString());
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void ApplyResources()
|
||||
{
|
||||
@@ -89,6 +90,7 @@ namespace Spring.Context.Support
|
||||
Assert.AreEqual("Mark", value.Name, "Name property value not applied.");
|
||||
Assert.AreEqual(35, value.Age, "Age property value not applied.");
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ApplyResourcesWithNullObject()
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace Spring.Core.TypeConversion
|
||||
Assert.Throws<NotSupportedException>(() => vrt.ConvertFrom(string.Empty));
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
[Test]
|
||||
public void ConvertFromGarbageBails()
|
||||
{
|
||||
@@ -83,13 +84,6 @@ namespace Spring.Core.TypeConversion
|
||||
Assert.Throws<FormatException>(() => vrt.ConvertFrom("*&&%%^<5E>"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFromNonSupportedOptionBails()
|
||||
{
|
||||
RGBColorConverter vrt = new RGBColorConverter();
|
||||
Assert.Throws<NotSupportedException>(() => vrt.ConvertFrom(12));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFromName()
|
||||
{
|
||||
@@ -98,6 +92,14 @@ namespace Spring.Core.TypeConversion
|
||||
Color actual = (Color) vrt.ConvertFrom(expected.Name);
|
||||
Assert.AreEqual(expected, actual);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ConvertFromNonSupportedOptionBails()
|
||||
{
|
||||
RGBColorConverter vrt = new RGBColorConverter();
|
||||
Assert.Throws<NotSupportedException>(() => vrt.ConvertFrom(12));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertFromARGB()
|
||||
|
||||
@@ -111,12 +111,14 @@ namespace Spring.Core.TypeConversion
|
||||
Assert.Throws<ArgumentException>(() => cvt.ConvertFrom ("Spring.TestResource.txt,"));
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
[Test]
|
||||
public void ConvertFromBadAssembly()
|
||||
{
|
||||
ResourceManagerConverter cvt = new ResourceManagerConverter();
|
||||
Assert.Throws<ArgumentException>(() => cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly"));
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ConvertFromBad_App_GlobalResources()
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace Spring.DataBinding
|
||||
public Nullable<short> SortOrder { get { return sortOrder; } set { sortOrder = value; } }
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test(Description="http://jira.springframework.org/browse/SPRNET-996")]
|
||||
public void BindToNullable()
|
||||
{
|
||||
@@ -45,6 +46,7 @@ namespace Spring.DataBinding
|
||||
new SimpleExpressionBinding("Text", "SortOrder").BindSourceToTarget(textBox, entity, null);
|
||||
Assert.IsNull(entity.SortOrder);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void WithNullMessageId()
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace Spring.Expressions
|
||||
Assert.AreEqual(new DateTime(2008,1,1), ((IExpression) pofNode).GetValue(new DerivedClass()));
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void CanSetTransparentProxy()
|
||||
{
|
||||
@@ -69,5 +70,6 @@ namespace Spring.Expressions
|
||||
pofNode.SetValue( ouc, null, itpo);
|
||||
Assert.AreSame( tpo, ouc.ObjectProp );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,8 @@ namespace Spring.Globalization.Formatters
|
||||
public void FormatUsingDefaults()
|
||||
{
|
||||
PercentFormatter fmt = new PercentFormatter("en-US");
|
||||
Assert.AreEqual("25.00 %", fmt.Format(0.25));
|
||||
Assert.AreEqual("25.34 %", fmt.Format(0.2534));
|
||||
Assert.AreEqual("25.00%", fmt.Format(0.25).Replace(" ", ""));
|
||||
Assert.AreEqual("25.34%", fmt.Format(0.2534).Replace(" ", ""));
|
||||
|
||||
fmt = new PercentFormatter("sr-SP-Latn");
|
||||
Assert.AreEqual("25,00%", fmt.Format(0.25));
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Spring.Objects.Factory.Attributes
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
ContextRegistry.Clear();
|
||||
_applicationContext = new XmlApplicationContext(false, "assembly://Spring.Core.Tests/Spring.Objects.Factory.Attributes/ByValueObjects.xml");
|
||||
ContextRegistry.RegisterContext(_applicationContext);
|
||||
}
|
||||
|
||||
@@ -87,8 +87,6 @@ namespace Spring.Objects.Factory.Config
|
||||
props["jenny"],
|
||||
"Wrong value for second property");
|
||||
}
|
||||
|
||||
string machineConfig = RuntimeEnvironment.SystemConfigurationFile;
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -43,8 +43,10 @@ namespace Spring.Objects.Factory.Config
|
||||
[TestFixture]
|
||||
public sealed class PropertyPlaceholderConfigurerTests
|
||||
{
|
||||
#if !NETCOREAPP
|
||||
private static string testConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\Northwind.mdb;User ID=Admin;Password=;";
|
||||
private static string testConnectionStringTwo = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\Northwind.mdb;User ID=Admin;Password=Ernie;";
|
||||
#endif
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
@@ -476,6 +478,7 @@ namespace Spring.Objects.Factory.Config
|
||||
"Named argument placeholder value was not replaced.");
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
/// <summary>
|
||||
/// Test that properties can be replaced from NameValueConfiguration sections
|
||||
/// from the main .NET application configuration file.
|
||||
@@ -544,6 +547,7 @@ namespace Spring.Objects.Factory.Config
|
||||
Assert.AreEqual(testConnectionStringTwo, to.DbConnection.ConnectionString);
|
||||
Assert.AreEqual(1000, to.MaxResults);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void WithIgnoreUnresolvablePlaceholder()
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Spring.Objects.Factory.Config
|
||||
public void Serialization()
|
||||
{
|
||||
IDictionary resourceHandlers = new Hashtable();
|
||||
resourceHandlers.Add("httpsss", typeof(UrlResource));
|
||||
resourceHandlers.Add("httpsss", typeof(UrlResource).AssemblyQualifiedName);
|
||||
|
||||
ResourceHandlerConfigurer resourceHandlerConfiguer = new ResourceHandlerConfigurer();
|
||||
resourceHandlerConfiguer.ResourceHandlers = resourceHandlers;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Spring.Objects.Factory.Config
|
||||
public void Serialization()
|
||||
{
|
||||
IDictionary typeAliases = new Hashtable();
|
||||
typeAliases.Add("LinkedList", typeof(LinkedList));
|
||||
typeAliases.Add("LinkedList", typeof(LinkedList).AssemblyQualifiedName);
|
||||
|
||||
TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
|
||||
typeAliasConfigurer.TypeAliases = typeAliases;
|
||||
|
||||
@@ -666,7 +666,6 @@ namespace Spring.Objects.Factory.Xml
|
||||
IResource resource = new ReadOnlyXmlTestResource("collections.xml", GetType());
|
||||
XmlObjectFactory xof = new XmlObjectFactory(resource);
|
||||
IDictionary map = (IDictionary) xof.GetObject("mapFactory");
|
||||
Assert.IsTrue(map is Hashtable);
|
||||
Assert.IsTrue(map.Count == 2);
|
||||
Assert.AreEqual("bar", map["foo"]);
|
||||
Assert.AreEqual("jenny", map["jen"]);
|
||||
@@ -678,7 +677,6 @@ namespace Spring.Objects.Factory.Xml
|
||||
IResource resource = new ReadOnlyXmlTestResource("collections.xml", GetType());
|
||||
XmlObjectFactory xof = new XmlObjectFactory(resource);
|
||||
IDictionary map = (IDictionary) xof.GetObject("pMapFactory");
|
||||
Assert.IsTrue(map is Hashtable);
|
||||
Assert.IsTrue(map.Count == 2);
|
||||
Assert.AreEqual("bar", map["foo"]);
|
||||
Assert.AreEqual("jenny", map["jen"]);
|
||||
|
||||
@@ -65,15 +65,19 @@ namespace Spring.Objects.Factory.Xml
|
||||
[Test]
|
||||
public void AutoRegistersAllWellknownNamespaceParsers_Common()
|
||||
{
|
||||
string[] namespaces = {
|
||||
string[] namespaces =
|
||||
{
|
||||
"http://www.springframework.net/tx",
|
||||
"http://www.springframework.net/aop",
|
||||
"http://www.springframework.net/db",
|
||||
"http://www.springframework.net/database",
|
||||
#if !NETCOREAPP
|
||||
"http://www.springframework.net/remoting",
|
||||
"http://www.springframework.net/nms",
|
||||
"http://www.springframework.net/validation",
|
||||
"http://www.springframework.net/nvelocity" };
|
||||
"http://www.springframework.net/nvelocity",
|
||||
#endif
|
||||
"http://www.springframework.net/validation"
|
||||
};
|
||||
|
||||
foreach (string ns in namespaces)
|
||||
{
|
||||
@@ -81,7 +85,8 @@ namespace Spring.Objects.Factory.Xml
|
||||
string.Format("Parser for Namespace {0} could not be auto-registered.", ns));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void AutoRegistersAllWellknownNamespaceParsers_3_0()
|
||||
{
|
||||
@@ -93,6 +98,7 @@ 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")]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright <20> 2002-2011 the original author or authors.
|
||||
*
|
||||
@@ -16,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -26,7 +22,10 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
#if !NETCOREAPP
|
||||
using System.Web.Services;
|
||||
#endif
|
||||
|
||||
using Common.Logging;
|
||||
using Common.Logging.Simple;
|
||||
|
||||
@@ -1355,6 +1354,7 @@ namespace Spring.Objects.Factory.Xml
|
||||
}
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void AnObjectCanBeIstantiatedWithANotFullySpecifiedAssemblyName()
|
||||
{
|
||||
@@ -1363,6 +1363,7 @@ namespace Spring.Objects.Factory.Xml
|
||||
IDbConnection connection = (IDbConnection) xof.GetObject("connectionNotFullySpecified");
|
||||
Assert.IsNotNull(connection);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ResourceAndInputStream()
|
||||
@@ -1825,6 +1826,7 @@ namespace Spring.Objects.Factory.Xml
|
||||
factory.GetObject("foo");
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void TestExpressionAttribute()
|
||||
{
|
||||
@@ -1866,8 +1868,7 @@ namespace Spring.Objects.Factory.Xml
|
||||
Assert.AreEqual("My First Web Method", ((WebMethodAttribute)eto.SomeDictionary["method1"]).Description);
|
||||
Assert.AreEqual("My Second Web Method", ((WebMethodAttribute)eto.SomeDictionary["method2"]).Description);
|
||||
}
|
||||
|
||||
#region Helper Classes
|
||||
#endif
|
||||
|
||||
public class LazyWorker
|
||||
{
|
||||
@@ -2054,8 +2055,6 @@ namespace Spring.Objects.Factory.Xml
|
||||
destroyed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
@@ -16,10 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -34,8 +28,6 @@ using Spring.Collections;
|
||||
using Spring.Context;
|
||||
using Spring.Objects.Factory;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Spring.Objects
|
||||
{
|
||||
/// <summary>
|
||||
@@ -45,9 +37,7 @@ namespace Spring.Objects
|
||||
/// <author>Mark Pollack (.NET)</author>
|
||||
public class TestObject : MarshalByRefObject, ITestObject, IObjectFactoryAware, IComparable, IOther, IApplicationContextAware, IObjectNameAware, IInitializingObject, ISharedStateAware
|
||||
{
|
||||
#region Event testing members
|
||||
|
||||
public event EventHandler Click;
|
||||
public event EventHandler Click;
|
||||
|
||||
public static event EventHandler StaticClick;
|
||||
|
||||
@@ -75,10 +65,6 @@ namespace Spring.Objects
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public int ObjectNumber
|
||||
{
|
||||
get { return objectNumber; }
|
||||
@@ -347,11 +333,8 @@ namespace Spring.Objects
|
||||
get { return size; }
|
||||
set { size = value;}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Indexers
|
||||
|
||||
public string this[int index]
|
||||
public string this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -371,10 +354,6 @@ namespace Spring.Objects
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
private int exceptionMethodCallCount;
|
||||
private int objectNumber = 0;
|
||||
public FileMode FileModeEnum;
|
||||
@@ -427,11 +406,7 @@ namespace Spring.Objects
|
||||
private NameValueCollection someNameValueCollection;
|
||||
private List<string> someGenericStringList;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor (s) / Destructor
|
||||
|
||||
public TestObject()
|
||||
public TestObject()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -481,20 +456,12 @@ namespace Spring.Objects
|
||||
this.someNameValueCollection = someProps;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static Methods
|
||||
|
||||
public static TestObject Create(string name)
|
||||
public static TestObject Create(string name)
|
||||
{
|
||||
return new TestObject(name, 30);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void AfterPropertiesSet()
|
||||
public void AfterPropertiesSet()
|
||||
{
|
||||
initCompleted = true;
|
||||
}
|
||||
@@ -636,19 +603,13 @@ namespace Spring.Objects
|
||||
return this;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IOther Implementation
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Funny Named method.
|
||||
/// </summary>
|
||||
public virtual void Absquatulate()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public IDictionary SharedState
|
||||
{
|
||||
get { return sharedState; }
|
||||
@@ -656,9 +617,7 @@ namespace Spring.Objects
|
||||
}
|
||||
}
|
||||
|
||||
#region Inner Class : TestObjectConverter
|
||||
|
||||
public class TestObjectConverter : TypeConverter
|
||||
public class TestObjectConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertTo(
|
||||
ITypeDescriptorContext context, Type destinationType)
|
||||
@@ -702,6 +661,4 @@ namespace Spring.Objects
|
||||
return base.ConvertTo(context, culture, param, destinationType);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Copyright <20> 2002-2011 the original author or authors.
|
||||
*
|
||||
@@ -16,17 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Security.Permissions;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Web.Services;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -34,8 +25,6 @@ using NUnit.Framework;
|
||||
using Spring.Objects;
|
||||
using Spring.Util;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Spring.Proxy
|
||||
{
|
||||
/// <summary>
|
||||
@@ -256,6 +245,7 @@ namespace Spring.Proxy
|
||||
Assert.AreEqual(AttributeTargets.All, pepa.Data);
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=161522
|
||||
// should not fail
|
||||
// Use CustomAttributeData if patch applied (.NET 2.0 SP1).
|
||||
@@ -272,13 +262,15 @@ namespace Spring.Proxy
|
||||
object[] attrs = proxy.GetCustomAttributes(false);
|
||||
Assert.IsNotNull(attrs, "Should have had 1 attribute applied to the target type.");
|
||||
Assert.AreEqual(1, attrs.Length, "Should have had 1 attribute applied to the target type.");
|
||||
Assert.AreEqual(typeof(WebServiceAttribute), attrs[0].GetType(), "Wrong System.Type of Attribute applied to the target type.");
|
||||
Assert.AreEqual(typeof(System.Web.Services.WebServiceAttribute), attrs[0].GetType(), "Wrong System.Type of Attribute applied to the target type.");
|
||||
|
||||
WebServiceAttribute wsa = attrs[0] as WebServiceAttribute;
|
||||
var wsa = attrs[0] as System.Web.Services.WebServiceAttribute;
|
||||
Assert.AreEqual("blah", wsa.Name);
|
||||
Assert.AreEqual("http://mynamespace.com", wsa.Namespace);
|
||||
}
|
||||
#if !MONO
|
||||
#endif
|
||||
|
||||
#if !MONO && !NETCOREAPP
|
||||
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
|
||||
[Test]
|
||||
public void ProxySecurityAttribute()
|
||||
@@ -294,6 +286,7 @@ namespace Spring.Proxy
|
||||
Assert.AreEqual(2, attrs.Length, "Should have had 2 attribute applied to the target type.");
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void ProxySpecificTargetTypeAttributeWithArrayConstructor()
|
||||
{
|
||||
@@ -527,8 +520,6 @@ namespace Spring.Proxy
|
||||
Assert.AreEqual(0, attrs.Length, "Should not have attribute applied to the method's return value.");
|
||||
}
|
||||
|
||||
#region ProxyGenericMethod
|
||||
|
||||
[Test]
|
||||
public void ProxyGenericMethod()
|
||||
{
|
||||
@@ -615,10 +606,6 @@ namespace Spring.Proxy
|
||||
{ }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ProxyGenericInterface
|
||||
|
||||
[Test]
|
||||
public void ProxyGenericInterface()
|
||||
{
|
||||
@@ -663,12 +650,8 @@ namespace Spring.Proxy
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected abstract IProxyTypeBuilder GetProxyBuilder();
|
||||
|
||||
#region Helper inner classes definition
|
||||
|
||||
public interface InnerInterface
|
||||
{
|
||||
}
|
||||
@@ -676,13 +659,8 @@ namespace Spring.Proxy
|
||||
public class InnerClass : InnerInterface
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#region Helper classes definition
|
||||
|
||||
public class DoesntImplementAnyInterfaces
|
||||
{
|
||||
}
|
||||
@@ -831,11 +809,13 @@ namespace Spring.Proxy
|
||||
}
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=161522
|
||||
[WebService(Namespace = "http://mynamespace.com", Name = "blah")]
|
||||
[System.Web.Services.WebService(Namespace = "http://mynamespace.com", Name = "blah")]
|
||||
public class ClassWithWebServiceAttribute : IMarkerInterface
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
[FakeGenerateScriptType("ScriptName")]
|
||||
public class ClassWithFakeGenerateScriptTypeAttribute : IMarkerInterface
|
||||
@@ -857,14 +837,16 @@ namespace Spring.Proxy
|
||||
}
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94803
|
||||
[Marker]
|
||||
#pragma warning disable 618
|
||||
[WebPermission(SecurityAction.Deny)]
|
||||
[System.Net.WebPermission(System.Security.Permissions.SecurityAction.Deny)]
|
||||
#pragma warning restore 618
|
||||
public class ClassWithSecurityAttribute : IMarkerInterface
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
public class ClassWithArrayConstructorAttribute : ISomeMarkerInterface
|
||||
{
|
||||
@@ -1002,21 +984,13 @@ namespace Spring.Proxy
|
||||
|
||||
public class MultipleInterfaces : IInherited
|
||||
{
|
||||
#region IInherited Members
|
||||
|
||||
public void Inherited()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBase Members
|
||||
|
||||
public void Base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public interface ITargetObjectTest
|
||||
@@ -1076,7 +1050,4 @@ namespace Spring.Proxy
|
||||
|
||||
public void ApplicationMethod() { }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -144,6 +144,7 @@ namespace Spring.Reflection.Dynamic
|
||||
Assert.AreEqual(u1, u2);
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test, Ignore("TODO: this works as expected when run using TD.NET & R# (in VS2k8), but fails with nant/NET 2.0 ?!?")]
|
||||
public void CannotReadPrivateReadOnlyFieldIfNoReflectionPermission()
|
||||
{
|
||||
@@ -161,6 +162,7 @@ namespace Spring.Reflection.Dynamic
|
||||
Assert.IsTrue( sex.Message.IndexOf("ReflectionPermission") > -1 );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void CannotSetStaticReadOnlyField()
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace Spring.Reflection.Dynamic
|
||||
|
||||
public void RespectsPermissionsPublicMethod() { }
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void CanCreateWithRestrictedPermissions()
|
||||
{
|
||||
@@ -130,6 +131,7 @@ namespace Spring.Reflection.Dynamic
|
||||
catch (MethodAccessException)
|
||||
{ }
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void TestInstanceMethods()
|
||||
|
||||
@@ -45,11 +45,16 @@ namespace Spring.Reflection.Dynamic
|
||||
return new SafeProperty(property);
|
||||
}
|
||||
|
||||
#if NETCOREAPP
|
||||
private bool CanGenerateVisualBasic => false;
|
||||
#else
|
||||
private bool CanGenerateVisualBasic => SystemUtils.MonoRuntime;
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void CanGetSetSimpleProperty()
|
||||
{
|
||||
if (SystemUtils.MonoRuntime)
|
||||
if (!CanGenerateVisualBasic)
|
||||
{
|
||||
// TODO (EE): find solution for Mono
|
||||
return;
|
||||
@@ -64,7 +69,7 @@ namespace Spring.Reflection.Dynamic
|
||||
[Test]
|
||||
public void CanGetSetSimpleIndexer()
|
||||
{
|
||||
if (SystemUtils.MonoRuntime)
|
||||
if (!CanGenerateVisualBasic)
|
||||
{
|
||||
// TODO (EE): find solution for Mono
|
||||
return;
|
||||
@@ -87,7 +92,7 @@ namespace Spring.Reflection.Dynamic
|
||||
[Test]
|
||||
public void CanGetSetComplexIndexer()
|
||||
{
|
||||
if (SystemUtils.MonoRuntime)
|
||||
if (!CanGenerateVisualBasic)
|
||||
{
|
||||
// TODO (EE): find solution for Mono
|
||||
return;
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net452</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.2010.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2010.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2010.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Messaging.Nms\Spring.Messaging.Nms.2010.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Services\Spring.Services.2010.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Template.Velocity\Spring.Template.Velocity.2010.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Messaging.Nms\Spring.Messaging.Nms.2010.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FakeItEasy" Version="$(FakeItEasyVersion)" />
|
||||
<PackageReference Include="FakeItEasy.Analyzer" Version="$(FakeItEasyVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
|
||||
<Reference Include="System.Transactions" />
|
||||
@@ -27,11 +30,22 @@
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
|
||||
<Compile Remove="Context\Attributes\FailAssemblyObjectDefinitionScannerTests.cs" />
|
||||
<Compile Remove="Context\Support\ApplicationContextAwareProcessorTests.cs" />
|
||||
<Compile Remove="Expressions\ExpressionEvaluatorTests.cs" />
|
||||
<Compile Remove="Globalization\AbstractLocalizerTests.cs" />
|
||||
<Compile Remove="Globalization\Localizers\ResourceSetLocalizerTests.cs" />
|
||||
<Compile Remove="Objects\TestTransparentProxyFactory.cs" />
|
||||
<Compile Remove="SecurityTemplate.cs" />
|
||||
<Compile Remove="Threading\CallContextStorageTests.cs" />
|
||||
<Compile Remove="Util\ObjectUtilsTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Data\**">
|
||||
<Content Include="App.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="App.config">
|
||||
<Content Include="Data\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Compile Remove="Context\Attributes\FailAssemblyObjectDefinitionScannerTests.cs" />
|
||||
@@ -56,5 +70,6 @@
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="xcopy "$(ProjectDir)Data" "$(OutDir)" /y /s /q /d" />
|
||||
<Exec Command="copy "$(ProjectDir)App.config" "$(OutDir)testhost.dll.config"" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -22,9 +22,11 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
#if !NETCOREAPP
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Proxies;
|
||||
#endif
|
||||
using NUnit.Framework;
|
||||
using Spring.Objects;
|
||||
|
||||
@@ -177,6 +179,28 @@ namespace Spring.Util
|
||||
AssertNotUnderstandsType(new object(), "target", null, typeof(ArgumentNullException), "Argument 'requiredType' cannot be null.");
|
||||
}
|
||||
|
||||
private void AssertNotUnderstandsType(object target, string targetName, Type requiredType, Type exceptionType, string partialMessage)
|
||||
{
|
||||
try
|
||||
{
|
||||
AssertUtils.Understands(target, targetName, requiredType);
|
||||
Assert.Fail();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
if (ex.GetType() != exceptionType)
|
||||
{
|
||||
Assert.Fail("Expected Exception of type {0}, but was {1}", exceptionType, ex.GetType());
|
||||
}
|
||||
|
||||
if (-1 == ex.Message.IndexOf(partialMessage))
|
||||
{
|
||||
Assert.Fail("Expected Message '{0}', but got '{1}'", partialMessage, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void UnderstandsMethod()
|
||||
{
|
||||
@@ -199,27 +223,6 @@ namespace Spring.Util
|
||||
AssertNotUnderstandsMethod(incompatibleProxy, "incompatibleProxy", getDescriptionMethod, typeof(NotSupportedException), "Target 'incompatibleProxy' is a transparent proxy that does not support methods of 'Spring.Objects.ITestObject'.");
|
||||
}
|
||||
|
||||
private void AssertNotUnderstandsType(object target, string targetName, Type requiredType, Type exceptionType, string partialMessage)
|
||||
{
|
||||
try
|
||||
{
|
||||
AssertUtils.Understands(target, targetName, requiredType);
|
||||
Assert.Fail();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
if (ex.GetType() != exceptionType)
|
||||
{
|
||||
Assert.Fail("Expected Exception of type {0}, but was {1}", exceptionType, ex.GetType());
|
||||
}
|
||||
|
||||
if (-1 == ex.Message.IndexOf(partialMessage))
|
||||
{
|
||||
Assert.Fail("Expected Message '{0}', but got '{1}'", partialMessage, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AssertNotUnderstandsMethod(object target, string targetName, MethodBase method, Type exceptionType, string partialMessage)
|
||||
{
|
||||
try
|
||||
@@ -269,5 +272,6 @@ namespace Spring.Util
|
||||
set { throw new System.NotSupportedException(); }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace Spring.Util
|
||||
Assert.AreEqual(i1, i2);
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void MediumTrustAllowsCopyingBetweenTypesFromSameModule()
|
||||
{
|
||||
@@ -71,6 +72,7 @@ namespace Spring.Util
|
||||
SecurityTemplate.MediumTrustInvoke(new ThreadStart(new CopyCommand(e2, e1).Execute));
|
||||
Assert.AreEqual(e1.Message, e2.Message);
|
||||
}
|
||||
#endif
|
||||
|
||||
class CopyCommand
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Threading;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Forms;
|
||||
using NUnit.Framework;
|
||||
|
||||
using Spring.Objects;
|
||||
@@ -528,10 +527,11 @@ namespace Spring.Util
|
||||
// TODO : actually emit the attribute and check it...
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void CreatCustomAttriubtesFromCustomAttributeData()
|
||||
{
|
||||
Type control = typeof(Control);
|
||||
Type control = typeof(System.Windows.Forms.Control);
|
||||
MethodInfo mi = control.GetMethod("get_Font");
|
||||
System.Collections.Generic.IList<CustomAttributeData> attributes = CustomAttributeData.GetCustomAttributes(mi.ReturnParameter);
|
||||
CustomAttributeBuilder builder = null;
|
||||
@@ -540,8 +540,8 @@ namespace Spring.Util
|
||||
builder = ReflectionUtils.CreateCustomAttribute(customAttributeData);
|
||||
Assert.IsNotNull(builder);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void CreatCustomAttriubtesFromCustomAttributeDataWithSingleEnum()
|
||||
@@ -716,6 +716,7 @@ namespace Spring.Util
|
||||
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void CreateCustomAttributeUsingDefaultValuesForTheConstructor()
|
||||
{
|
||||
@@ -783,6 +784,7 @@ namespace Spring.Util
|
||||
Assert.AreEqual(expectedAge, att.Age);
|
||||
Assert.IsFalse(att.HasSwallowedExplosives);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void HasAtLeastOneMethodWithName()
|
||||
@@ -1208,7 +1210,11 @@ namespace Spring.Util
|
||||
{
|
||||
IList attrs = ReflectionUtils.GetCustomAttributes(typeof(ClassWithAttributes));
|
||||
|
||||
#if NETCOREAPP
|
||||
Assert.AreEqual(1, attrs.Count);
|
||||
#else
|
||||
Assert.AreEqual(2, attrs.Count);
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -1216,7 +1222,11 @@ namespace Spring.Util
|
||||
{
|
||||
IList attrs = ReflectionUtils.GetCustomAttributes(typeof(ClassWithAttributes).GetMethod("MethodWithAttributes"));
|
||||
|
||||
#if NETCOREAPP
|
||||
Assert.AreEqual(1, attrs.Count);
|
||||
#else
|
||||
Assert.AreEqual(2, attrs.Count);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1280,6 +1290,7 @@ namespace Spring.Util
|
||||
return one + two;
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
private Attribute CheckForPresenceOfCustomAttribute(
|
||||
CustomAttributeBuilder attBuilder, Type attType)
|
||||
{
|
||||
@@ -1310,7 +1321,7 @@ namespace Spring.Util
|
||||
classBuilder.SetCustomAttribute(attBuilder);
|
||||
return classBuilder.CreateType();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -73,11 +73,5 @@ namespace Spring.Util
|
||||
Assert.Fail("ThreadId should be an integer");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Clr4Runtime()
|
||||
{
|
||||
Assert.IsTrue(SystemUtils.Clr4Runtime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
#region Imports
|
||||
|
||||
using System.Data;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
#endregion
|
||||
@@ -39,6 +40,8 @@ namespace Spring.Data.Common
|
||||
{
|
||||
}
|
||||
|
||||
// TODO separate providers for OracleClient
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void OracleClient()
|
||||
{
|
||||
@@ -52,6 +55,7 @@ namespace Spring.Data.Common
|
||||
Assert.IsNotNull(springParameter);
|
||||
Assert.AreEqual("foo", springParameter);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void SqlClient()
|
||||
@@ -66,7 +70,5 @@ namespace Spring.Data.Common
|
||||
Assert.IsNotNull(springParameter);
|
||||
Assert.AreEqual("foo", springParameter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,7 @@ namespace Spring.Data.Common
|
||||
Assert.AreEqual("156", errorCode);
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void DefaultInstanceWithSqlServer20()
|
||||
{
|
||||
@@ -141,7 +142,7 @@ namespace Spring.Data.Common
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultInstanceWithMicrsoftOracleClient20()
|
||||
public void DefaultInstanceWithMicrosoftOracleClient20()
|
||||
{
|
||||
IDbProvider provider = DbProviderFactory.GetDbProvider("OracleClient-2.0");
|
||||
Assert.AreEqual("Oracle, Microsoft provider V2.0.0.0", provider.DbMetadata.ProductName);
|
||||
@@ -153,20 +154,6 @@ namespace Spring.Data.Common
|
||||
Assert.AreEqual(":Foo", provider.CreateParameterName("Foo"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultInstanceWithSqlServer40()
|
||||
{
|
||||
IDbProvider provider = DbProviderFactory.GetDbProvider("SqlServer-4.0");
|
||||
AssertIsSqlServer40(provider);
|
||||
Assert.IsNull(provider.ConnectionString);
|
||||
Assert.IsNotNull(provider.CreateCommand());
|
||||
Assert.IsNotNull(provider.CreateCommandBuilder());
|
||||
Assert.IsNotNull(provider.CreateConnection());
|
||||
Assert.IsNotNull(provider.CreateDataAdapter());
|
||||
Assert.IsNotNull(provider.CreateParameter());
|
||||
Assert.AreEqual("@Foo", provider.CreateParameterName("Foo"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultInstanceWithOleDb40()
|
||||
{
|
||||
@@ -179,6 +166,21 @@ namespace Spring.Data.Common
|
||||
Assert.IsNotNull(provider.CreateParameter());
|
||||
Assert.AreEqual("?", provider.CreateParameterName("Foo"));
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void DefaultInstanceWithSqlServer40()
|
||||
{
|
||||
IDbProvider provider = DbProviderFactory.GetDbProvider("SqlServer-4.0");
|
||||
AssertIsSqlServer40(provider);
|
||||
Assert.IsNull(provider.ConnectionString);
|
||||
Assert.IsNotNull(provider.CreateCommand());
|
||||
Assert.IsNotNull(provider.CreateCommandBuilder());
|
||||
Assert.IsNotNull(provider.CreateConnection());
|
||||
Assert.IsNotNull(provider.CreateDataAdapter());
|
||||
Assert.IsNotNull(provider.CreateParameter());
|
||||
Assert.AreEqual("@Foo", provider.CreateParameterName("Foo"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultInstanceWithOracleClient10_20()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net452</TargetFramework>
|
||||
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
|
||||
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -9,18 +9,22 @@
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2010.csproj" />
|
||||
<ProjectReference Include="..\Spring.Core.Tests\Spring.Core.Tests.2010.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' ">
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data.OracleClient" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Transactions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FakeItEasy" Version="$(FakeItEasyVersion)" />
|
||||
<PackageReference Include="FakeItEasy.Analyzer" Version="$(FakeItEasyVersion)" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
|
||||
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition=" '$(TargetFramework)' == 'netcoreapp2.1' " />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Data.OracleClient" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
|
||||
<Compile Remove="Data\Core\ServiceDomainTransactionManagerTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Spring.Core.Tests\TestAssemblySetup.cs" Link="TestAssemblySetup.cs" />
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Spring.Transaction.Interceptor
|
||||
Assert.Throws<ArgumentException>(() => editor.SetAsText( "PROPAGATION_REQUIRED,ISOLATION_READUNCOMMITTED,XXX" ));
|
||||
}
|
||||
|
||||
#if !NETCOREAPP
|
||||
[Test]
|
||||
public void ValidPropagationCodeAndIsolationCodeAndRollbackRules1()
|
||||
{
|
||||
@@ -96,6 +97,7 @@ namespace Spring.Transaction.Interceptor
|
||||
Assert.IsFalse( ta.RollbackOn( new DataException( ) ) );
|
||||
Assert.IsTrue( ta.RollbackOn( new RemotingException( ) ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void DefaultTransactionAttributeToString()
|
||||
|
||||
@@ -56,10 +56,6 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="TIBCO.EMS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5b83db8ff05c64ba, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
|
||||
@@ -18,12 +18,6 @@
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DotNetMock, Version=0.8.1.0, Culture=neutral, PublicKeyToken=65e474d141e25e07">
|
||||
<HintPath>..\..\..\lib\Mono\2.0\DotNetMock.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DotNetMock.Framework, Version=0.8.1.0, Culture=neutral, PublicKeyToken=65e474d141e25e07">
|
||||
<HintPath>..\..\..\lib\Mono\2.0\DotNetMock.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<ProjectReference Include="..\Spring.Data.Tests\Spring.Data.Tests.2010.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net452</TargetFramework>
|
||||
<TargetFrameworks>netcoreapp2.1;$(TargetFullFrameworkVersion)</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2010.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user