Hi All,

 

Having followed the example at

http://www.castleproject.org/index.php/ActiveRecord:How_to:Unit_testing

for creating a base class to test from that sets up the session scope etc.. Every time I run a test I get the following error:

  at Castle.ActiveRecord.Framework.Scopes.WebThreadScopeInfo.get_CurrentStack()

   at Castle.ActiveRecord.Framework.Scopes.AbstractThreadScopeInfo.RegisterScope(ISessionScope scope)

   at Castle.ActiveRecord.SessionScope..ctor()

   at AbstractModelTestCase.CreateScope() in E:\solutions\espiritu\Tests\AbstractModelTestCase.cs:line 41

   at AbstractModelTestCase.Init() in E:\solutions\espiritu\Tests\AbstractModelTestCase.cs:line 18

--TearDown

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at NUnit.Core.TestMethod.doTearDown(TestCaseResult testResult)

--TargetInvocationException

   at AbstractModelTestCase.DisposeScope() in E:\solutions\espiritu\Tests\AbstractModelTestCase.cs:line 46

   at AbstractModelTestCase.Terminate() in E:\solutions\espiritu\Tests\AbstractModelTestCase.cs:line 24


The error line boils down to : scope = new SessionScope(); (line 18) and  scope.Dispose(); (line 46) before any tests are run in set set and teardown stage.

The Castle Class it is testing uses lazy loading. Could this be the problem and is there any way round it?

 

Regards,

Ed Wake

Remote New Media
t:01588 680480

w:www.remotenewmedia.co.uk

e:[EMAIL PROTECTED]

 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to