63 Commits
Author SHA1 Message Date
Alexander Köplinger 9606a8f180 [bcl] Remove usages of mono-project.com/go-mono.com/google.com in tests (#14586)
Use example.com and example.org instead.

Fixes https://github.com/mono/mono/issues/14585

Note that not all of the things I replaced make an actual network request but I thought it'd be nice to be consistent.
2019-05-23 14:12:14 +02:00
Alexander Köplinger 5f5676ae50 [System.ServiceModel] Switch tests to use embedded test resources 2018-09-27 22:47:07 +02:00
Manuel de la Pena 12d676563e [Tests] Skip System.ServiceModel tests that are not supported on XamMac 4.5 (#6574) 2018-01-18 19:08:03 +01:00
Manuel de la Pena 3f372d06ee [Tests] Skip some of the System.ServiceModel tests when using MOBILE (#6545)
Mobile does not support all clases found in System.ServiceModel, we skip
those tests of the not supported classes yet run all the others.
2018-01-17 13:50:28 +01:00
Alexander Köplinger 69b3397c8e [System.ServiceModel] Recognize 'faultactor' in SOAP fault message
It's an optional element according to [1] and we were simply
throwing a NotImplementedException when encountering it.

Fixed by reading the element value instead. I noticed that we
had a 'details' variable that was never assigned, so the check
for `details == null` was always true and can be removed.
This makes inlining the body of the CreateFault() call easier
since we no longer need to choose different overloads and makes
the code consistent with the CreateFault12 method.
Also added a better exception in case of an unrecognized element.

The CreateFault12 method (handles SOAP 1.2) does not need a similar
fix since actor is not an element in that version [2].

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42226

[1] https://www.w3.org/TR/soap11/#_Toc478383507
[2] https://www.w3.org/TR/soap12/#soapfault
2016-11-04 16:18:46 +01:00
Marcos Henrich 863dc73d19 [bcl] Add NUnitHelper.cs with API not in nunit-lite
NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert.

Also adds AssertHelper class with methods that are not part of nunitlite
Assert class.
2016-10-29 14:09:33 +02:00
Ludovic Henry 249daf43de [mcs] Replace NET_2_1 by MOBILE
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2016-08-18 16:34:36 +02:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Alexander Köplinger 98cf04084a [bcl] Remove NET_4_0 defines from class libs
NET_4_0 is always defined now, so the ifdefs are redundant.
I verified the libs are exactly the same after this change, so this is effectively a no-op.
2015-07-26 15:01:49 +02:00
Jo Shields 775ce53a74 Use random port numbers for ServiceModel tests.
This prevents race conditions when running multiple test suites at once on the same computer, as happens on our ARM builders.
2015-06-15 12:39:07 +01:00
Alexander Köplinger ddcfc42070 Cleanup namespace names of class lib tests to follow convention
A couple of the test suites didn't follow the MonoTests.<namespace of class under test> naming convention for the namespace.
2014-09-04 18:55:58 +02:00
Martin Baulig ea2f2cde42 [WCF]: Fix MessageEncoder.IsContentTypeSupported().
Use the internal 'Channels.ContentType' class to parse the
content type, make then comparision case-insensitive and ignore
missing parameters.
2012-12-22 05:14:26 +01:00
Martin Baulig c1b505c0ca [WCF]: Implement and improve missing WsdlExporter pieces.
* We now export simple <wsp:Policy>, currently supporting only
  those elements that WsdlImporter can import.

  WsdlImporter:
  https://github.com/mono/mono/commit/cdc98dba1b83341c25a1daab4ae7c217d4961ad1

* Implement `MetadataExporter.Errors' and use it for error
  reporting.

* Fixed WsdlExporter's caching to correclty deal with duplicate
  ExportContract() and ExportEndpoint() calls.

* Emit <soap12:operation> depending on the binding's MessageVersion.
  (FIXME: I didn't implement soap faults yet).

* MetadataTests: Check whether the policy elements are correct.

* MetadataTests: Add test containing simple [OperationContract] method
  for http and net.tcp; checks the <soap:operation> / <soap12:operation>
  elements.

* New test to check WsdlExporter's behavior regarding duplicate
  contracts and endpoints.

* ConnectionOrientedTransportBindingElement.cs, CustomBindingTests.cs,
  HttpTransportBindingElementTest.cs: Added test for custom message
  encodings.
2012-12-05 23:58:12 +01:00
Atsushi Eno e8cc6770c2 support action parameter in SOAP 1.2 content type. Close pull request #133. 2011-07-19 02:28:59 +09:00
Atsushi Eno 509f45a0ae finally implement Message.ToString() as in expected form.
Regressions on this method has caused several unpredictable errors,
so I avoided this for somewhat long time...
2011-06-14 18:43:29 +09:00
Sebastien Pouliot c5549b4868 Add (disabled) unit tests for sync use of CommunicationObject
* System.ServiceModel_test.dll.sources: Add new files to the tests
* Test/NUnitMoonHelper.cs: Helper to re-use Moonlight unit tests on NUnit
* Test/System.ServiceModel.Channels/CommunicationObjectSyncTest.cs: New.
2011-05-09 13:48:54 -04:00
Atsushi Eno cc60bcc264 Some argument check in TextMessageEncoder. 2011-04-15 23:48:31 +09:00
Alan McGovern b374a393db [System.ServiceModel] return the same object reference from MessageVersion.CreateVersion
The Silverlight SDK assemblies rely on this behaviour as do the new tests.
2011-04-14 11:00:33 +01:00
Carlos Alberto Cortez 4ba9634043 Add IPolicyExportExtension tests for classes in System.ServiceModel.Channels.
* CustomPolicyConversionContext.cs: New file, containing a dummy
	child of PolicyConversionContext.
	* MsmqBindingElementBaseTest.cs: New test file.
	* ConnectionOrientedTransportBindingElementTest.cs: New test file.
	* HttpTransportBindingElementTest.cs: Add IPolicyExportExtension
	tests.
2010-11-04 21:20:54 +01:00
Atsushi Eno 34e1278179 Implement NetTcpBinding.CanBuildChannelFactory/Listener and several related stuff.
SecurityTokenParameters.InitializeSecurityTokenRequirement() needs to become
protected internal, so changed all overrides as well.

Some implementation in WindowsStreamSecurityBindingElement is needed only for
NetTcpBinding implementation.

Had to disable a test in SymmetricSecurityBindingElement that depended on
OneWay support (which is not yet done).
2010-10-15 00:41:39 +09:00
Atsushi Eno a5043815da Override IsContentTypeSupported() in per-encoding-binding-element implementation to work as expected. 2010-09-24 16:26:28 +09:00
Atsushi Eno 60d557393c implement MessageEncodingBindingElement.GetProperty<T>(). 2010-08-11 01:38:43 +09:00
atsushieno 5a73102e40 Handle ListenUri to get correct Uri (especially when relative). Reject wrong behaviorConfiguration. 2010-07-28 18:00:25 +09:00
Atsushi Eno cf52630eec 2010-07-06 Atsushi Enomoto <[email protected]>
* ChannelFactoryBase.cs : null via uri parameter is not allowed.

	* ClientRuntimeChannel.cs : give non-null Via uri.

	* HttpTransportBindingElementTest.cs : add test for
	  ChannelFactoryBase`1.CreateChannel() with null via uri.


svn path=/trunk/mcs/; revision=159934
2010-07-06 04:24:32 +00:00
Atsushi Eno f5d38f374f 2010-06-18 Atsushi Enomoto <[email protected]>
* ServiceHostTest.cs : fix AddServiceEndpoint tests to make sense.
	  They are mostly not working. Enable working one.

	* TcpTransportBindingElementTest.cs : rename misleading test.


svn path=/trunk/mcs/; revision=159122
2010-06-18 08:50:26 +00:00
Atsushi Eno f5456a249a 2010-06-17 Atsushi Enomoto <[email protected]>
* Binding.cs : enable simpler MessageVersion code (issued got fixed).
	* MtomMessageEncodingBindingElement.cs, TransportBindingElement.cs,
	  TextMessageEncodingBindingElement.cs : return MessageVersion in
	  GetProperty<T>().

	* HttpTransportBindingElementTest.cs, CustomBindingTest.cs :
	  anohter couple of MessageVersion tests.


svn path=/trunk/mcs/; revision=159066
2010-06-17 11:24:58 +00:00
Atsushi Eno 1f4684cd40 2010-06-17 Atsushi Enomoto <[email protected]>
* ServiceHostBase.cs : retrieve MessageVersion and raise an error
	  if there is none. (Check this earlier than building a listener.)

	* ChannelDispatcher.cs : MessageVersion check is moved to
	  ServiceHostBase.

	* ServiceMetadataExtension.cs : overwrite MessageVersion to use None.
	  (The only special case I found for ChannelDispatcher.MessageVersion.)

	* CustomBindingTest.cs : add tests for MessageVersion check on Open().

	* MetadataExchangeBindingsTest.cs : make sure that special casing of
	  MessageVersion does not happen at this layer.


svn path=/trunk/mcs/; revision=159061
2010-06-17 10:48:55 +00:00
Atsushi Eno 2eb86de94d 2010-06-15 Atsushi Enomoto <[email protected]>
* TcpReplyChannel.cs : accept TCP channel on ReceiveRequest(). This
	  fixes standalone tcp-transport/sample[svc|cli]5.exe test in olive
	  (but not TcpTransportBindingElementTest.SimpleDuplexStreamed.)

	* TcpTransportBindingElementTest.cs : add connection tests (imported
	  from standalone olive tests), one is disabled for breakage.


svn path=/trunk/mcs/; revision=158924
2010-06-15 08:43:10 +00:00
Atsushi Eno bc0d9e7627 2010-05-14 Atsushi Enomoto <[email protected]>
* BindingContext.cs : actually clone is needed everywhere else too.
	* CustomBinding.cs : remove extra field.

	* BindingContextTest.cs : add a couple of tests with related to
	  RemainingBindingElements use. Some tests by Andreia Gaita.


svn path=/trunk/mcs/; revision=157350
2010-05-14 07:28:26 +00:00
Atsushi Eno adc4026eae 2010-04-21 Atsushi Enomoto <[email protected]>
* BindingContext.cs : require a TransportBindingElement when
	  building a channel listener.

	* CustomBindingTest.cs : enable BuildChannelListener test for no-
	  transport case. Test CanBuildChannelListener too.


svn path=/trunk/mcs/; revision=155857
2010-04-21 09:45:46 +00:00
Atsushi Eno e1b6d382fe 2010-04-01 Atsushi Enomoto <[email protected]>
* ConnectionOrientedTransportBindingElement.cs,
	  TcpTransportBindingElement.cs : implement GetProperty<T>().

	* TcpTransportBindingElementTest.cs : GetProperty<T>() here too.


svn path=/trunk/mcs/; revision=154624
2010-04-01 09:34:16 +00:00
Atsushi Eno 73481d620c 2010-04-01 Atsushi Enomoto <[email protected]>
* HttpTransportBindingElement.cs, HttpsTransportBindingElement.cs:
	  implement HttpsTransportBindingElement.GetProperty<T>(). Extend the
	  properties type from HTTP.

	* HttpsTransportBindingElementTest.cs :
	  added test for GetProperty<T>().


svn path=/trunk/mcs/; revision=154621
2010-04-01 09:13:45 +00:00
Atsushi Eno a08eda1815 2010-03-29 Atsushi Enomoto <[email protected]>
* FaultConverter.cs : implemented TryCreateException().

	* FaultConverterTest.cs : added more TryCreateException() tests.


svn path=/trunk/mcs/; revision=154376
2010-03-29 14:01:33 +00:00
Atsushi Eno 28e997e1e9 2010-03-29 Atsushi Enomoto <[email protected]>
* MessageHeaderTest.cs : enable one, add not-working cosmetic one.


svn path=/trunk/mcs/; revision=154367
2010-03-29 12:07:37 +00:00
Atsushi Eno 4f29247c43 2010-03-29 Atsushi Enomoto <[email protected]>
* MessageBufferTest.cs : enable not-working test.


svn path=/trunk/mcs/; revision=154363
2010-03-29 11:20:22 +00:00
Atsushi Eno 789dc0be76 2010-03-29 Atsushi Enomoto <[email protected]>
* MessageFault.cs : cosmetic method name clarification.

	* MessageFaultTest.cs : enable previous test.

	(made wrong commit in the previous test changelog)


svn path=/trunk/mcs/; revision=154356
2010-03-29 08:41:07 +00:00
Atsushi Eno 8056b10c0e 2010-03-29 Atsushi Enomoto <[email protected]>
* XmlReaderBodyWriter.cs, Message.cs, MessageImpl.cs, BodyWriter.cs:
	  fix BodyWriter buffering that dropped in-scope namespaces and thus
	  caused problem on resolving QNames.

	* MessageFaultTest.cs : enable previous test.


svn path=/trunk/mcs/; revision=154354
2010-03-29 07:43:14 +00:00
Atsushi Eno c1fba935ca 2010-03-26 Atsushi Enomoto <[email protected]>
* FaultConverterTest.cs, MessageFaultTest.cs : add new and not-working
	  tests.


svn path=/trunk/mcs/; revision=154286
2010-03-26 16:06:02 +00:00
Atsushi Eno 570c1d9c76 2010-03-26 Atsushi Enomoto <[email protected]>
* MessageImpl.cs : pass IsFault argument in OnCreateBufferedCopy().

	* MessageBufferTest.cs : add test for copy of IsFault value.


svn path=/trunk/mcs/; revision=154250
2010-03-26 08:10:09 +00:00
Atsushi Eno 55e8c59203 2010-03-25 Atsushi Enomoto <[email protected]>
* MessageTest.cs : add another IsFault tests, which exposed some
	  issues at client side.


svn path=/trunk/mcs/; revision=154199
2010-03-25 15:26:59 +00:00
Atsushi Eno bd6119f522 2010-01-21 Atsushi Enomoto <[email protected]>
* SslStreamSecurityBindingElementTest.cs : reduce extra base dep.


svn path=/trunk/mcs/; revision=149955
2010-01-21 03:48:24 +00:00
Atsushi Eno 9a72f4cdb6 2010-01-20 Atsushi Enomoto <[email protected]>
* AddressHeader.cs : implement remaining bits.
	  Eliminate dependency on NetDataContractSerializer.

	* AddressHeaderTest.cs : add reader and writer tests.


svn path=/trunk/mcs/; revision=149907
2010-01-20 14:05:06 +00:00
Atsushi Eno ff3954c708 2010-01-06 Atsushi Enomoto <[email protected]>
* BinaryMessageEncoder.cs : enable workaround buffering only when
	  the argument stream does *not* support seek. This fixes some
	  net.tcp connection problem.

	* BinaryMessageEncodingBindingElementTest.cs : added test for
	  connection-based tests for both TCP and HTTP (they give difference:
	  see BinaryMessageEncoder.cs change too).


svn path=/trunk/mcs/; revision=149103
2010-01-06 03:39:07 +00:00
Atsushi Eno efe6f6d540 2009-12-21 Atsushi Enomoto <[email protected]>
* MessageFault.cs : support EnvelopeVersion.None as well, as almost
	  the same as SOAP12.

	* MessageFaultTest.cs : add CreateFault test with MessageVersion.None.


svn path=/trunk/mcs/; revision=148797
2009-12-21 06:10:47 +00:00
Atsushi Eno fa8cca6868 2009-12-10 Atsushi Enomoto <[email protected]>
* MessageHeadersTest.cs : added another CopyHeadersFrom() test to
	  make sure there is no duplicate.


svn path=/trunk/mcs/; revision=148008
2009-12-10 07:23:25 +00:00
Atsushi Eno 47e8f1112d 2009-12-10 Atsushi Enomoto <[email protected]>
* MessageHeadersTest.cs : enable working test and remove old comment.


svn path=/trunk/mcs/; revision=148007
2009-12-10 07:18:27 +00:00
Atsushi Eno 95b8c6d86d 2009-12-10 Atsushi Enomoto <[email protected]>
* MessageHeaders.cs : null can be set as a WS-Addressing header item.

	* MessageHeadersTest.cs : make sure null can be set as a
	  WS-Addressing header when version is None.


svn path=/trunk/mcs/; revision=148006
2009-12-10 06:50:38 +00:00
Atsushi Eno 361233a3d4 2009-12-04 Atsushi Enomoto <[email protected]>
* HttpTransportBindingElement.cs : finished all GetProperty() values.

	* HttpTransportBindingElementTest.cs : added GetProperty() tests.


svn path=/trunk/mcs/; revision=147646
2009-12-04 09:51:53 +00:00
Atsushi Eno d9be950d9c 2009-12-03 Astushi Enomoto <[email protected]>
* System.ServiceModel_test.dll.sources:
	  added HttpsTransportBindingElementTest.cs.

	* HttpsTransportBindingElement.cs, HttpChannelListener.cs :
	  added URI scheme check.

	* HttpsTransportBindingElementTest.cs : new test.


svn path=/trunk/mcs/; revision=147538
2009-12-03 09:40:30 +00:00
Atsushi Eno 3f987a1b6f 2009-09-14 Atsushi Enomoto <[email protected]>
* MessagePropertiesTest.cs : new test.

	* MessageProperties.cs : fix CopyProperties() behavior to not
	  clear existing items. Make all properties call this[name].

	* System.ServiceModel_test.dll.sources: add MessagePropertiesTest.cs.


svn path=/trunk/mcs/; revision=141898
2009-09-14 17:03:34 +00:00