While working on PR #11829 I stress-tested the tests by running multiple test
runs in parallel, and it turned out that many tests were not parallel-safe,
because they used the same temporary file names and ended up stomping on
eachother.
So I implemented a helper method that creates a guaranteed unique temporary
directory, and I've changed all tests to use this new helper method.
* I got confused between [TestFixtureSetup] and [Setup], so fix tests whose
[Setup] methods were changed/removed to properly clean up after each test
(using a [TearDown] method) so that the next time the on-demand creation of
objects works as expected (i.e. objects created in the [Setup] method should
be created on-demand once for each method instead of once for each class).
* Also fix SocketAcceptAsyncTest, the change to properly catch exceptions on
background threads was incorrect.
* [System] Fix line endings for a few files.
Best reviewed by not showing whitespace changes (should be empty diff in that case).
* [System] Fix potential crash in CookieParserTests.
Socket.EndAccept can throw an exception, which will crash the process if it
happens on a threadpool. So handle any exceptions when calling
Socket.EndAccept, and propagate those exceptions out of any threadpool code.
* [System.Net.Http] Throw a PlatformNotSupported exception when using HttpClientHandler on watchOS.
* [System.Net.Http] Tweak tests after watchOS API change.
Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.
* [System] Extract the HttpListenerResponseHelper class to a separate file.
Extract the HttpListenerResponseHelper class to a separate file so that it's
easier to replace the HttpListenerResponse implementation by using a different
file.
* [System] Throw a PlatformNotSupported exception when using the networking stack on watchOS.
* [System] Tweak tests after watchOS API changes.
Unfortunately the [ExpectedException] attribute can't be put on an entire
class, so remove the [Category ("RequiresBSDSockets")] attribute on the class
and instead decorate each test with an [ExpectedException] attribute.
* [System] Fix potential crash in SocketAcceptAsyncTest.
Fix potential crash in SocketAcceptAsyncTest by catching any exceptions in
code executed on the threadpool so that we never end up with unhandled
exceptions (which may terminate the process).
* [System] Avoid logic in SetUp attributes in tests.
Any type of exception in [SetUp] attributes causes all tests to fail with that
exception.
This even happens for tests that do not need the logic in the [SetUp]
attribute.
So rewrite tests a bit to not use [SetUp] when we can reasonably avoid it, and
instead instantiate class-level variables on first use. This ensures that any
exceptions that occur when initializing those variables are attributed to the
corresponding test, and not all of them.
* [System] Make exception handler (for test) catch more exceptions to avoid unhandled exceptions causing process termination.
* [System] Remove Obsolete attribute on API that throws PNSE.
MS. Removed upper limit check for Port. Modified Send to no longer
allow a whitespace-only Host. Moved checks for SpecifiedPickupDirectory
delivery method to SendFile, and use Path.IsPathRooted to check for
absolute paths instead of using a unix-only check. In Send, wrap all
non-SMTP errors in an SmtpException.
* SmtpException.cs: Correctly chain up all .ctors. Removed extra
null check in deserialization .ctor.
* SmtpClientTest.cs: Added property tests. Added Send argument check
tests.
* SmtpExceptionTest.cs: Added .ctor and GetObjectData tests.
* System_test.dll.sources: Added SmtpExceptionTest.cs.
svn path=/trunk/mcs/; revision=110647
* MailMessage.cs: add [MonoTODO] for FormatException in ctor,
throw ArugmentNullException's from the ctors,
add internal BodyContentType property,
change BodyEncoding to use BodyContentType,
change IsBodyHtml to use BodyContentType,
* SmtpClient.cs: set timeout initially to 100000,
don't throw ArgumentOutOfRangeException when Timeout = 0,
add [MonoTODO] for set_host, and throw Exceptions for it,
add [MonoTODO] for UseDefaultCredentials,
get messageContentType from the message,
use "127.0.0.1" for Host and 25 for Port
if host or port is not specified until reading
them from the configuration files is done
svn path=/trunk/mcs/; revision=55549