Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Issue with Sharepoint Integration Tests
AndrewSwerlick
#1 Posted : Thursday, September 1, 2011 12:43:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/1/2011(UTC)
Posts: 7
Location: Cincinnati OH

I've just started playing with ncrunch and really like the setup. I'm having a little trouble with my integration tests that go against the SharePoint 2010 server object model. In SharePoint development, you have to instantiate the site object using the code

using(SPSite site = new SPSite(<siteUrl>)
{
//code to execute against site goes here.
}

In Nunit itself these tests run fine, but in the ncrunch runner they all fail with a "System.IO.FileNotFoundException" with the Inner Exception message of "The Web application at <serverUrl> cannot be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application." The failure happens at the line where I'm creating the new SPSite object.

What's very interesting is that this issue same issue actually crops up when trying to access the SharePoint2010 server object model in MSTest, unless you have VS SP1 and you make sure your test project targets .NET 3.5. This is a well known and well documented issue, so I wonder if there's a similar root cause here. Below are a few links on the MSTest issue.

The problem described
https://www.nothingbutsh...2010%20Development.aspx

The fix
http://sharepoint.bg/rad...nt-2010-with-MSTest.aspx
Remco
#2 Posted : Thursday, September 1, 2011 6:54:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Interesting. I have a feeling this may be happening because at the moment NCrunch always runs the tests inside a 32-bit process, which according to the articles you've quoted sounds like it would be a problem for sharepoint.

If you haven't already, would you be able to send through a bug report using the NCrunch menu right after the test fails? This will send through a log file containing details about the process it's failing in so I can take a closer look.

Also, thanks for reporting the issue.
AndrewSwerlick
#3 Posted : Thursday, September 1, 2011 9:51:06 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/1/2011(UTC)
Posts: 7
Location: Cincinnati OH

Remco,

Running inside a 32 bit process definitely sounds like the likely culprit. SharePoint 2010 is big on the whole 64 bit thing.

Anyways, I submitted the bug report so you should see that soon. Thanks for taking an interest. I've got all my unit tests in ncrunch and I'm loving the interface. It's a fantastic piece of software.
Remco
#4 Posted : Friday, September 2, 2011 12:15:03 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks again. I'll have a look at the report and will see what I can do.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.032 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download