当前位置: 首页>>代码示例>>C#>>正文


C# TestContext.LogMessage方法代码示例

本文整理汇总了C#中TestContext.LogMessage方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.LogMessage方法的具体用法?C# TestContext.LogMessage怎么用?C# TestContext.LogMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestContext的用法示例。


在下文中一共展示了TestContext.LogMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

		protected override async Task<MonoSslStream> Start (TestContext ctx, Socket socket, MSI.MonoTlsSettings settings, CancellationToken cancellationToken)
		{
			ctx.LogMessage ("Accepted connection from {0}.", socket.RemoteEndPoint);

			var stream = new NetworkStream (socket);
			var server = await ConnectionProvider.CreateServerStreamAsync (stream, Parameters, settings, cancellationToken);

			ctx.LogMessage ("Successfully authenticated server.");

			return server;
		}
开发者ID:peterdocter,项目名称:mono-tls,代码行数:11,代码来源:MonoServer.cs

示例2: Start

		protected override async Task<MonoSslStream> Start (TestContext ctx, Stream stream, MSI.MonoTlsSettings settings, CancellationToken cancellationToken)
		{
			ctx.LogMessage ("Connected.");

			var targetHost = Parameters.TargetHost ?? EndPoint.HostName ?? EndPoint.Address;
			ctx.LogDebug (1, "Using '{0}' as target host.", targetHost);

			var client = await ConnectionProvider.CreateClientStreamAsync (stream, targetHost, Parameters, settings, cancellationToken);

			ctx.LogMessage ("Successfully authenticated client.");

			return client;
		}
开发者ID:VimalKumarS,项目名称:mono-tls,代码行数:13,代码来源:MonoClient.cs

示例3: Start

		protected override async Task<MonoSslStream> Start (TestContext ctx, Stream stream, MSI.MonoTlsSettings settings, CancellationToken cancellationToken)
		{
			var server = await ConnectionProvider.CreateServerStreamAsync (stream, Parameters, settings, cancellationToken);

			ctx.LogMessage ("Successfully authenticated server.");

			return server;
		}
开发者ID:VimalKumarS,项目名称:mono-tls,代码行数:8,代码来源:MonoServer.cs

示例4: Shutdown

		public sealed override Task<bool> Shutdown (TestContext ctx, bool attemptCleanShutdown, CancellationToken cancellationToken)
		{
			return Task.Run (() => {
				ctx.LogMessage ("{0} shutdown: {1}", this, attemptCleanShutdown);
				return openssl.Shutdown (attemptCleanShutdown);
			});
		}
开发者ID:modulexcite,项目名称:mono-tls,代码行数:7,代码来源:OpenSslConnection.cs

示例5: Start

		public sealed override Task Start (TestContext ctx, CancellationToken cancellationToken)
		{
			var protocol = GetProtocolVersion ();
			ctx.LogMessage ("Starting {0} version {1}.", this, protocol);
			openssl = new NativeOpenSsl (IsServer, false, protocol);
			var validationCallback = GetValidationCallback ();
			openssl.SetCertificateVerify (NativeOpenSsl.VerifyMode.SSL_VERIFY_PEER, validationCallback);
			Initialize ();

			Task.Factory.StartNew (() => {
				try {
					CreateConnection ();
					createTcs.SetResult (null);
				} catch (Exception ex) {
					createTcs.SetException (ex);
				}
			});
			return FinishedTask;
		}
开发者ID:modulexcite,项目名称:mono-tls,代码行数:19,代码来源:OpenSslConnection.cs

示例6: RunMainLoopMartin

		async Task RunMainLoopMartin (TestContext ctx, CancellationToken cancellationToken)
		{
			ctx.LogMessage ("MAIN LOOP MARTIN");

			var buffer = new byte [4096];
			int ret = await Server.Stream.ReadAsync (buffer, 0, buffer.Length);
			ctx.LogMessage ("MAIN LOOP MARTIN #1: {0}", ret);
			DebugHelper.WriteBuffer ("READ", buffer, 0, ret);

			// await Server.Shutdown (ctx, true, true, cancellationToken);
			// ctx.LogMessage ("MAIN LOOP MARTIN #2");

			var secondRead = Server.Stream.ReadAsync (buffer, 0, buffer.Length);
			await Task.Delay (1500);
			await Client.Shutdown (ctx, true, cancellationToken);

			ret = await secondRead;
			ctx.LogMessage ("MAIN LOOP MARTIN #2: {0}", ret);
		}
开发者ID:modulexcite,项目名称:mono-tls,代码行数:19,代码来源:ConnectionInstrumentTestRunner.cs

示例7: Shutdown

		public sealed override Task<bool> Shutdown (TestContext ctx, CancellationToken cancellationToken)
		{
			ctx.LogMessage ("{0} shutdown", this);
			return Task.Factory.FromAsync (openssl.BeginShutdown, openssl.EndShutdown, true, null);
		}
开发者ID:VimalKumarS,项目名称:mono-tls,代码行数:5,代码来源:OpenSslConnection.cs

示例8: RunWithManualClient

		async Task RunWithManualClient (TestContext ctx, CancellationToken cancellationToken)
		{
			ctx.LogMessage ("MANUAL CLIENT");

			var serverStream = new StreamWrapper (Server.Stream);
			await serverStream.WriteLineAsync ("Hello World!");

			ctx.LogMessage ("WAITING FOR CLIENT INPUT");

			var line = await serverStream.ReadLineAsync ();
			ctx.LogMessage ("GOT CLIENT MESSAGE: {0}", line);

			await Shutdown (ctx, SupportsCleanShutdown, true, cancellationToken);
		}
开发者ID:peterdocter,项目名称:mono-tls,代码行数:14,代码来源:InstrumentationTestRunner.cs

示例9: RunWithManualServer

		async Task RunWithManualServer (TestContext ctx, CancellationToken cancellationToken)
		{
			var clientStream = new StreamWrapper (Client.Stream);

			ctx.LogMessage ("WRITING REQUEST: {0}", Parameters.ClientParameters.TargetHost ?? "<null>");

			await clientStream.WriteLineAsync ("GET / HTTP/1.0");
			try {
				if (Parameters.ClientParameters.TargetHost != null)
					await clientStream.WriteLineAsync (string.Format ("Host: {0}", Parameters.ClientParameters.TargetHost));
				await clientStream.WriteLineAsync ();
			} catch (Exception ex) {
				ctx.LogMessage ("RECEIVED EXCEPTION WHILE WRITING REQUEST: {0}", ex.Message);
			}

			var line = await clientStream.ReadLineAsync ();
			ctx.LogMessage ("GOT RESPONSE: {0}", line);

			HttpProtocol protocol;
			HttpStatusCode status;
			if (!HttpResponse.ParseResponseHeader (line, out protocol, out status))
				throw new ConnectionException ("Got unexpected output from server: '{0}'", line);

			ctx.LogMessage ("GOT RESPONSE: {0} {1}", protocol, status);

			await Shutdown (ctx, SupportsCleanShutdown, true, cancellationToken);
		}
开发者ID:peterdocter,项目名称:mono-tls,代码行数:27,代码来源:InstrumentationTestRunner.cs


注:本文中的TestContext.LogMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。