NUnit And Active Record

View: New views
3 Messages — Rating Filter:   Alert me  

NUnit And Active Record

by Ed Wake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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:ed@...

 


-------------------------------------------------------------------------
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
CastleProject-users@...
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Re: NUnit And Active Record

by hammett-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is isWeb=true on the configuration? It shouldn't.

On 10/17/06, Ed Wake <ed@...> wrote:
> Castle.ActiveRecord.Framework.Scopes.WebThreadScopeInfo.get_CurrentStack()

--
Cheers,
hammett
http://hammett.castleproject.org/

-------------------------------------------------------------------------
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
CastleProject-users@...
https://lists.sourceforge.net/lists/listinfo/castleproject-users


Re: NUnit And Active Record

by Ed Wake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I remember reading that on a post else where (I'm sure it was yourself with
the same advice), but didn't take it in. That sorted it.

Many thanks.
Ed

-----Original Message-----
From: castleproject-users-bounces@...
[mailto:castleproject-users-bounces@...] On Behalf Of
hammett
Sent: 17 October 2006 18:00
To: castleproject-users@...
Subject: Re: [Castle-users] NUnit And Active Record

Is isWeb=true on the configuration? It shouldn't.

On 10/17/06, Ed Wake <ed@...> wrote:
> Castle.ActiveRecord.Framework.Scopes.WebThreadScopeInfo.get_CurrentStack()

--
Cheers,
hammett
http://hammett.castleproject.org/

-------------------------------------------------------------------------
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
CastleProject-users@...
https://lists.sourceforge.net/lists/listinfo/castleproject-users



-------------------------------------------------------------------------
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
CastleProject-users@...
https://lists.sourceforge.net/lists/listinfo/castleproject-users

LightInTheBox - Buy quality products at wholesale price!