Test loaded from remote folder failed to run with exception System.IODirectory Not Found .
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
High
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
Wishlist
|
Charlie Poole | ||
NUnitLite |
Fix Released
|
High
|
Charlie Poole |
Bug Description
When we load test from remote machine folder as \\MachineName\
System.IODirectory Not Found :Could Not Found Part of the Path 'D:\NUnitProjec
Above scenario was working fine in NUnit-2.5.10.11092. When I tried to find out cause of this issue ,I find that there are changes in
NUnit.Core.
NUnit-2.5.10.11092
public static string GetAssemblyPath
{
return GetAssemblyPath
}
public static string GetAssemblyPath
{
string path = assembly.CodeBase;
Uri uri = new Uri(path);
// If it wasn't loaded locally, use the Location
if (!uri.IsFile)
return assembly.Location;
if (uri.IsUnc)
return path.Substring(
return uri.LocalPath;
}
public static string GetDirectoryName( Assembly assembly )
{
return System.
}
Whereas the code in NUnit version 2.6 is as follow
#region GetAssemblyPath
public static string GetAssemblyPath
{
return GetAssemblyPath
}
public static string GetAssemblyPath
{
if (IsFileUri(uri))
else
}
#endregion
#region
// Public for testing purposes
public static string GetAssemblyPath
{
// Skip over the file://
int start = Uri.UriSchemeFi
if (System.
{
// Handle Windows Drive specifications
if (uri[start] == '/' && uri[start + 2] == ':')
}
else
{
// Assume all Linux paths are absolute
if (uri[start] != '/')
}
return uri.Substring(
}
#endregion
#region GetDirectoryName
public static string GetDirectoryName( Assembly assembly )
{
return System.
}
#endregion
#region Helper Methods
private static bool IsFileUri(string uri)
{
return uri.ToLower(
}
#endregion
Related branches
- Charlie Poole: Needs Fixing
-
Diff: 119 lines (+30/-42)2 files modifiedsrc/NUnitCore/core/AssemblyHelper.cs (+16/-27)
src/NUnitCore/tests/AssemblyHelperTests.cs (+14/-15)
Changed in nunitv2: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Changed in nunitv2: | |
assignee: | nobody → Simone Busoli (simone.busoli) |
Changed in nunitv2: | |
status: | Triaged → In Progress |
Changed in nunitv2: | |
assignee: | Simone Busoli (simone.busoli) → Charlie Poole (charlie.poole) |
Changed in nunitv2: | |
status: | In Progress → Fix Committed |
milestone: | none → 2.6.2 |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
Changed in nunitlite: | |
milestone: | none → 0.9 |
Changed in nunitlite: | |
status: | Triaged → Fix Committed |
Changed in nunitlite: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunit-3.0: | |
milestone: | none → 2.9.6 |
Changed in nunitlite: | |
status: | Fix Committed → Fix Released |
Changed in nunit-3.0: | |
assignee: | nobody → Charlie Poole (charlie.poole) |
status: | Triaged → Fix Committed |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
Looks like some test method got checked in?
The portion below
- // Public for testing purposes FromFileUri( string uri) le.Length + iter.Length;
- public static string GetAssemblyPath
- {
- // Skip over the file://
- int start = Uri.UriSchemeFi
Uri.SchemeDelim
+ #endregion
- if (System. IO.Path. DirectorySepara torChar == '\\')
- {
- // Handle Windows Drive specifications
- if (uri[start] == '/' && uri[start + 2] == ':')
- ++start;
- }
Regards,
Jv
On Fri, Jul 27, 2012 at 12:16 PM, hiteshbhagwat <email address hidden>wrote:
> ** Attachment added: "RunFailed.PNG" /bugs.launchpad .net/bugs/ 1029785/ +attachment/ 3238062/ +files/ RunFailed. PNG TestFolderName load test project Successfully. But when I TestFolderName project loads successfully.But when I tried t\bin\Debug\ MachineName\ TestFolderName' . AssemblyHelper class differnces are as follow AssemblyHelper class.Differnces between these two versions (Type type) (type.Assembly) ; (Assembly assembly) (Type type) Uri.UriSchemeFi le.Length + 1); (type.Assembly) ; (Assembly assembly) IO.Path. GetDirectoryNam e(GetAssemblyPa th(assembly) ); Uri.UriSchemeFi le.Length + 1); IO.Path. GetDirectoryNam e(GetAssemblyPa th(assembly) );
>
> https:/
>
> ** Description changed:
>
> When we load test from remote machine folder as
> - \\MachineName\
> - tried to run same tests it throws exception as follow
> + \\MachineName\
> + to run same tests it throws exception as follow
>
> System.IODirectory Not Found :Could Not Found Part of the Path
> 'D:\NUnitProjec
>
> - Above scenario was working fine in NUnit-2.5.10.11092. When I tried to
> find out cause of this issue ,I find that there are changes in
> - NUnit.Core.
> + Above scenario was working fine in NUnit-2.5.10.11092. When I tried to
> find out cause of this issue ,I find that there are changes in
> + NUnit.Core.
> are as follow
>
> NUnit-2.5.10.11092
>
> - public static string GetAssemblyPath
> - {
> - return GetAssemblyPath
> - }
> -
> -
> - public static string GetAssemblyPath
> + public static string GetAssemblyPath
> {
> - string path = assembly.CodeBase;
> - Uri uri = new Uri(path);
> -
> - // If it wasn't loaded locally, use the Location
> - if (!uri.IsFile)
> - return assembly.Location;
> -
> - if (uri.IsUnc)
> - return path.Substring(
> -
> - return uri.LocalPath;
> + return GetAssemblyPath
> }
>
> - #endregion
> + public static string GetAssemblyPath
> + {
> + string path = assembly.CodeBase;
> + Uri uri = new Uri(path);
>
> - #region GetDirectoryName
> - public static string GetDirectoryName( Assembly assembly )
> - {
> - return
> System.
> - }
> - #endregion
> + // If it wasn't loaded locally, use the Location
> + if (!uri.IsFile)
> + return assembly.Location;
> +
> + if (uri.IsUnc)
> + return path.Substring(
> +
> + return uri.LocalPath;
> + }
> +
> + public static string GetDirectoryName( Assembly assembly )
> + {
> + return System.
> + }
> +
>
>
> - Whereas the code...