public InstrumentationOperation(InstrumentationTestRunner parent, string me, Handler handler,
                                 InstrumentationOperationType type, HttpOperationFlags flags,
                                 HttpStatusCode expectedStatus, WebExceptionStatus expectedError)
     : base(parent.Server, me, handler, flags, expectedStatus, expectedError)
 {
     Parent = parent;
     Type   = type;
 }
Example #2
0
        internal Task <bool> ReadHandler(
            TestContext ctx, InstrumentationOperationType type,
            int bytesRead, CancellationToken cancellationToken)
        {
            Interlocked.Increment(ref readHandlerCalled);

            if (type == InstrumentationOperationType.Primary)
            {
                return(PrimaryReadHandler(ctx, bytesRead, cancellationToken));
            }
            return(SecondaryReadHandler(ctx, bytesRead, cancellationToken));
        }
Example #3
0
        internal InstrumentationOperation StartOperation(
            TestContext ctx, CancellationToken cancellationToken,
            Handler handler, InstrumentationOperationType type,
            HttpOperationFlags flags)
        {
            var operation = CreateOperation(ctx, handler, type, flags);

            if (type == InstrumentationOperationType.Queued)
            {
                if (Interlocked.CompareExchange(ref queuedOperation, operation, null) != null)
                {
                    throw new InvalidOperationException("Invalid nested call.");
                }
            }
            operation.Start(ctx, cancellationToken);
            return(operation);
        }
Example #4
0
 internal abstract InstrumentationOperation CreateOperation(
     TestContext ctx, Handler handler,
     InstrumentationOperationType type,
     HttpOperationFlags flags);