Commit Graph
203 Commits
Author SHA1 Message Date
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
Alex Rønne Petersen d56373ffc0 [WCF] Disable CloseTest and OpenTest4 in CustomPeerResolverServiceTest.
These tests occasionally time out:

Test Case Failures:
1) MonoTests.System.ServiceModel.PeerResolvers.CustomPeerResolverServiceTest.CloseTest : System.TimeoutException : The operation has timed-out.
at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0

I.e. we're timing out waiting for the async wait handle here: https://github.com/mono/mono/blob/master/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs#L495

Since we have no current WCF maintainer and this is deep, deep within
WCF land and causes unstable builds on Jenkins, disable these tests
for now.

Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21069
2014-07-03 02:31:07 +02:00
Alexander Köplinger db9f761a78 Fixed another 8080 test port
I missed that one in f396d37c54.
2014-06-18 10:01:36 +02:00
Alexander Köplinger f396d37c54 [System.ServiceModel] Changed test port from 8080 to 30158
Port 8080 is widely used and resulted in address conflicts on monojenkins, so we use a different port instead.

Commit licensed under MIT/X11.
2014-06-17 23:00:42 +02:00
Alexander Köplinger b0032294da [Test] Cleaned up how a bunch of tests were ignored
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
2014-02-23 19:44:21 +01:00
Martin Baulig d64187a447 [WCF]: Disable WsdlExporterTest.ExportMessageContract(). 2013-03-22 04:08:10 +01:00
Martin Baulig eb285f121c Merge branch 'master' into baulig 2013-01-21 20:56:20 +01:00
Martin Baulig 25a087aabd [WCF]: Fix BasicHttpBinding.TextEncoding's default value.
Multiple 'BasicHttpBinding' instances should have the same default
value for 'TextEncoding'.
2013-01-21 20:24:29 +01: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 5841893129 Add missing '#if NET_4_5'. 2012-12-07 01:34:01 +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
Martin Baulig b983c5c7fa [WCF]: Support embedded <wsp:Policy> elements. 2012-12-03 09:18:29 +01:00
Martin Baulig f67b2c74dc [WCF]: Metadata test improvements.
Only check whether 'System.Web.Services.Binding.Extensions' contains
the policy XmlElement when importing metadata, not when creating it
programmatically.
2012-11-28 16:06:01 +01:00
Martin Baulig 7335a66b27 [WCF]: Add and improve MetadataImport tests.
We now run the same tests from ImportTests.cs three times
using the following profiles:

* We load the metadata from an XML file.

* We create the metadata programmatically.

* We create the metadata programmatically, export it into
  XML, then import it back (round-trip).
2012-11-28 14:59:23 +01:00
Martin Baulig cdc98dba1b [WCF]: Implement missing WsdlImporter pieces.
The WsdlImporter can now import Bindings and Endpoints
from the WSDL, currently supporting BasicHttpBinding,
BasicHttpsBinding and NetTcpBinding.

There is also - limited and still experimental - support
for WS-Policy 1.5.  I only did the very basic pieces so
far, for instance things like TransportWithMessageCredentials
are not supported yet.

The policy importer will emit lots of warnings via
`MetadataImporter.Errors` (as warnings, not errors) whenever
it encounters something that it doesn't understand and
is also forgiving towards unknown and/or mal-formed
policy assertions.

This behavior is different from the MS runtime, which is
very strict, but there are simply too many missing pieces
to be more pedentic here.  Check whether Errors.Count == 0
to see whether all policy assertions have been correctly
imported.

There are also a few metadata samples, which are part of the
new nunit tests.  These are currently working:

  BasicHttp.xml, BasicHttp_Mtom.xml, BasicHttp_NtlmAuth.xml,
  BasicHttp_TransportSecurity.xml, BasicHttps.xml,
  BasicHttps_NtlmAuth.xml, NetTcp.xml, NetTcp_TransferMode.xml,
  NetTcp_TransportSecurity.xml

