++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * executable.make, library.make, rules.make: quote file name
++ wherever referenced in dist* targets, so that files with spaces in
++ name work fine.
++
2010-01-12 Zoltan Varga <vargaz@gmail.com>
* profiles/basic.make (do-profile-check): Honor the V=1 flag.
for f in `cat $(sourcefile)` ; do \
case $$f in \
../*) : ;; \
-- *) dest=`dirname $$f` ; \
++ *) dest=`dirname "$$f"` ; \
case $$subs in *" $$dest "*) : ;; *) subs=" $$dest$$subs" ; $(MKINSTALLDIRS) $(distdir)/$$dest ;; esac ; \
-- cp -p $$f $(distdir)/$$dest || exit 1 ;; \
++ cp -p "$$f" $(distdir)/$$dest || exit 1 ;; \
esac ; done ; \
for d in . $$subs ; do \
case $$d in .) : ;; *) test ! -f $$d/ChangeLog || cp -p $$d/ChangeLog $(distdir)/$$d ;; esac ; done
for f in `$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES) ; do \
case $$f in \
../*) : ;; \
-- *) dest=`dirname $$f` ; \
++ *) dest=`dirname "$$f"` ; \
case $$subs in *" $$dest "*) : ;; *) subs=" $$dest$$subs" ; $(MKINSTALLDIRS) $(distdir)/$$dest ;; esac ; \
-- cp -p $$f $(distdir)/$$dest || exit 1 ;; \
++ cp -p "$$f" $(distdir)/$$dest || exit 1 ;; \
esac ; done ; \
for d in . $$subs ; do \
case $$d in .) : ;; *) test ! -f $$d/ChangeLog || cp -p $$d/ChangeLog $(distdir)/$$d ;; esac ; done
if test -f makefile; then m=m; fi; \
if test -f GNUmakefile; then m=GNUm; fi; \
for f in $${m}akefile $(DISTFILES) ; do \
-- dest=`dirname $(distdir)/$$f` ; \
-- $(MKINSTALLDIRS) $$dest && cp -p $$f $$dest || exit 1 ; \
++ dest=`dirname "$(distdir)/$$f"` ; \
++ $(MKINSTALLDIRS) $$dest && cp -p "$$f" $$dest || exit 1 ; \
done
if test -d Documentation ; then \
find . -name '*.xml' > .files ; \
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * System.Web_standalone_test.dll.sources,
++ standalone-runner-support.dll.sources: added
++
++ * Makefile: Added targets to build and run standalone tests.
++ Added standalone tests and test tools to EXTRA_DISTFILES
++
2009-12-18 Marek Habersack <mhabersack@novell.com>
* System.Web_test.dll.sources: added
TEST_MCS_FLAGS += -r:System.Web.Extensions.dll
endif
--EXTRA_DISTFILES = $(RESOURCE_FILES_2) $(RESOURCE_FILES_1) $(TEST_RESOURCE_FILES) UplevelHelperDefinitions.xml $(RESX_DIST) \
-- SQLiteProviders_DatabaseSchema.sql
++EXTRA_DISTFILES = \
++ $(RESOURCE_FILES_2) \
++ $(RESOURCE_FILES_1) \
++ $(TEST_RESOURCE_FILES) \
++ UplevelHelperDefinitions.xml \
++ $(RESX_DIST) \
++ SQLiteProviders_DatabaseSchema.sql \
++ $(shell find Test/standalone-runner-support/ -name "*.cs" -type f -printf "'%p' ") \
++ $(shell find Test/standalone-tests/ -name "*.cs" -type f -printf "'%p' " -o -name "*.cs.in" -type f -printf "'%p' ") \
++ $(shell find Test/standalone/ -type f -printf "'%p' ") \
++ $(shell find Test/tools/ -type f -printf "'%p' ") \
++ System.Web_standalone_test.dll.sources \
++ standalone-runner-support.dll.sources
++
BUILT_SOURCES = System.Web/UplevelHelper.cs
include ../../build/library.make
LIB_MCS_FLAGS += -define:DEVEL
endif
++CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
++
++STANDALONE_RUNNER_SUPPORT_MCS_FLAGS = -d:STANDALONE_TEST -debug:full -r:System.Web.dll -r:nunit.framework.dll
++STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
++STANDALONE_RUNNER_SUPPORT_MAKEFRAG = $(depsdir)/$(PROFILE)_standalone-runner-support.dll.makefrag
++
++STANDALONE_TEST_MCS_FLAGS = -debug:full -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -r:System.Web.dll -r:nunit.framework.dll
++STANDALONE_TEST_ASSEMBLY = System.Web_standalone_test_$(PROFILE).dll
++STANDALONE_TEST_MAKEFRAG = $(depsdir)/$(STANDALONE_TEST_ASSEMBLY).makefrag
++
++STANDALONE_TEST_RUNNER = Test/tools/standalone-runner.exe
++RUN_STANDALONE = $(TEST_RUNTIME) $(STANDALONE_TEST_RUNNER)
++
$(build_lib): $(RESX_RES) $(RESOURCE_FILES_2) $(RESOURCE_FILES_1)
$(RESX_RES): %.resources: %.resx
(echo ''; cat TestResult-ondotnet-$(PROFILE).log) | sed '1,/^Tests run: /d'; \
$$ok
++run-standalone-test: $(STANDALONE_TEST_MAKEFRAG) $(STANDALONE_RUNNER_SUPPORT_MAKEFRAG) $(STANDALONE_TEST_ASSEMBLY)
++ $(MAKE) -C Test/tools/ STANDALONE_SUPPORT_BUILT=1 standalone-runner.exe
++ $(RUN_STANDALONE) $(STANDALONE_TEST_ASSEMBLY)
++
++standalone-runner-support: $(STANDALONE_RUNNER_SUPPORT_MAKEFRAG) $(STANDALONE_RUNNER_SUPPORT_ASSEMBLY)
++
++$(STANDALONE_TEST_MAKEFRAG): System.Web_standalone_test.dll.sources
++ @echo Creating $@ ...
++ @sed 's,^,$(STANDALONE_TEST_ASSEMBLY): ,' $< > $@
++
++$(STANDALONE_RUNNER_SUPPORT_MAKEFRAG): standalone-runner-support.dll.sources
++ @echo Creating $@ ...
++ @sed 's,^,$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY): ,' $< > $@
++
++include $(STANDALONE_TEST_MAKEFRAG)
++include $(STANDALONE_RUNNER_SUPPORT_MAKEFRAG)
++
++$(STANDALONE_TEST_ASSEMBLY): $(the_assembly) $(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) Test/standalone-tests/Consts.cs
++ $(MCS) $(STANDALONE_TEST_MCS_FLAGS) -out:$@ -target:library @System.Web_standalone_test.dll.sources
++
++$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY):
++ $(MCS) $(STANDALONE_RUNNER_SUPPORT_MCS_FLAGS) -out:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) -target:library @standalone-runner-support.dll.sources
++
++Test/standalone-tests/Consts.cs: Test/standalone-tests/Consts.cs.in
++ @sed 's,@SystemWebClassDir@,$(shell pwd),' $< > $@
++
// Gonzalo Paniagua Javier (gonzalo@novell.com)
//
//
--// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
++// Copyright (C) 2006-2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
ShutdownAll ();
}
++ [MonoTODO ("Need to take advantage of the configuration mapping capabilities of IApplicationHost")]
++ [SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
++ public IRegisteredObject CreateObject (IApplicationHost appHost, Type type)
++ {
++ if (appHost == null)
++ throw new ArgumentNullException ("appHost");
++ if (type == null)
++ throw new ArgumentNullException ("type");
++
++ return CreateObject (appHost.GetSiteID (),
++ type,
++ appHost.GetVirtualPath (),
++ appHost.GetPhysicalPath (),
++ true,
++ true);
++ }
++
public IRegisteredObject CreateObject (string appId, Type type, string virtualPath,
string physicalPath, bool failIfExists)
{
if (!VirtualPathUtility.IsAbsolute (virtualPath))
throw new ArgumentException ("Relative path no allowed.", "virtualPath");
-- if (physicalPath == null || physicalPath == "")
++ if (String.IsNullOrEmpty (physicalPath))
throw new ArgumentException ("Cannot be null or empty", "physicalPath");
// 'type' is not checked. If it's null, we'll throw a NullReferenceException
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * ApplicationManager.cs: implemented a missing CreateObject
++ overload
++
2009-11-18 Marek Habersack <mhabersack@novell.com>
* ApplicationHost.cs: changed the order of file names in
#if NET_2_0
using System;
using System.Security.Permissions;
++using System.Web.Configuration;
namespace System.Web.Hosting
{
System.Web.Hosting/DefaultVirtualPathProvider.cs
System.Web.Hosting/HostingEnvironment.cs
System.Web.Hosting/IAppDomainFactory.cs
++System.Web.Hosting/IApplicationHost.cs
System.Web.Hosting/IAppManagerAppDomainFactory.cs
System.Web.Hosting/IISAPIRuntime.cs
System.Web.Hosting/IRegisteredObject.cs
--- /dev/null
--- /dev/null
++Test/standalone-tests/Consts.cs
++Test/standalone-tests/Locations.cs
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * NunitWebTest.cs: added new overload of GetControlFromPageHtml
++ which takes begin and end markers as parameters.
++
2008-01-07 Dean Brettle <dean@brettle.com>
* HtmlAgilityPack/AssemblyInfo.cs: made assembly delay signed so that
using System.Text;
using System.Collections;
using System.Reflection;
++
using NUnit.Framework;
namespace MonoTests.stand_alone.WebHarness
public static string GetControlFromPageHtml (string str)
{
-- if (str == null || str == string.Empty)
++ return GetControlFromPageHtml (str, BEGIN_TAG, END_TAG);
++ }
++
++ public static string GetControlFromPageHtml (string str, string beginTag, string endTag)
++ {
++ if (str == null || str.Length == 0)
throw new ArgumentException ("internal error: str is null or empty");
-- int beginPos = str.IndexOf (BEGIN_TAG);
-- int endPos = str.IndexOf (END_TAG);
++ if (beginTag == null || beginTag.Length == 0)
++ throw new ArgumentNullException ("beginTag");
++ if (endTag == null || endTag.Length == 0)
++ throw new ArgumentNullException ("endTag");
++
++ int beginPos = str.IndexOf (beginTag);
++ int endPos = str.IndexOf (endTag);
if (beginPos == -1)
-- throw new Exception ("internal error: BEGIN_TAG is missing. Full source: "+str);
++ throw new InvalidOperationException (String.Format ("internal error: begin tag ('{0}') is missing. Full source: {1}", beginTag, str));
if (endPos == -1)
-- throw new Exception ("internal error: END_TAG is missing. Full source: "+str);
++ throw new InvalidOperationException (String.Format ("internal error: end tag ('{0}') is missing. Full source: {1}", endTag, str));
StringBuilder sb = new StringBuilder ();
-- sb.Append (str.Substring (beginPos + BEGIN_TAG.Length, endPos - beginPos - BEGIN_TAG.Length));
++ sb.Append (str.Substring (beginPos + beginTag.Length, endPos - beginPos - beginTag.Length));
return sb.ToString ();
}
--- /dev/null
--- /dev/null
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * Helpers.cs, ITestCase.cs, ITestRunner.cs, StandaloneTest.cs,
++ TestCallback.cs, TestCaseAttribute.cs,
++ TestCaseFailureException.cs, TestRunItem.cs, TestRunner.cs,
++ TestWorkerRequest.cs: added
++
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Collections.Generic;
++using System.Web;
++using System.Web.Hosting;
++
++using MonoTests.stand_alone.WebHarness;
++
++namespace StandAloneRunnerSupport
++{
++ public sealed class Helpers
++ {
++ public const string BEGIN_CODE_MARKER = "<!-- @CODE_BEGIN@ -->";
++ public const string END_CODE_MARKER = "<!-- @CODE_END@ -->";
++
++ public static string ExtractCodeFromHtml (string html)
++ {
++ AppDomain ad = AppDomain.CurrentDomain;
++ return HtmlDiff.GetControlFromPageHtml (html, BEGIN_CODE_MARKER, END_CODE_MARKER);
++ }
++
++ public static void ExtractAndCompareCodeFromHtml (string html, string original, string msg)
++ {
++ string rendered = ExtractCodeFromHtml (html);
++ HtmlDiff.AssertAreEqual (original, rendered, msg);
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Collections.Generic;
++
++namespace StandAloneRunnerSupport
++{
++ public interface ITestCase
++ {
++ string PhysicalPath { get; }
++ string VirtualPath { get; }
++
++ bool SetUp (List <TestRunItem> runItems);
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.IO;
++using System.Web;
++using System.Web.Hosting;
++
++namespace StandAloneRunnerSupport
++{
++ public interface ITestRunner
++ {
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Collections.Generic;
++using System.Web;
++using System.Web.Hosting;
++
++using NUnit.Framework;
++
++namespace StandAloneRunnerSupport
++{
++ public sealed class StandaloneTest
++ {
++ string failureDetails;
++
++ public TestCaseFailureException Exception {
++ get; private set;
++ }
++
++ public string FailureDetails {
++ get {
++ if (!String.IsNullOrEmpty (failureDetails))
++ return failureDetails;
++
++ TestCaseFailureException ex = Exception;
++ if (ex == null)
++ return String.Empty;
++
++ return ex.Details;
++ }
++
++ private set {
++ failureDetails = value;
++ }
++ }
++
++ public string FailedUrl {
++ get; private set;
++ }
++
++ public string FailedUrlDescription {
++ get; private set;
++ }
++
++ public TestCaseAttribute Info {
++ get; private set;
++ }
++
++ public bool Success {
++ get; private set;
++ }
++
++ public Type TestType {
++ get; private set;
++ }
++
++ public StandaloneTest (Type testType, TestCaseAttribute info)
++ {
++ if (testType == null)
++ throw new ArgumentNullException ("testType");
++ if (info == null)
++ throw new ArgumentNullException ("info");
++
++ TestType = testType;
++ Info = info;
++ }
++
++ public void Run (ApplicationManager appMan)
++ {
++ try {
++ Success = true;
++ RunInternal (appMan);
++ } catch (TestCaseFailureException ex) {
++ Exception = ex;
++ Success = false;
++ } catch (Exception ex) {
++ FailureDetails = String.Format ("Test failed with exception of type '{0}':{1}{2}",
++ ex.GetType (), Environment.NewLine, ex.ToString ());
++ Success = false;
++ }
++ }
++
++ void RunInternal (ApplicationManager appMan)
++ {
++ ITestCase test = Activator.CreateInstance (TestType) as ITestCase;
++ var runItems = new List <TestRunItem> ();
++ if (!test.SetUp (runItems)) {
++ Success = false;
++ FailureDetails = "Test aborted in setup phase.";
++ return;
++ }
++
++ if (runItems.Count == 0) {
++ Success = false;
++ FailureDetails = "No test run items returned by the test case.";
++ return;
++ }
++
++ var runner = appMan.CreateObject (Info.Name, typeof (TestRunner), test.VirtualPath, test.PhysicalPath, true) as TestRunner;
++ if (runner == null) {
++ Success = false;
++ throw new InvalidOperationException ("runner must not be null.");
++ }
++
++ string result;
++ try {
++ foreach (var tri in runItems) {
++ if (tri == null)
++ continue;
++
++ try {
++ result = runner.Run (tri.Url);
++ if (tri.Callback == null)
++ continue;
++
++ tri.Callback (result);
++ } catch (Exception) {
++ FailedUrl = tri.Url;
++ FailedUrlDescription = tri.UrlDescription;
++ runner.Stop (true);
++ runner = null;
++ throw;
++ }
++ }
++ } catch (AssertionException ex) {
++ throw new TestCaseFailureException ("Assertion failed.", ex.Message, ex);
++ } finally {
++ if (runner != null)
++ runner.Stop (true);
++ }
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++
++namespace StandAloneRunnerSupport
++{
++ public delegate void TestCallback (string result);
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Runtime.InteropServices;
++
++namespace StandAloneRunnerSupport
++{
++ [AttributeUsage (AttributeTargets.Class)]
++ [Serializable]
++ public class TestCaseAttribute : Attribute
++ {
++ public string Description {
++ get; set;
++ }
++
++ public bool Disabled {
++ get; set;
++ }
++
++ public string Name {
++ get; set;
++ }
++
++ public TestCaseAttribute (string name)
++ : this (name, null)
++ {
++ }
++
++ public TestCaseAttribute (string name, string description)
++ {
++ if (String.IsNullOrEmpty (name))
++ throw new ArgumentNullException ("name");
++
++ Description = description;
++ Name = name;
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++
++namespace StandAloneRunnerSupport
++{
++ public class TestCaseFailureException : Exception
++ {
++ public string Details {
++ get; set;
++ }
++
++ public TestCaseFailureException (string message)
++ : this (message, null, null)
++ {}
++
++ public TestCaseFailureException (string message, string details)
++ : this (message, details, null)
++ {}
++
++ public TestCaseFailureException (string message, Exception innerException)
++ : this (message, null, innerException)
++ {}
++
++ public TestCaseFailureException (string message, string details, Exception innerException)
++ : base (message, innerException)
++ {
++ Details = details;
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Web;
++using System.Web.Hosting;
++
++namespace StandAloneRunnerSupport
++{
++ public sealed class TestRunItem
++ {
++ public TestCallback Callback {
++ get; set;
++ }
++
++ public string Url {
++ get; set;
++ }
++
++ public string UrlDescription {
++ get; set;
++ }
++
++ public TestRunItem ()
++ : this (null, null, null)
++ {}
++
++ public TestRunItem (string url, TestCallback callback)
++ : this (url, null, callback)
++ {}
++
++ public TestRunItem (string url, string urlDescription, TestCallback callback)
++ {
++ Url = url;
++ Callback = callback;
++ UrlDescription = urlDescription;
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.IO;
++using System.Text;
++using System.Web;
++using System.Web.Hosting;
++
++namespace StandAloneRunnerSupport
++{
++ public sealed class TestRunner : MarshalByRefObject, IRegisteredObject, ITestRunner
++ {
++ public TestRunner ()
++ {
++ AppDomain ad = AppDomain.CurrentDomain;
++
++ ad.SetData ("BEGIN_CODE_MARKER", Helpers.BEGIN_CODE_MARKER);
++ ad.SetData ("END_CODE_MARKER", Helpers.END_CODE_MARKER);
++ }
++
++ public string Run (string url)
++ {
++ var output = new StringWriter ();
++ try {
++ Uri uri = new Uri (url, UriKind.RelativeOrAbsolute);
++ var wr = new TestWorkerRequest (uri.AbsolutePath, uri.Query, output);
++
++ HttpRuntime.ProcessRequest (wr);
++ return output.ToString ();
++ } finally {
++ output.Close ();
++ }
++ }
++
++ public void Stop (bool immediate)
++ {
++ HostingEnvironment.UnregisterObject (this);
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.IO;
++using System.Web;
++using System.Web.Hosting;
++
++namespace StandAloneRunnerSupport
++{
++ sealed class TestWorkerRequest : SimpleWorkerRequest
++ {
++ string page;
++ string query;
++ string appVirtualDir;
++
++ public TestWorkerRequest (string page, string query, TextWriter output)
++ : base (page, query, output)
++ {
++ this.page = page;
++ this.query = query;
++ this.appVirtualDir = GetAppPath ();
++ }
++
++ public override string GetFilePath ()
++ {
++ return page;
++ }
++ }
++}
--- /dev/null
--- /dev/null
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * Consts.cs.in, Locations.cs: added
++
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.IO;
++
++using StandAloneRunnerSupport;
++
++namespace StandAloneTests
++{
++ static class Consts
++ {
++ public readonly static string BasePhysicalDir;
++
++ static Consts ()
++ {
++ BasePhysicalDir = Path.Combine ("@SystemWebClassDir@", Path.Combine ("Test", "standalone"));
++ }
++ }
++}
--- /dev/null
--- /dev/null
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Collections.Generic;
++using System.IO;
++using System.Web;
++using System.Web.Hosting;
++
++using StandAloneRunnerSupport;
++using StandAloneTests;
++
++using NUnit.Framework;
++
++namespace StandAloneTests.Locations
++{
++ [TestCase ("Locations", "Configuration <location> tests.")]
++ public sealed class Locations : ITestCase
++ {
++ public string PhysicalPath {
++ get { return Path.Combine (Consts.BasePhysicalDir, "Locations"); }
++ }
++
++ public string VirtualPath {
++ get { return "/"; }
++ }
++
++ public bool SetUp (List <TestRunItem> runItems)
++ {
++ runItems.Add (new TestRunItem ("/Default.aspx", Default_Aspx));
++ runItems.Add (new TestRunItem ("/Stuff.aspx", Stuff_Aspx));
++ runItems.Add (new TestRunItem ("/sub/Default.aspx", Sub_Default_Aspx));
++ runItems.Add (new TestRunItem ("/sub/Stuff.aspx", Sub_Stuff_Aspx));
++ runItems.Add (new TestRunItem ("/sub/sub/Default.aspx", Sub_Sub_Default_Aspx));
++ runItems.Add (new TestRunItem ("/sub/sub/Stuff.aspx", Sub_Sub_Stuff_Aspx));
++
++ return true;
++ }
++
++ void Default_Aspx (string result)
++ {
++ string originalHtml = "/Hello";
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++
++ void Stuff_Aspx (string result)
++ {
++ string originalHtml = @"<pre id=""settings""> /Web.config [1]: '[toplevel]'
++ /Web.config [2]: 'Stuff.aspx'
++</pre>";
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++
++ void Sub_Default_Aspx (string result)
++ {
++ string originalHtml = "/sub/Hello";
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++
++ void Sub_Stuff_Aspx (string result)
++ {
++ string originalHtml = @"<pre id=""settings""> /Web.config [1]: '[toplevel]'
++ /Web.config [3]: 'sub'
++ /sub/Web.config [1]: '[toplevel]'
++ /Web.config [6]: 'sub/sub'
++ /sub/Web.config [4]: 'sub'
++</pre>";
++
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++
++ void Sub_Sub_Default_Aspx (string result)
++ {
++ string originalHtml = "/sub/sub/Hello";
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++
++ void Sub_Sub_Stuff_Aspx (string result)
++ {
++ string originalHtml = @"<pre id=""settings""> /Web.config [1]: '[toplevel]'
++ /Web.config [3]: 'sub'
++ /sub/Web.config [1]: '[toplevel]'
++ /Web.config [6]: 'sub/sub'
++ /sub/Web.config [4]: 'sub'
++/sub/sub/Web.config [1]: '[toplevel]'
++/sub/sub/Web.config [6]: 'sub/sub'
++</pre>";
++
++ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
++ }
++ }
++}
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<html>
++ <head>
++ <title>/Default.aspx</title>
++ </head>
++ <body>
++<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %>/Hello<%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<%@ Import Namespace="System.Collections.Specialized" %>
++<%@ Import Namespace="System.Web.Configuration" %>
++
++<script runat="server">
++ protected void Page_Load (object sender, EventArgs args)
++ {
++ NameValueCollection nvc = WebConfigurationManager.AppSettings;
++
++ foreach (string k in nvc)
++ settings.InnerHtml += String.Format ("{0,23}: '{1}'\n", k, nvc [k]);
++ }
++</script>
++<html>
++ <head>
++ <title>locations tests</title>
++ </head>
++ <body>
++ AppSettings:
++ <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><pre runat="server" id="settings"></pre><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="utf-8"?>
++<configuration>
++ <appSettings>
++ <add key="/Web.config [1]" value="[toplevel]"/>
++ </appSettings>
++
++ <system.web>
++ <compilation debug="true" />
++ <customErrors mode="RemoteOnly" />
++ </system.web>
++
++ <location path="Stuff.aspx">
++ <appSettings>
++ <add key="/Web.config [2]" value="Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub">
++ <appSettings>
++ <add key="/Web.config [3]" value="sub"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/Stuff.aspx">
++ <appSettings>
++ <add key="/Web.config [4]" value="sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub/Stuff.aspx">
++ <appSettings>
++ <add key="/Web.config [5]" value="sub/sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub">
++ <appSettings>
++ <add key="/Web.config [6]" value="sub/sub"/>
++ </appSettings>
++ </location>
++</configuration>
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<html>
++ <head>
++ <title>/sub/Default.aspx</title>
++ </head>
++ <body>
++<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %>/sub/Hello<%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<%@ Import Namespace="System.Collections.Specialized" %>
++<%@ Import Namespace="System.Web.Configuration" %>
++
++<script runat="server">
++ protected void Page_Load (object sender, EventArgs args)
++ {
++ NameValueCollection nvc = WebConfigurationManager.AppSettings;
++
++ foreach (string k in nvc)
++ settings.InnerHtml += String.Format ("{0,23}: '{1}'\n", k, nvc [k]);
++ }
++</script>
++<html>
++ <head>
++ <title>locations tests</title>
++ </head>
++ <body>
++ AppSettings:
++ <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><pre runat="server" id="settings"></pre><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="utf-8"?>
++<configuration>
++ <appSettings>
++ <add key="/sub/Web.config [1]" value="[toplevel]"/>
++ </appSettings>
++
++ <system.web>
++ <compilation debug="true" />
++ <customErrors mode="RemoteOnly" />
++ </system.web>
++
++ <location path="Stuff.aspx">
++ <appSettings>
++ <add key="/sub/Web.config [2]" value="Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/Stuff.aspx">
++ <appSettings>
++ <add key="/sub/Web.config [3]" value="sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub">
++ <appSettings>
++ <add key="/sub/Web.config [4]" value="sub"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub/Stuff.aspx">
++ <appSettings>
++ <add key="/sub/Web.config [5]" value="sub/sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub">
++ <appSettings>
++ <add key="/sub/Web.config [6]" value="sub/sub"/>
++ </appSettings>
++ </location>
++</configuration>
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<html>
++ <head>
++ <title>/sub/sub/Default.aspx</title>
++ </head>
++ <body>
++<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %>/sub/sub/Hello<%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<%@ Page Language="C#" %>
++<%@ Import Namespace="System.Collections.Specialized" %>
++<%@ Import Namespace="System.Web.Configuration" %>
++
++<script runat="server">
++ protected void Page_Load (object sender, EventArgs args)
++ {
++ NameValueCollection nvc = WebConfigurationManager.AppSettings;
++
++ foreach (string k in nvc)
++ settings.InnerHtml += String.Format ("{0,23}: '{1}'\n", k, nvc [k]);
++ }
++</script>
++<html>
++ <head>
++ <title>locations tests</title>
++ </head>
++ <body>
++ AppSettings:
++ <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><pre runat="server" id="settings"></pre><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
++ </body>
++</html>
++
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="utf-8"?>
++<configuration>
++ <appSettings>
++ <add key="/sub/sub/Web.config [1]" value="[toplevel]"/>
++ </appSettings>
++
++ <system.web>
++ <compilation debug="true" />
++ <customErrors mode="RemoteOnly" />
++ </system.web>
++
++ <location path="Stuff.aspx">
++ <appSettings>
++ <add key="/sub/sub/Web.config [2]" value="Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/Stuff.aspx">
++ <appSettings>
++ <add key="/sub/sub/Web.config [3]" value="sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub">
++ <appSettings>
++ <add key="/sub/sub/Web.config [4]" value="sub"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub/Stuff.aspx">
++ <appSettings>
++ <add key="/sub/sub/Web.config [5]" value="sub/sub/Stuff.aspx"/>
++ </appSettings>
++ </location>
++
++ <location path="sub/sub">
++ <appSettings>
++ <add key="/sub/sub/Web.config [6]" value="sub/sub"/>
++ </appSettings>
++ </location>
++</configuration>
--- /dev/null
--- /dev/null
++2010-01-14 Marek Habersack <mhabersack@novell.com>
++
++ * standalone-runner.cs: added
++
++ * Makefile: added build targets for standalone-runner.exe
++
--CSC=mcs
++thisdir = class/System.Web/Test/tools
--all: HtmlWriter.dll
++include ../../../../build/rules.make
++
++CLASSLIB_DIR = $(topdir)/class/lib/$(PROFILE)
++STANDALONE_RUNNER_SUPPORT_ASSEMBLY = $(CLASSLIB_DIR)/standalone-runner-support.dll
++
++STANDALONE_RUNNER_SOURCES = \
++ standalone-runner.cs \
++ ../../../Mono.Options/Mono.Options/Options.cs \
++
++STANDALONE_RUNNER_REFERENCES = \
++ -lib:$(CLASSLIB_DIR) \
++ -r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) \
++ -r:System.Web.dll
++
++all-local: HtmlWriter.dll standalone-runner.exe
HtmlWriter.dll: HtmlWriter.cs
-- $(CSC) -t:library -r:System.Web.dll $<
++ $(MCS) -t:library -r:System.Web.dll $<
++
++standalone-runner.exe: deps $(STANDALONE_RUNNER_SOURCES)
++ $(MCS) -debug:full $(STANDALONE_RUNNER_REFERENCES) -out:$@ $(STANDALONE_RUNNER_SOURCES)
++
++deps:
++ifndef STANDALONE_SUPPORT_BUILT
++ $(MAKE) -C ../../ standalone-runner-support
++endif
clean:
rm -f HtmlWriter.dll HtmlWriter.*db
--
++ rm -f standalone-runner.exe standalone-runner.*db
--- /dev/null
--- /dev/null
++//
++//
++// Authors:
++// Marek Habersack (mhabersack@novell.com)
++//
++// (C) 2010 Novell, Inc http://novell.com/
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++//
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++using System;
++using System.Collections.Generic;
++using System.IO;
++using System.Reflection;
++using System.Text;
++using System.Web;
++using System.Web.Hosting;
++
++using Mono.Options;
++
++using StandAloneRunnerSupport;
++
++namespace StandAloneRunner
++{
++ sealed class StandAloneRunner
++ {
++ static string testsAssembly;
++
++ static void Usage (int exitCode, OptionSet options)
++ {
++ Console.WriteLine (@"Usage: standalone-runner [OPTIONS] <TESTS_ASSEMBLY>");
++ if (options != null) {
++ Console.WriteLine ();
++ Console.WriteLine ("Available options:");
++ options.WriteOptionDescriptions (Console.Out);
++ }
++ Console.WriteLine ();
++
++ Environment.Exit (exitCode);
++ }
++
++ public static void Die (string format, params object[] args)
++ {
++ Console.WriteLine ("Standalone test failure in assembly '{0}'.", testsAssembly);
++ Console.WriteLine ();
++
++ if (args == null || args.Length == 0)
++ Console.WriteLine ("Error: " + format);
++ else
++ Console.WriteLine ("Error: " + format, args);
++
++ Environment.Exit (1);
++ }
++
++ static void Main (string[] args)
++ {
++ try {
++ Run (args);
++ } catch (Exception ex) {
++ Die ("Exception caught:{0}{1}", Environment.NewLine, ex.ToString ());
++ }
++ }
++
++ static void Run (string[] args)
++ {
++ bool showHelp = false;
++ var options = new OptionSet () {
++ {"?|h|help", "Show short usage screen.", v => showHelp = true},
++ };
++
++ List <string> extra = options.Parse (args);
++
++ int extraCount = extra.Count;
++
++ if (showHelp || extraCount < 1)
++ Usage (showHelp ? 0 : 1, options);
++
++ testsAssembly = extra [0];
++
++ if (!File.Exists (testsAssembly))
++ Die ("Tests assembly '{0}' does not exist.", testsAssembly);
++
++ Assembly asm = Assembly.LoadFrom (testsAssembly);
++ var tests = new List <StandaloneTest> ();
++
++ LoadTestsFromAssembly (asm, tests);
++ if (tests.Count == 0)
++ Die ("No tests present in the '{0}' assembly. Tests must be public types decorated with the TestCase attribute and implementing the ITestCase interface.", testsAssembly);
++
++ ApplicationManager appMan = ApplicationManager.GetApplicationManager ();
++ int runCounter = 0;
++ int failedCounter = 0;
++ var reports = new List <string> ();
++ DateTime start = DateTime.Now;
++ DateTime end;
++
++ foreach (StandaloneTest test in tests) {
++ if (test.Info.Disabled)
++ continue;
++
++ test.Run (appMan);
++ runCounter++;
++ if (!test.Success) {
++ failedCounter++;
++ reports.Add (FormatReport (test));
++ }
++ }
++ end = DateTime.Now;
++
++ if (reports.Count > 0) {
++ int repCounter = 0;
++ int numWidth = reports.Count.ToString ().Length;
++ string indent = String.Empty.PadLeft (numWidth + 2);
++ string numFormat = "{0," + numWidth + "}) ";
++
++ foreach (string r in reports) {
++ repCounter++;
++ Console.WriteLine (numFormat + FormatLines (indent, r, Environment.NewLine, true), repCounter);
++ }
++ } else
++ Console.WriteLine ();
++
++ Console.WriteLine ("Total tests: {0}; Run: {1}; Failed: {2}; Not run: {3}; Time taken: {4}",
++ tests.Count, runCounter, failedCounter, tests.Count - runCounter, end - start);
++ }
++
++ static string FormatReport (StandaloneTest test)
++ {
++ var sb = new StringBuilder ();
++ string newline = Environment.NewLine;
++
++ sb.AppendFormat ("{0}{1}", test.Info.Name, newline);
++ sb.AppendFormat ("{0,16}: {1}{2}", "Type", test.TestType, newline);
++
++ if (!String.IsNullOrEmpty (test.Info.Description))
++ sb.AppendFormat ("{0,16}: {1}{2}", "Description", test.Info.Description, newline);
++
++ if (!String.IsNullOrEmpty (test.FailedUrl))
++ sb.AppendFormat ("{0,16}: {1}{2}", "Failed URL", test.FailedUrl, newline);
++
++ if (!String.IsNullOrEmpty (test.FailedUrlDescription))
++ sb.AppendFormat ("{0,16}: {1}{2}", "URL description", test.FailedUrlDescription, newline);
++
++ if (!String.IsNullOrEmpty (test.FailureDetails))
++ sb.AppendFormat ("{0,16}:{2}{1}{2}", "Failure details", FormatLines (" ", test.FailureDetails, newline, false), newline);
++
++ if (test.Exception != null)
++ sb.AppendFormat ("{0,16}:{2}{1}{2}", "Exception", FormatLines (" ", test.Exception.ToString (), newline, false), newline);
++
++ return sb.ToString ();
++ }
++
++ static string FormatLines (string indent, string text, string newline, bool skipFirst)
++ {
++ var sb = new StringBuilder ();
++ bool first = true;
++
++ foreach (string s in text.Split (new string[] { newline }, StringSplitOptions.None)) {
++ if (skipFirst && first)
++ first = false;
++ else
++ sb.Append (indent);
++ sb.Append (s);
++ sb.Append (newline);
++ }
++
++ sb.Length -= newline.Length;
++ return sb.ToString ();
++ }
++
++ static void LoadTestsFromAssembly (Assembly asm, List <StandaloneTest> tests)
++ {
++ Type[] types = asm.GetExportedTypes ();
++ if (types.Length == 0)
++ return;
++
++ object[] attributes;
++ foreach (var t in types) {
++ if (!t.IsClass || t.IsAbstract || t.IsGenericTypeDefinition)
++ continue;
++
++ attributes = t.GetCustomAttributes (typeof (TestCaseAttribute), false);
++ if (attributes.Length == 0)
++ continue;
++
++ if (!typeof (ITestCase).IsAssignableFrom (t))
++ continue;
++
++ tests.Add (new StandaloneTest (t, attributes [0] as TestCaseAttribute));
++ }
++ }
++ }
++}
--- /dev/null
--- /dev/null
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/AssemblyInfo.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/crc32.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/Header.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlAttribute.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlDocument.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlEntity.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlNode.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlNodeNavigator.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlWeb.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/MixedCodeDocument.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/ParseReader.cs
++Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/tools.cs
++Test/mainsoft/MainsoftWebTest/NunitWebTest.cs
++Test/mainsoft/MainsoftWebTest/XmlComparer.cs
++Test/standalone-runner-support/Helpers.cs
++Test/standalone-runner-support/ITestCase.cs
++Test/standalone-runner-support/ITestRunner.cs
++Test/standalone-runner-support/StandaloneTest.cs
++Test/standalone-runner-support/TestCallback.cs
++Test/standalone-runner-support/TestCaseAttribute.cs
++Test/standalone-runner-support/TestCaseFailureException.cs
++Test/standalone-runner-support/TestRunItem.cs
++Test/standalone-runner-support/TestRunner.cs
++Test/standalone-runner-support/TestWorkerRequest.cs