Xamarin Public Jenkins (auto-signing) 6bdd276d05 Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
2017-04-10 11:41:01 +00:00

98 lines
2.1 KiB
C#

//
// MonoTests.Remoting.HttpCalls.cs
//
// Author: Lluis Sanchez Gual (lluis@ximian.com)
//
// 2003 (C) Copyright, Ximian, Inc.
//
using System;
using System.Collections;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using NUnit.Framework;
namespace MonoTests.Remoting
{
/*
//[TestFixture]
public class HttpSyncCallTest : SyncCallTest
{
public override ChannelManager CreateChannelManager ()
{
return new HttpChannelManager ();
}
}
//[TestFixture]
public class HttpAsyncCallTest : AsyncCallTest
{
public override ChannelManager CreateChannelManager ()
{
return new HttpChannelManager ();
}
}
//[TestFixture]
public class HttpReflectionCallTest : ReflectionCallTest
{
public override ChannelManager CreateChannelManager ()
{
return new HttpChannelManager ();
}
}
//[TestFixture]
public class HttpDelegateCallTest : DelegateCallTest
{
public override ChannelManager CreateChannelManager ()
{
return new HttpChannelManager ();
}
}
//[TestFixture]
public class HttpBinarySyncCallTest : SyncCallTest
{
public override ChannelManager CreateChannelManager ()
{
return new HttpChannelManager ();
}
}
*/
[Serializable]
public class HttpChannelManager : ChannelManager
{
public override IChannelSender CreateClientChannel ()
{
Hashtable options = new Hashtable ();
options ["timeout"] = 10000; // 10s
return new HttpClientChannel (options, null);
}
public override IChannelReceiver CreateServerChannel ()
{
return new HttpChannel (0);
}
}
[Serializable]
public class HttpBinaryChannelManager : ChannelManager
{
public override IChannelSender CreateClientChannel ()
{
Hashtable options = new Hashtable ();
options ["timeout"] = 10000; // 10s
options ["name"] = "binary http channel";
return new HttpClientChannel (options, new BinaryClientFormatterSinkProvider ());
}
public override IChannelReceiver CreateServerChannel ()
{
return new HttpChannel (0);
}
}
}