There are a few more in the Tests/MetadataTests/Resources/
directory which demonstrate missing pieces.
2012-11-27 02:30:54 +01:00
Martin Baulig 831ce5fccc [WCF]: New WsdlImporter nunit tests and sample wsdl docs.
This adds a bunch of new nunit tests and sample wsdl docs to
test the import of endpoints and bindings using WsdlImporter.
2012-11-27 00:56:37 +01:00
Martin Baulig a0a7c13e5f Disable failing tests on the Mac.
* System.Drawing (filed #7940 about this):
  GraphicsTest.DrawFillRectangle_Width_2 and
  GraphicsTest.FillDrawRectangle_Width_2

* Mono.Posix (filed #7942):
  UnixUserTest.NonReentrantSyscalls

* WCF (filed #7943):
  CallbackBehaviorAttributeTest.CallbackExample1
  CallbackBehaviorAttributeTest.CallbackExample2
  UriTemplateTest.EscapedUriCandidate
  UriTemplateTest.SimpleWebGet
  AnnouncementClientTest.AnnonceOnlineOfflineAddressSchemeMismatch
2012-10-23 13:02:01 +02:00
Martin Baulig aa2e9eca40 [WCF]: Fix WSDL import of methods with complex return types.
There is no bug report, the problem has been reported here:
http://stackoverflow.com/questions/12551090/monotouch-wcf-service-reference-cs-errors/12669880

DataContractSerializerMessageContractImporter.IsOperationImported()
did not check the method's return value, so it failed to recognize
methods such as

	[OperationContract]
	DateTime GetDate ();

as already being imported.  This caused the method to be imported with
both the DataContractMessageContractImporterInternal and the
XmlSerializerMessageContractImporterInternal, but the latter does not
resolve type references, see the FIXME in that class.

I also added a new test case for this.
2012-10-01 15:02:31 +02:00
Martin Baulig 7bf62cd13d [WCF] Fix relative endpoint addresses that start with a '/'.
For instance:

	ServiceHost host = new ServiceHost (typeof (Foo), new Uri ("http://localhost/echo"));
	var b = host.AddServiceEndpoint (typeof (Foo), new BasicHttpBinding (), "/b");

should resolve into 'http://localhost/echo/b'.
2012-09-19 07:08:02 +02:00
Martin Baulig 37b26ae4a0 [#7177][WCF]: Correctly handle derived FaultExceptions. 2012-09-19 06:01:11 +02:00
Martin Baulig 7c68dee830 [#6187][WCF]: Fix contract interface inheritance. 2012-09-18 05:20:30 +02:00
Enrico Sada d778e34c42 ServiceHost.Open should throw InvalidOperationException if service contract has zero operations
Fix bug https://bugzilla.xamarin.com/show_bug.cgi?id=290
2012-08-09 23:07:07 +02:00
Andrey Grishin 3bfba37d2a Fix binding for MexHttps 2012-07-18 13:55:09 +04:00
Marek Safar fc95bbb0f5 Disable failing tests 2012-06-22 12:29:11 +01:00
Marek Safar 69729c7e40 Disable more failing tests 2012-06-18 16:30:29 +01:00
Jonathan Pryor 00e29089c7 [System.ServiceModel] Don't try to deserialize void messages.
Fixes: http://bugzilla.xamarin.com/show_bug.cgi?id=1164

The breakage reported in #1164 was caused by commit 106fdeb4, which
fixed bxc206. The problem is that in fixing bxc206, response messages
of a type having a MessageContractAttribute custom attribute were
changed to have a `void` return type, according to the
MessageDescription's Body.ReturnValue.Type property.

This fix is correct, in that it's what .NET does, but it broke XML
deserialization which expected the "actual" return type to exist, not
`void`.

Case in point: the added IService1.EndJSMGetDatabases() method will
have a MessageDescription with a Body.ReturnValue.Type=typeof(void).
The problem is that deserializing this message will fail:

	System.Runtime.Serialization.SerializationException: Deserializing
	type 'System.Void'. Expecting state 'EndElement'. Encountered state
	'Text' with name '' with namespace ''.

Obviously this is not good. ;-)

The fix is simple: don't use the MessageDescription's ReturnValue if
it's `typeof(void)`.

There are two added wrinkles:

 1. Writing a test case for the above.

 2. The test case broke with another error: a NRE within
    BaseMessagesFormatter.MessageObjectToParts(). This is because
    when ContractDescriptionGenerator.GetMessage() sets the
    ReturnValue for a response message, it doesn't set
    MessagePartDescription.MemberInfo.
    BaseMessagesFormatter.MessageObjectToParts(), meanwhile, was
    checking the ReturnValue's MemberInfo...which was null.

    Add a null check here so that the actual bug can be tested.
2012-01-20 00:18:54 -05:00
Jonathan Pryor 5a6f9b7e52 [System.ServiceModel] Speed up Bug652331_2Test test execution.
For reasons I currently can't explain, the Service1Client test type
appears to support having only one async operation "in flight" at a
time. As a result of this, calling multiple Async methods on the
Service1Client instance, as was done previously, would result in not
all of the event handlers being invoked, and the test timing out
after 60s instead of exiting quickly because all event handlers had
been raised.

I don't understand enough of WCF & this code to say why Service1Client
can have only one async operation in progress at once, but making this
change so that each async operation operates on a separate instance
speeds up the Bug652331_2Test execution from 60s to 5s.
2012-01-20 00:18:53 -05:00
Miguel de Icaza 2852ed0b59 Update copyrights 2011-09-13 18:26:13 -04:00
Atsushi Eno 106fdeb492 ReturnValue in MessageDescription was missing when there was MessageContract. 2011-08-24 12:09:16 -07:00
Atsushi Eno 2be522da83 This filter should ignore port, and should not filter out anonymous URIs. 2011-08-24 12:00:59 -07:00
Atsushi Eno 5fc5f02c46 Merge pull request #145 from ngraziano/99b87f07af0beed3a887
Fix Service Model Xml Serialization and XMLAttributes
2011-08-03 05:54:54 +09:00
Atsushi Eno 951a6e6276 part of fix bug #41. MessageParameterAttribute is considered for return value. 2011-08-02 07:41:49 -07: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
Atsushi Eno 6f4a57dd4f Fix common issue in MetadataSet - call MoveToContent() while iterating nodes. 2011-05-10 19:58:17 +09:00
Atsushi Eno be4b6644f3 Add new MetadataSetTest and fix couple of minor issues. 2011-05-10 19:33:52 +09:00
Atsushi Eno 23a65d9a3c Revive this test by implementing mock web server. 2011-05-10 19:33:15 +09:00
Atsushi Eno ffb3d89126 Add (not-working) callback instance context mode test and FIXME comment. 2011-05-10 19:32:25 +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 75815614e7 ongoing XmlSerializerMessageContractImporter work.
It is part of bugfix #670945.
2011-05-09 22:58:18 +09:00
Atsushi Eno a316b856d0 Get real fix for bug #687902. Revert request processor IDisposable.
and handle session shutdown when creating InstanceContext.
Also add note on DisposeInstance(), which got me stuck.
2011-04-20 19:11:34 +09: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
Atsushi Eno 6b59934d78 Add ServiceKnownTypeAttributeTest. 2011-04-14 15:22:04 +09:00
Atsushi Eno 1b72f7f825 DataContractSerializerOperationBehavior is done too. Fix moonlight_raw build. 2011-04-07 22:01:26 +09:00
Peter Gerbrandt c48cff92ce Fix contract description for contracts with deep inheritance hierarchy. 2011-04-01 14:17:10 +09:00
Peter Gerbrandt bb22b06f22 Support for the same interface as service contract and as callback contract. 2011-03-07 12:51:19 +09:00
Atsushi Eno 5261535c35 Fix 2.0 test build (disable it). 2011-02-25 12:35:47 +09:00
Atsushi Eno 1d62f3e9e5 xsi:type parsing is wrong in default namespace resolution.
Fixed case #3 in bug #652331.
2011-02-16 18:02:28 +09:00
Atsushi Eno 3aaf87fe84 Message headers are now serialized and deserialized for MessageHeaderDescription. 2011-02-15 23:14:27 +09:00