Commit Graph
17 Commits
Author SHA1 Message Date
Rolf Bjarne Kvinge e6536dd5e1 [System*] Throw a PlatformNotSupported exception when using the networking stack on watchOS. (#3606)
* [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.
2016-09-27 13:13:38 +02:00
Rolf Bjarne Kvinge 51de6e83eb [System*] Add category for tests that use API that require BSD sockets.
We don't have access to BSD sockets on watchOS, so that API
doesn't work.

With this category we'll be able to exclude these tests.
2016-07-26 13:20:51 +02:00
Marek Safar c1f06f09e2 [System] FileWebResponse/FileWebRequest from referencesource 2016-05-16 18:09:13 +02:00
Alexander Köplinger d4d7374efc [bcl] Remove ONLY_1_1 defines from class libs
This is not used anymore.
2015-01-21 17:18:30 +01:00
Alexander Köplinger 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Miguel de Icaza 8e07acf772 Multiple files:
Deals with the extension to Environment.OSVersion.Platform that might return a new
value MacOSX (6) on .NET
 

svn path=/trunk/mcs/; revision=121711
2008-12-17 17:56:25 +00:00
Gert Driesen 1dcde62f36 * FileWebRequestTest.cs: Now that we have proper locking for file
deletes on unix, bug #323388 applies to unix as well.

svn path=/trunk/mcs/; revision=101100
2008-04-18 08:49:53 +00:00
Ilya Kharmatsky 392b66dc17 In FileWebRequestTest and HttpWebRequestTest excluded not working under TARGET_JVM configuration tests.
svn path=/trunk/mcs/; revision=72468
2007-02-08 12:27:24 +00:00
Gert Driesen a13eda9ad1 * FileWebRequestTest.cs: Separate tests that fail on Windows due to
bug #80700, and ignore them on Windows.

svn path=/trunk/mcs/; revision=72146
2007-02-02 06:29:26 +00:00
Ilya Kharmatsky 66285529d7 Excluded the tests, which are not working under Grasshopper (all changes under 'TARGET_JVM' directive)
svn path=/trunk/mcs/; revision=72030
2007-01-31 15:20:18 +00:00
Gert Driesen d5c2cefed5 * FileWebRequest.cs: Fixed PreAuthenticate and Proxy properties to
no longer throw NotSupportedException. No longer store ContentLength
in headers. Do not allow null or zero-length method. Allow timeout
to be set to -1 (infine). Only disallow GET, HEAD and CONNECT requests.
Removed workarounds for bug #24943. In (Begin)GetRequest overwrite
file if it already exists. Binary serialization compatibility fixes.
* FileWebResponse.cs: Return application/octet-stream as ContentType.
* FileWebRequestTest.cs: Reworked tests to no longer rely on TMPDIR.
Added tests for ConnectionGroupName, ContentLength, ContentType,
Credentials, GetRequestStream, GetResponse, Method, PreAuthenticate,
Proxy, RequestUri, Timeout. Added binary serialization compatibility
tests.
* FileWebResponseTest.cs: Added tests for ContentLength, ContentType,
GetResponseStream, Headers, ResponseUri. 
* System_test.dll.sources: Added FileWebResponseTest.cs.

svn path=/trunk/mcs/; revision=71809
2007-01-28 15:52:04 +00:00
Ilya Kharmatsky 06e02f1ca1 Workaround Grasshopper's bugs with 'Ignore' and 'NotWorking' attribute / category.
svn path=/trunk/mcs/; revision=71680
2007-01-25 16:43:58 +00:00
Miguel de Icaza a157e4805e Fix the test, by removing extra /
svn path=/trunk/mcs/; revision=71499
2007-01-23 03:32:46 +00:00
Martin Willemoes Hansen 2320c1fddc * Removed: Old AllTests.cs files
* NUnit20ified the tests.

svn path=/trunk/mcs/; revision=12666
2003-03-18 21:45:41 +00:00
Lawrence Pit 9eaae02b12 * FileWebRequestTest.cs: all the async methods tests to behave the same
as in ms.net

svn path=/trunk/mcs/; revision=4766
2002-05-19 15:47:37 +00:00
Lawrence Pit 0f316137a0 * FileWebResponse.cs: added
* FileWebRequest.cs: some methods implemented

svn path=/trunk/mcs/; revision=4540
2002-05-11 21:31:35 +00:00