本文整理汇总了C#中RuntimePipeline类的典型用法代码示例。如果您正苦于以下问题:C# RuntimePipeline类的具体用法?C# RuntimePipeline怎么用?C# RuntimePipeline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimePipeline类属于命名空间,在下文中一共展示了RuntimePipeline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
_requestFactory = new AWSSDK.UnitTests.HttpHandlerTests.MockHttpRequestFactory();
var httpHandler = new HttpHandler<Stream>(_requestFactory, this);
pipeline.ReplaceHandler<HttpHandler<Stream>>(httpHandler);
}
示例2: AddHandlerTest
public void AddHandlerTest()
{
var handlerA = new TestHandlerA();
var pipeline = new RuntimePipeline(handlerA);
var handlerB = new TestHandlerB();
// B->A
pipeline.AddHandler(handlerB);
ValidatePipeline(pipeline, handlerB, handlerA);
}
示例3: TestSignerWithBasicCredentialsAsync
public async Task TestSignerWithBasicCredentialsAsync()
{
var pipeline = new RuntimePipeline(new MockHandler());
pipeline.AddHandler(new Signer());
pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));
var context = CreateTestContext();
var signer = new MockSigner();
((RequestContext)context.RequestContext).Signer = signer;
await pipeline.InvokeAsync<AmazonWebServiceResponse>(context);
Assert.IsTrue(context.RequestContext.IsSigned);
Assert.AreEqual(1, signer.SignCount);
}
示例4: TestSignerWithAnonymousCredentials
public void TestSignerWithAnonymousCredentials()
{
var pipeline = new RuntimePipeline(new MockHandler());
pipeline.AddHandler(new Signer());
pipeline.AddHandler(new CredentialsRetriever(new AnonymousAWSCredentials()));
var context = CreateTestContext();
var signer = new MockSigner();
((RequestContext)context.RequestContext).Signer = signer;
pipeline.InvokeSync(context);
Assert.IsTrue(context.RequestContext.IsSigned);
Assert.AreEqual(0, signer.SignCount);
}
示例5: TestSignerWithBasicCredentials
public void TestSignerWithBasicCredentials()
{
var pipeline = new RuntimePipeline(new MockHandler());
pipeline.AddHandler(new Signer());
pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));
var context = CreateTestContext();
var signer = new MockSigner();
((RequestContext)context.RequestContext).Signer = signer;
pipeline.InvokeSync(context);
Assert.IsTrue(context.RequestContext.IsSigned);
Assert.AreEqual(1, signer.SignCount);
}
示例6: AddHandlerBeforeTest
public void AddHandlerBeforeTest()
{
var handlerD = new TestHandlerD();
var pipeline = new RuntimePipeline(handlerD);
var handlerB = new TestHandlerB();
// B->D
pipeline.AddHandler(handlerB);
var handlerA = new TestHandlerA();
// A->B->D
pipeline.AddHandlerBefore<TestHandlerB>(handlerA);
ValidatePipeline(pipeline, handlerA, handlerB, handlerD);
var handlerC = new TestHandlerC();
// A->B->C->D
pipeline.AddHandlerBefore<TestHandlerD>(handlerC);
ValidatePipeline(pipeline, handlerA, handlerB, handlerC, handlerD);
}
示例7: ReplaceHandlerTest
public void ReplaceHandlerTest()
{
var handlerC = new TestHandlerC();
var pipeline = new RuntimePipeline(handlerC);
var handlerB = new TestHandlerB();
pipeline.AddHandler(handlerB);
var handlerA = new TestHandlerA();
//A->B->C
pipeline.AddHandler(handlerA);
ValidatePipeline(pipeline, handlerA, handlerB, handlerC);
var handlerD = new TestHandlerD();
//A->D->C
pipeline.ReplaceHandler<TestHandlerB>(handlerD);
ValidatePipeline(pipeline, handlerA, handlerD, handlerC);
Assert.IsNull(handlerB.OuterHandler);
Assert.IsNull(handlerB.InnerHandler);
}
示例8: TestSignerWithMutableHeader
public void TestSignerWithMutableHeader()
{
var pipeline = new RuntimePipeline(new MockHandler());
pipeline.AddHandler(new Signer());
pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));
var context = CreateTestContext();
var signer = new AWS4Signer();
((RequestContext)context.RequestContext).Signer = signer;
// inject a mutable header that the signer should strip out
context.RequestContext.Request.Headers[HeaderKeys.XAmznTraceIdHeader] = "stuff";
pipeline.InvokeSync(context);
// verify that the header is not in the signature
var t = context.RequestContext.Request.Headers[HeaderKeys.AuthorizationHeader];
Assert.IsFalse(t.Contains(HeaderKeys.XAmznTraceIdHeader));
Assert.IsTrue(context.RequestContext.Request.Headers.ContainsKey(HeaderKeys.XAmznTraceIdHeader));
}
示例9: CustomizeRuntimePipeline
/// <summary>
/// Customizes the runtime pipeline.
/// </summary>
/// <param name="pipeline">Runtime pipeline for the current client.</param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.MachineLearning.Internal.ProcessRequestHandler());
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.MachineLearning.Internal.IdempotencyHandler());
}
示例10: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.ElasticFileSystem.Internal.IdempotencyHandler());
}
示例11: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonMobileAnalyticsException>(this.Logger));
}
示例12: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonSecurityTokenServiceException>(this.Logger));
}
示例13: CustomizeRuntimePipeline
/// <summary>
/// Customize the pipeline
/// </summary>
/// <param name="pipeline"></param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.RDS.Internal.PreSignedUrlRequestHandler(this.Credentials));
}
示例14: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.CloudSearchDomain.Internal.ProcessRequestHandler());
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.CloudSearchDomain.Internal.ValidationResponseHandler());
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.CloudSearchDomain.Internal.ProcessExceptionHandler());
}
示例15: CustomizeRuntimePipeline
/// <summary>
/// Customizes the runtime pipeline.
/// </summary>
/// <param name="pipeline">Runtime pipeline for the current client.</param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.CloudFormation.Internal.ProcessRequestHandler());
}