Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3811
Modified Files:
RetryAdviceTests.cs
Log Message:
Fix for SPRNET-893 - Retry advice goes into infinite loop when exception type not listed in advice is thrown
Index: RetryAdviceTests.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/RetryAdviceTests.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RetryAdviceTests.cs 10 Oct 2007 07:38:25 -0000 1.2
--- RetryAdviceTests.cs 17 Mar 2008 20:25:41 -0000 1.3
***************
*** 52,55 ****
--- 52,61 ----
}
+ [Test]
+ public void TestUnexpectedException()
+ {
+ InvokeOnceFailWithUnexceptedException(false, false);
+ }
+
private static void InvokeOncePassOnceFail(bool useExceptionName, bool isDelay)
{
***************
*** 68,71 ****
--- 74,90 ----
}
}
+ private static void InvokeOnceFailWithUnexceptedException(bool useExceptionName, bool isDelay)
+ {
+ ITestRemoteService rs = GetRemoteService(3, useExceptionName, isDelay);
+ try
+ {
+ rs.DoTransfer2();
+ Assert.Fail("Should have failed.");
+ }
+ catch (ArgumentException)
+ {
+
+ }
+ }
private static ITestRemoteService GetRemoteService(int numFailures, bool usingExceptionName, bool isDelay)
***************
*** 108,111 ****
--- 127,131 ----
{
void DoTransfer();
+ void DoTransfer2();
}
***************
*** 114,118 ****
private int numFailures;
private int count = 0;
! private bool throwException = false;
public int NumFailures
--- 134,139 ----
private int numFailures;
private int count = 0;
! private bool throwArithmeticException = false;
!
public int NumFailures
***************
*** 122,126 ****
}
! public bool ThrowException
{
get
--- 143,147 ----
}
! public bool ThrowArithmeticException
{
get
***************
*** 134,150 ****
else
{
! return throwException;
}
}
! set { throwException = value; }
}
public void DoTransfer()
{
! if (ThrowException)
{
throw new ArithmeticException("can't do the math");
}
}
}
}
\ No newline at end of file
--- 155,176 ----
else
{
! return throwArithmeticException;
}
}
! set { throwArithmeticException = value; }
}
public void DoTransfer()
{
! if (ThrowArithmeticException)
{
throw new ArithmeticException("can't do the math");
}
}
+
+ public void DoTransfer2()
+ {
+ throw new ArgumentException("bad argument");
+ }
}
}
\ No newline at end of file
|