2010-01-14 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Thu, 14 Jan 2010 01:15:01 +0000 (01:15 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Thu, 14 Jan 2010 01:15:01 +0000 (01:15 -0000)
* Helpers.cs, ITestCase.cs, ITestRunner.cs, StandaloneTest.cs,
TestCallback.cs, TestCaseAttribute.cs,
TestCaseFailureException.cs, TestRunItem.cs, TestRunner.cs,
TestWorkerRequest.cs: added

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

2010-01-14  Marek Habersack  <mhabersack@novell.com>

* Consts.cs.in, Locations.cs: added

2010-01-14  Marek Habersack  <mhabersack@novell.com>

* standalone-runner.cs: added

* Makefile: added build targets for standalone-runner.exe

2010-01-14  Marek Habersack  <mhabersack@novell.com>

* NunitWebTest.cs: added new overload of GetControlFromPageHtml
which takes begin and end markers as parameters.

2010-01-14  Marek Habersack  <mhabersack@novell.com>

* ApplicationManager.cs: implemented a missing CreateObject
overload

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.

svn path=/trunk/mcs/; revision=149522

40 files changed:
1  2 
mcs/build/ChangeLog
mcs/build/executable.make
mcs/build/library.make
mcs/build/rules.make
mcs/class/System.Web/ChangeLog
mcs/class/System.Web/Makefile
mcs/class/System.Web/System.Web.Hosting/ApplicationManager.cs
mcs/class/System.Web/System.Web.Hosting/ChangeLog
mcs/class/System.Web/System.Web.Hosting/IApplicationHost.cs
mcs/class/System.Web/System.Web.dll.sources
mcs/class/System.Web/System.Web_standalone_test.dll.sources
mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/ChangeLog
mcs/class/System.Web/Test/mainsoft/MainsoftWebTest/NunitWebTest.cs
mcs/class/System.Web/Test/standalone-runner-support/ChangeLog
mcs/class/System.Web/Test/standalone-runner-support/Helpers.cs
mcs/class/System.Web/Test/standalone-runner-support/ITestCase.cs
mcs/class/System.Web/Test/standalone-runner-support/ITestRunner.cs
mcs/class/System.Web/Test/standalone-runner-support/StandaloneTest.cs
mcs/class/System.Web/Test/standalone-runner-support/TestCallback.cs
mcs/class/System.Web/Test/standalone-runner-support/TestCaseAttribute.cs
mcs/class/System.Web/Test/standalone-runner-support/TestCaseFailureException.cs
mcs/class/System.Web/Test/standalone-runner-support/TestRunItem.cs
mcs/class/System.Web/Test/standalone-runner-support/TestRunner.cs
mcs/class/System.Web/Test/standalone-runner-support/TestWorkerRequest.cs
mcs/class/System.Web/Test/standalone-tests/ChangeLog
mcs/class/System.Web/Test/standalone-tests/Consts.cs.in
mcs/class/System.Web/Test/standalone-tests/Locations.cs
mcs/class/System.Web/Test/standalone/Locations/Default.aspx
mcs/class/System.Web/Test/standalone/Locations/Stuff.aspx
mcs/class/System.Web/Test/standalone/Locations/Web.config
mcs/class/System.Web/Test/standalone/Locations/sub/Default.aspx
mcs/class/System.Web/Test/standalone/Locations/sub/Stuff.aspx
mcs/class/System.Web/Test/standalone/Locations/sub/Web.config
mcs/class/System.Web/Test/standalone/Locations/sub/sub/Default.aspx
mcs/class/System.Web/Test/standalone/Locations/sub/sub/Stuff.aspx
mcs/class/System.Web/Test/standalone/Locations/sub/sub/Web.config
mcs/class/System.Web/Test/tools/ChangeLog
mcs/class/System.Web/Test/tools/Makefile
mcs/class/System.Web/Test/tools/standalone-runner.cs
mcs/class/System.Web/standalone-runner-support.dll.sources

index 309acbebcd4d6b7f33acbe9ed752af862c4f8948,309acbebcd4d6b7f33acbe9ed752af862c4f8948..710c2ba1404869d81596dbbe36472e8fa74ad10c
@@@ -1,3 -1,3 +1,9 @@@
++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.
index 65651958b1ae8155d817934b0e28eecf6371b1b4,65651958b1ae8155d817934b0e28eecf6371b1b4..e0a14c9537ab0163a9031726cfa8e30517b5b5fe
@@@ -87,9 -87,9 +87,9 @@@ dist-local: dist-defaul
        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
index c35bfd2d53ce8f0777e644f259af0b9323506f2b,c35bfd2d53ce8f0777e644f259af0b9323506f2b..d2d8d6373cd94dc718708943c25b4c806d140103
@@@ -181,9 -181,9 +181,9 @@@ dist-local: dist-defaul
        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
index 1259b4758df33ed2ed15b43b92b5e73f3323fac6,1259b4758df33ed2ed15b43b92b5e73f3323fac6..4104a74872e1b37e92fc94870cbb37cf87daba13
@@@ -181,8 -181,8 +181,8 @@@ dist-default
        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 ; \
index 21dc1a986190ce049857a2b2229687ef0f829a2c,21dc1a986190ce049857a2b2229687ef0f829a2c..a43807b8a6944d2db931d2958ab23bf4640ae845
@@@ -1,3 -1,3 +1,11 @@@
++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
index 5b05d98f6da87770b9514daa2f53cdeb94f738ca,5b05d98f6da87770b9514daa2f53cdeb94f738ca..77169a4c1460682fb52af4f5879d1b4d1f76e16e
@@@ -247,8 -247,8 +247,20 @@@ ifeq (net_2_0, $(PROFILE)
  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
@@@ -288,6 -288,6 +300,19 @@@ ifdef DEVE
  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
@@@ -314,3 -314,3 +339,29 @@@ run-nunitweb-ondotnet: tes
        (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),' $< > $@
++
index df039de8682bc24116a7f162393e44cbe1ed0d1a,df039de8682bc24116a7f162393e44cbe1ed0d1a..b2fda6e03c9b0a1cfad35c6b4b8eef4c138c1fda
@@@ -5,7 -5,7 +5,7 @@@
  //    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
@@@ -52,6 -52,6 +52,23 @@@ namespace System.Web.Hosting 
                                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)
                {
@@@ -67,7 -67,7 +84,7 @@@
                        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
index e0866f00ec34f329f2a33e4342c433f00920c439,e0866f00ec34f329f2a33e4342c433f00920c439..4ae4df4d180e1d119dcb0aa7d066c9953330f87d
@@@ -1,3 -1,3 +1,8 @@@
++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
index 1e720270ee44d2df774b5e1939fd046dbf9ad826,1e720270ee44d2df774b5e1939fd046dbf9ad826..64d7d3eb0728d884a748a54dbc29632aaa99d975
@@@ -30,6 -30,6 +30,7 @@@
  #if NET_2_0
  using System;
  using System.Security.Permissions;
++using System.Web.Configuration;
  
  namespace System.Web.Hosting
  {
index e1f9d55e30c443407bf22f49569e0ea307e00dc1,e1f9d55e30c443407bf22f49569e0ea307e00dc1..ce2000d978ba6f76b5c7e50ebe9ecbbdfeffbea3
@@@ -261,6 -261,6 +261,7 @@@ System.Web.Hosting/DefaultVirtualFile.c
  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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7bb9decd873ea862cee35273986af354b6ed07f4
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++Test/standalone-tests/Consts.cs
++Test/standalone-tests/Locations.cs
index b95abc440b95327847badcf7bfa8f528afaabe9a,b95abc440b95327847badcf7bfa8f528afaabe9a..33c25c3ec95b3c806624342e20d6eb8282cada22
@@@ -1,3 -1,3 +1,8 @@@
++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 
index 887f3d4c5f203abdf2e27b6c56401629419f090f,887f3d4c5f203abdf2e27b6c56401629419f090f..c42f7d83d88128d7cd7d12ebe325f639be64bc3a
@@@ -36,6 -36,6 +36,7 @@@ using System.Net
  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 ();
                }
  
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..091f81863fc20bd448356b8c695ffa6b4220b90f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,7 @@@
++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
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d5db770bcb70f1533dbfbb1a4ec35a3388fe452e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,54 @@@
++//
++// 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);
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..01e8319d50d1a5f4140f4bf29eb79c7700edfa45
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,40 @@@
++//
++// 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);
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1e3a6de3187e55afd08b66e7ee5c1ad8a25d06a0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,38 @@@
++//
++// 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
++      {
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..11dd5549457bf7d7db8d5ae0fbbf8aec86f167d0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,158 @@@
++//
++// 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);
++                      }
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4f713962be8b3f4705cf35f26db5371c3e152280
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++//
++// 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);
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..0ec86376d144328db178784c1beabad31689e2bc
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,63 @@@
++//
++// 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;
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ac3c139012c9d69e213e09dd409deaa077315900
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,56 @@@
++//
++// 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;
++              }       
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..46b565ed7bb2b4c18506df41592eea6301874c3f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,63 @@@
++//
++// 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;
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ea1d2ac04c0f1cf6c779561124d6866f05d71eda
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,65 @@@
++//
++// 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);
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e359b04a0e2d4204c88627f1fb1da85563dcc532
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,54 @@@
++//
++// 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;
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a43418cddc2ab9b9e48a1bdb36f9f8bfd3c77365
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++2010-01-14  Marek Habersack  <mhabersack@novell.com>
++
++      * Consts.cs.in, Locations.cs: added
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9351e8e339dec3a86514ee120fbf735a8a32d03c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,44 @@@
++//
++// 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"));
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d2ddac8313bf0cc5637d100e2e04bc8a63324cd5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,116 @@@
++//
++// 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");
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d4d84c454c0ade6d26b993d7d8c26911331754b7
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,10 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7925a536624b061bd1bc456e66443c197f7e47e9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..526c742cd37a47b670d997fda44da31ed4b7195b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,41 @@@
++<?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>
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c2a41c4f97155cf93ddc7dd647d96dd48771f091
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,10 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7925a536624b061bd1bc456e66443c197f7e47e9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..ccd0d6bc103a89c7d1d4ff006a88b8aec86cc21d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,41 @@@
++<?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>
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b59f872573d182d7801970a67d57226f665cdba8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,10 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7925a536624b061bd1bc456e66443c197f7e47e9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,23 @@@
++<%@ 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>
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2b75bbd67317ce6044b5ed46798fd64dca6ac93e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,41 @@@
++<?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>
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1028688ca08051f1fe821f13d84d2b1829a6b5e3
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,6 @@@
++2010-01-14  Marek Habersack  <mhabersack@novell.com>
++
++      * standalone-runner.cs: added
++
++      * Makefile: added build targets for standalone-runner.exe
++
index d3a2a3240ab01d2597b169f1e83a9a1b1c75e302,d3a2a3240ab01d2597b169f1e83a9a1b1c75e302..9890fc50ed8dfa411faf34945dcac034911b131b
@@@ -1,10 -1,10 +1,32 @@@
--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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..bd215c6f6ff14e4711f57b317f6b9a25c6f83f47
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,211 @@@
++//
++//
++// 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));
++                      }
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..fff2c4ef8b0948cf2a42199599e770ba1405eefe
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,24 @@@
++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