← Back to team overview

nunit-core team mailing list archive

[Bug 928421] Re: No ProjectService instantiated in CreateDomain

 

Sorry, I misunderstood and confused the issue. The first issue remains
the same, however.

Services in NUnit are instantiated by the mainline code. Where dependencies exist, as in
the case of DomainManager, which depends on the ProjectService service and the
UserSettings service, those services must be created and initialized before _any_
service is used. 

So your code should look something like what console runner does, with the exception that
you only need to instantiate and initialize DomainManager and its dependencies. I didn't
recheck what the dependencies are, but assuming it's only the two above, your code 
would look like this:


			ServiceManager.Services.AddService( new SettingsService() );
			ServiceManager.Services.AddService( new ProjectService() );
			ServiceManager.Services.AddService( new DomainManager() );			

                        ServiceManager.Services.InitializeServices();

I'm rejecting the bug because it can't be fixed in NUnit without
breaking NUnit.

Charlie


** Changed in: nunitv2
       Status: New => Invalid

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/928421

Title:
  No ProjectService instantiated in CreateDomain

Status in NUnit V2 Test Framework:
  Invalid

Bug description:
  monodevelop was ported to nunit 2.5 in ubuntu.
  Unfortunatly it does not work properly to ProjectService being null in the CreateDomain call, leading to NullReference exception.
  see bug 889241

  I'm not very familiar with the code, so I can't judge if monodevelop is using nunit wrong, it is a bug in porting it to 2.5 or a bug in nunit 2.5
  The issue was introduced in nunit revision 3127

  There is monodevelops use of CreateDomain:
  http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/monodevelop/precise/view/head:/src/addins/NUnit/Services/ExternalTestRunner.cs#L88

  Attached a patch to nunit that appears to fix the issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/928421/+subscriptions


References